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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::fv::convectionScheme
28
29Group
30 grpFvConvectionSchemes
31
32Description
33 Abstract base class for convection schemes.
34
35SourceFiles
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"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55template<class Type>
56class fvMatrix;
57
58class fvMesh;
59
60// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61
62namespace fv
63{
64
65/*---------------------------------------------------------------------------*\
66 Class convectionScheme Declaration
67\*---------------------------------------------------------------------------*/
68
69template<class Type>
71:
72 public refCount
73{
74 // Private data
75
76 const fvMesh& mesh_;
77
78
79public:
80
81 //- Runtime type information
82 virtual const word& type() const = 0;
83
84
85 // Declare run-time constructor selection tables
88 (
89 tmp,
91 Istream,
92 (
93 const fvMesh& mesh,
94 const surfaceScalarField& faceFlux,
95 Istream& schemeData
96 ),
97 (mesh, faceFlux, schemeData)
98 );
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;
175 (
176 const surfaceScalarField&,
178 ) const = 0;
181 (
182 const surfaceScalarField&,
184 ) const = 0;
187 (
188 const surfaceScalarField&,
190 ) const = 0;
191
192
193 // Member operators
194
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
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 }
223#define makeFvConvectionScheme(SS) \
224 \
225makeFvConvectionTypeScheme(SS, scalar) \
226makeFvConvectionTypeScheme(SS, vector) \
227makeFvConvectionTypeScheme(SS, sphericalTensor) \
228makeFvConvectionTypeScheme(SS, symmTensor) \
229makeFvConvectionTypeScheme(SS, tensor)
230
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
246#define makeMultivariateFvConvectionScheme(SS) \
247 \
248makeMultivariateFvConvectionTypeScheme(SS, scalar) \
249makeMultivariateFvConvectionTypeScheme(SS, vector) \
250makeMultivariateFvConvectionTypeScheme(SS, sphericalTensor) \
251makeMultivariateFvConvectionTypeScheme(SS, symmTensor) \
252makeMultivariateFvConvectionTypeScheme(SS, tensor)
253
254
255// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256
257#ifdef NoRepository
258 #include "convectionScheme.C"
259#endif
260
261// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
262
263#endif
264
265// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Abstract base class for convection schemes.
virtual tmp< GeometricField< Type, fvPatchField, volMesh > > fvcDiv(const surfaceScalarField &, const GeometricField< Type, fvPatchField, volMesh > &) const =0
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const surfaceScalarField &, const GeometricField< Type, fvPatchField, volMesh > &) const =0
void operator=(const convectionScheme< Type > &)
declareRunTimeSelectionTable(tmp, convectionScheme, Istream,(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &schemeData),(mesh, faceFlux, schemeData))
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > flux(const surfaceScalarField &, const GeometricField< Type, fvPatchField, volMesh > &) const =0
virtual ~convectionScheme()
Destructor.
declareRunTimeSelectionTable(tmp, convectionScheme, Multivariate,(const fvMesh &mesh, const typename multivariateSurfaceInterpolationScheme< Type >::fieldTable &fields, const surfaceScalarField &faceFlux, Istream &schemeData),(mesh, fields, faceFlux, schemeData))
const fvMesh & mesh() const
Return mesh reference.
convectionScheme(const fvMesh &mesh, const surfaceScalarField &)
Construct from mesh, flux and Istream.
virtual const word & type() const =0
Runtime type information.
virtual tmp< fvMatrix< Type > > fvmDiv(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.
Abstract base class for multi-variate surface interpolation schemes.
Reference counter for various OpenFOAM components.
Definition: refCount.H:51
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Abstract base class for finite volume calculus convection schemes.
Namespace for OpenFOAM.
labelList fv(nPoints)
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97