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