convectionScheme.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-2019 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::fv::convectionScheme
26 
27 Description
28  Abstract base class for convection schemes.
29 
30 SourceFiles
31  convectionScheme.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef convectionScheme_H
36 #define convectionScheme_H
37 
38 #include "tmp.H"
39 #include "volFieldsFwd.H"
40 #include "surfaceFieldsFwd.H"
41 #include "typeInfo.H"
42 #include "runTimeSelectionTables.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 template<class Type>
51 class fvMatrix;
52 
53 class fvMesh;
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace fv
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class convectionScheme Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class Type>
65 class convectionScheme
66 :
67  public tmp<convectionScheme<Type>>::refCount
68 {
69  // Private Data
70 
71  const fvMesh& mesh_;
72 
73 
74 public:
75 
76  //- Runtime type information
77  virtual const word& type() const = 0;
78 
79 
80  // Declare run-time constructor selection tables
81 
83  (
84  tmp,
86  Istream,
87  (
88  const fvMesh& mesh,
89  const surfaceScalarField& faceFlux,
90  Istream& schemeData
91  ),
92  (mesh, faceFlux, schemeData)
93  );
94 
96  (
97  tmp,
99  Multivariate,
100  (
101  const fvMesh& mesh,
103  fieldTable& fields,
104  const surfaceScalarField& faceFlux,
105  Istream& schemeData
106  ),
107  (mesh, fields, faceFlux, schemeData)
108  );
109 
110 
111  // Constructors
112 
113  //- Copy construct
115 
116  //- Construct from mesh, flux and Istream
118  (
119  const fvMesh& mesh,
120  const surfaceScalarField&
121  )
122  :
123  mesh_(mesh)
124  {}
125 
126 
127  // Selectors
128 
129  //- Return a pointer to a new convectionScheme created on freestore
131  (
132  const fvMesh& mesh,
133  const surfaceScalarField& faceFlux,
134  Istream& schemeData
135  );
136 
137 
138  //- Return a pointer to a new multivariate convectionScheme
139  // created on freestore
141  (
142  const fvMesh& mesh,
144  fieldTable& fields,
145  const surfaceScalarField& faceFlux,
146  Istream& schemeData
147  );
148 
149 
150  //- Destructor
151  virtual ~convectionScheme();
152 
153 
154  // Member Functions
155 
156  //- Return mesh reference
157  const fvMesh& mesh() const
158  {
159  return mesh_;
160  }
161 
164  (
165  const surfaceScalarField&,
167  ) const = 0;
168 
170  (
171  const surfaceScalarField&,
173  ) const = 0;
174 
175  virtual tmp<fvMatrix<Type>> fvmDiv
176  (
177  const surfaceScalarField&,
179  ) const = 0;
180 
182  (
183  const surfaceScalarField&,
185  ) const = 0;
186 
187 
188  // Member Operators
189 
190  void operator=(const convectionScheme<Type>&);
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace fv
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 } // End namespace Foam
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 // Add the patch constructor functions to the hash tables
206 #define makeFvConvectionTypeScheme(SS, Type) \
207  defineNamedTemplateTypeNameAndDebug(Foam::fv::SS<Foam::Type>, 0); \
208  \
209  namespace Foam \
210  { \
211  namespace fv \
212  { \
213  convectionScheme<Type>::addIstreamConstructorToTable<SS<Type>> \
214  add##SS##Type##IstreamConstructorToTable_; \
215  } \
216  }
218 #define makeFvConvectionScheme(SS) \
219  \
220 makeFvConvectionTypeScheme(SS, scalar) \
221 makeFvConvectionTypeScheme(SS, vector) \
222 makeFvConvectionTypeScheme(SS, sphericalTensor) \
223 makeFvConvectionTypeScheme(SS, symmTensor) \
224 makeFvConvectionTypeScheme(SS, tensor)
225 
227 #define makeMultivariateFvConvectionTypeScheme(SS, Type) \
228  defineNamedTemplateTypeNameAndDebug(Foam::fv::SS<Foam::Type>, 0); \
229  \
230  namespace Foam \
231  { \
232  namespace fv \
233  { \
234  convectionScheme<Type>:: \
235  addMultivariateConstructorToTable<SS<Type>> \
236  add##SS##Type##MultivariateConstructorToTable_; \
237  } \
238  }
239 
241 #define makeMultivariateFvConvectionScheme(SS) \
242  \
243 makeMultivariateFvConvectionTypeScheme(SS, scalar) \
244 makeMultivariateFvConvectionTypeScheme(SS, vector) \
245 makeMultivariateFvConvectionTypeScheme(SS, sphericalTensor) \
246 makeMultivariateFvConvectionTypeScheme(SS, symmTensor) \
247 makeMultivariateFvConvectionTypeScheme(SS, tensor)
248 
249 
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251 
252 #ifdef NoRepository
253  #include "convectionScheme.C"
254 #endif
255 
256 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
257 
258 #endif
259 
260 // ************************************************************************* //
convectionScheme(const convectionScheme &)
Copy construct.
void operator=(const convectionScheme< Type > &)
Reference counter for various OpenFOAM components.
Definition: refCount.H:49
virtual ~convectionScheme()
Destructor.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual tmp< GeometricField< Type, fvPatchField, volMesh > > fvcDiv(const surfaceScalarField &, const GeometricField< Type, fvPatchField, volMesh > &) const =0
Abstract base class for convection schemes.
declareRunTimeSelectionTable(tmp, convectionScheme, Istream,(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &schemeData),(mesh, faceFlux, schemeData))
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
virtual const word & type() const =0
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
labelList fv(nPoints)
virtual tmp< fvMatrix< Type > > fvmDiv(const surfaceScalarField &, const GeometricField< Type, fvPatchField, volMesh > &) const =0
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux(const surfaceScalarField &, const GeometricField< Type, fvPatchField, volMesh > &) const =0
static tmp< convectionScheme< Type > > New(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &schemeData)
Return a pointer to a new convectionScheme created on freestore.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Abstract base class for multi-variate surface interpolation schemes.
const fvMesh & mesh() const
Return mesh reference.
Macros to ease declaration of run-time selection tables.
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const surfaceScalarField &, const GeometricField< Type, fvPatchField, volMesh > &) const =0
A class for managing temporary objects.
Definition: PtrList.H:53
Abstract base class for finite volume calculus convection schemes.
Namespace for OpenFOAM.