limitWith.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::limitWith
28 
29 Group
30  grpFvLimitedSurfaceInterpolationSchemes
31 
32 Description
33  limitWith differencing scheme limits the specified scheme with the
34  specified limiter.
35 
36 SourceFiles
37  limitWith.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef limitWith_H
42 #define limitWith_H
43 
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class limitWith Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class Type>
57 class limitWith
58 :
59  public surfaceInterpolationScheme<Type>
60 {
61  // Private Member Functions
62 
63  //- Interpolation scheme
65 
66  //- Limiter
68 
69 
70  //- No copy construct
71  limitWith(const limitWith&) = delete;
72 
73  //- No copy assignment
74  void operator=(const limitWith&) = delete;
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("limitWith");
81 
82 
83  // Constructors
84 
85  //- Construct from mesh and Istream.
86  // The name of the flux field is read from the Istream and looked-up
87  // from the mesh objectRegistry
89  (
90  const fvMesh& mesh,
91  Istream& is
92  )
93  :
95  tInterp_
96  (
98  ),
99  tLimiter_
100  (
102  )
103  {}
104 
105  //- Construct from mesh, faceFlux and Istream
107  (
108  const fvMesh& mesh,
109  const surfaceScalarField& faceFlux,
110  Istream& is
111  )
112  :
114  tInterp_
115  (
116  surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
117  ),
118  tLimiter_
119  (
120  limitedSurfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
121  )
122  {}
123 
124 
125  // Member Functions
126 
127  //- Return the interpolation weighting factors
129  (
131  ) const
132  {
133  return tLimiter_().weights
134  (
135  vf,
136  tInterp_().weights(vf),
137  tLimiter_().limiter(vf)
138  );
139  }
140 
141  //- Return true if this scheme uses an explicit correction
142  virtual bool corrected() const
143  {
144  return tInterp_().corrected();
145  }
146 
147  //- Return the explicit correction to the face-interpolate
148  // for the given field
151  {
152  return tLimiter_().limiter(vf)*tInterp_().correction(vf);
153  }
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
Foam::surfaceInterpolationScheme::New
static tmp< surfaceInterpolationScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
Definition: surfaceInterpolationScheme.C:40
Foam::limitWith::weights
virtual tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &vf) const
Return the interpolation weighting factors.
Definition: limitWith.H:128
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::limitWith::corrected
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
Definition: limitWith.H:141
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::limitWith::correction
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > correction(const GeometricField< Type, fvPatchField, volMesh > &vf) const
Return the explicit correction to the face-interpolate.
Definition: limitWith.H:149
Foam::limitWith::TypeName
TypeName("limitWith")
Runtime type information.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::limitWith
limitWith differencing scheme limits the specified scheme with the specified limiter.
Definition: limitWith.H:56
Foam::limitedSurfaceInterpolationScheme
Abstract base class for limited surface interpolation schemes.
Definition: limitedSurfaceInterpolationScheme.H:54
limitedSurfaceInterpolationScheme.H
Foam::surfaceInterpolationScheme
Abstract base class for surface interpolation schemes.
Definition: surfaceInterpolationScheme.H:57
Foam::surfaceInterpolationScheme::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: surfaceInterpolationScheme.H:144
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >
Foam::limiter
tmp< areaScalarField > limiter(const areaScalarField &phi)
Definition: faNVDscheme.C:37
surfaceInterpolationScheme.H