limitedSurfaceInterpolationScheme.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::limitedSurfaceInterpolationScheme
26 
27 Description
28  Abstract base class for limited surface interpolation schemes.
29 
30 SourceFiles
31  limitedSurfaceInterpolationScheme.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef limitedSurfaceInterpolationScheme_H
36 #define limitedSurfaceInterpolationScheme_H
37 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class limitedSurfaceInterpolationScheme Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class Type>
51 :
52  public surfaceInterpolationScheme<Type>
53 {
54 
55 protected:
56 
57  // Protected data
58 
60 
61 
62 public:
63 
64  //- Runtime type information
65  TypeName("limitedSurfaceInterpolationScheme");
66 
67 
68  // Declare run-time constructor selection tables
69 
71  (
72  tmp,
74  Mesh,
75  (
76  const fvMesh& mesh,
77  Istream& schemeData
78  ),
79  (mesh, schemeData)
80  );
81 
83  (
84  tmp,
86  MeshFlux,
87  (
88  const fvMesh& mesh,
89  const surfaceScalarField& faceFlux,
90  Istream& schemeData
91  ),
92  (mesh, faceFlux, schemeData)
93  );
94 
95 
96  // Constructors
97 
98  //- Construct from mesh and faceFlux
100  (
101  const fvMesh& mesh,
102  const surfaceScalarField& faceFlux
103  )
104  :
105  surfaceInterpolationScheme<Type>(mesh),
106  faceFlux_(faceFlux)
107  {}
108 
109  //- Construct from mesh and Istream.
110  // The name of the flux field is read from the Istream and looked-up
111  // from the mesh objectRegistry
113  (
114  const fvMesh& mesh,
115  Istream& is
116  )
117  :
118  surfaceInterpolationScheme<Type>(mesh),
119  faceFlux_
120  (
121  mesh.lookupObject<surfaceScalarField>
122  (
123  word(is)
124  )
125  )
126  {}
127 
128  //- Disallow default bitwise copy construction
130  (
132  );
133 
134 
135  // Selectors
136 
137  //- Return new tmp interpolation scheme
139  (
140  const fvMesh& mesh,
141  Istream& schemeData
142  );
143 
144  //- Return new tmp interpolation scheme
146  (
147  const fvMesh& mesh,
148  const surfaceScalarField& faceFlux,
149  Istream& schemeData
150  );
151 
152 
153  //- Destructor
155 
156 
157  // Member Functions
158 
159  //- Return the interpolation weighting factors
161  (
163  ) const = 0;
164 
165  //- Return the interpolation weighting factors for the given field,
166  // by limiting the given weights with the given limiter
168  (
170  const surfaceScalarField& CDweights,
171  tmp<surfaceScalarField> tLimiter
172  ) const;
173 
174  //- Return the interpolation weighting factors for the given field
176  (
178  ) const;
179 
180  //- Return the interpolation weighting factors
182  flux
183  (
185  ) const;
186 
187 
188  // Member Operators
189 
190  //- Disallow default bitwise assignment
191  void operator=(const limitedSurfaceInterpolationScheme&) = delete;
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace Foam
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 // Add the patch constructor functions to the hash tables
203 #define makelimitedSurfaceInterpolationTypeScheme(SS, Type) \
204  \
205 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
206  \
207 surfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
208  add##SS##Type##MeshConstructorToTable_; \
209  \
210 surfaceInterpolationScheme<Type>::addMeshFluxConstructorToTable<SS<Type>> \
211  add##SS##Type##MeshFluxConstructorToTable_; \
212  \
213 limitedSurfaceInterpolationScheme<Type>::addMeshConstructorToTable<SS<Type>> \
214  add##SS##Type##MeshConstructorToLimitedTable_; \
215  \
216 limitedSurfaceInterpolationScheme<Type>:: \
217  addMeshFluxConstructorToTable<SS<Type>> \
218  add##SS##Type##MeshFluxConstructorToLimitedTable_;
220 #define makelimitedSurfaceInterpolationScheme(SS) \
221  \
222 makelimitedSurfaceInterpolationTypeScheme(SS, scalar) \
223 makelimitedSurfaceInterpolationTypeScheme(SS, vector) \
224 makelimitedSurfaceInterpolationTypeScheme(SS, sphericalTensor) \
225 makelimitedSurfaceInterpolationTypeScheme(SS, symmTensor) \
226 makelimitedSurfaceInterpolationTypeScheme(SS, tensor)
227 
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 #ifdef NoRepository
233 #endif
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************************************************************* //
limitedSurfaceInterpolationScheme(const fvMesh &mesh, const surfaceScalarField &faceFlux)
Construct from mesh and faceFlux.
virtual tmp< surfaceScalarField > limiter(const GeometricField< Type, fvPatchField, volMesh > &) const =0
Return the interpolation weighting factors.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
static tmp< limitedSurfaceInterpolationScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
TypeName("limitedSurfaceInterpolationScheme")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
void operator=(const limitedSurfaceInterpolationScheme &)=delete
Disallow default bitwise assignment.
tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &, const surfaceScalarField &CDweights, tmp< surfaceScalarField > tLimiter) const
Return the interpolation weighting factors for the given field,.
declareRunTimeSelectionTable(tmp, limitedSurfaceInterpolationScheme, Mesh,(const fvMesh &mesh, Istream &schemeData),(mesh, schemeData))
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Abstract base class for limited surface interpolation schemes.
A class for managing temporary objects.
Definition: PtrList.H:53
Abstract base class for surface interpolation schemes.
Namespace for OpenFOAM.