FreeFOAM The Cross-Platform CFD Toolkit
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 | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software; you can redistribute itand/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 <OpenFOAM/tmp.H>
41 #include <OpenFOAM/typeInfo.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>
66 :
67  public 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 
152  virtual ~convectionScheme();
153 
154 
155  // Member Functions
156 
157  //- Return mesh reference
158  const fvMesh& mesh() const
159  {
160  return mesh_;
161  }
162 
165  (
166  const surfaceScalarField&,
168  ) const = 0;
169 
171  (
172  const surfaceScalarField&,
174  ) const = 0;
175 
176  virtual tmp<fvMatrix<Type> > fvmDiv
177  (
178  const surfaceScalarField&,
180  ) const = 0;
181 
183  (
184  const surfaceScalarField&,
186  ) const = 0;
187 
188 
189  // Member operators
190 
191  void operator=(const convectionScheme<Type>&);
192 };
193 
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 } // End namespace fv
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 // Add the patch constructor functions to the hash tables
206 
207 #define makeFvConvectionTypeScheme(SS, Type) \
208  \
209 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
210  \
211 convectionScheme<Type>::addIstreamConstructorToTable<SS<Type> > \
212  add##SS##Type##IstreamConstructorToTable_;
213 
214 
215 #define makeFvConvectionScheme(SS) \
216  \
217 makeFvConvectionTypeScheme(SS, scalar) \
218 makeFvConvectionTypeScheme(SS, vector) \
219 makeFvConvectionTypeScheme(SS, sphericalTensor) \
220 makeFvConvectionTypeScheme(SS, symmTensor) \
221 makeFvConvectionTypeScheme(SS, tensor)
222 
223 
224 #define makeMultivariateFvConvectionTypeScheme(SS, Type) \
225  \
226 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
227  \
228 convectionScheme<Type>::addMultivariateConstructorToTable<SS<Type> > \
229  add##SS##Type##MultivariateConstructorToTable_;
230 
231 
232 #define makeMultivariateFvConvectionScheme(SS) \
233  \
234 makeMultivariateFvConvectionTypeScheme(SS, scalar) \
235 makeMultivariateFvConvectionTypeScheme(SS, vector) \
236 makeMultivariateFvConvectionTypeScheme(SS, sphericalTensor) \
237 makeMultivariateFvConvectionTypeScheme(SS, symmTensor) \
238 makeMultivariateFvConvectionTypeScheme(SS, tensor)
239 
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 #ifdef NoRepository
245 #endif
246 
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 
249 #endif
250 
251 // ************************ vim: set sw=4 sts=4 et: ************************ //