1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Abstract base class for ddt schemes.
34 \*---------------------------------------------------------------------------*/
40 #include "dimensionedType.H"
41 #include "volFieldsFwd.H"
42 #include "surfaceFieldsFwd.H"
44 #include "runTimeSelectionTables.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 /*---------------------------------------------------------------------------*\
62 Class ddtScheme Declaration
63 \*---------------------------------------------------------------------------*/
78 // Private Member Functions
80 //- Disallow copy construct
81 ddtScheme(const ddtScheme&);
83 //- Disallow default bitwise assignment
84 void operator=(const ddtScheme&);
89 //- Runtime type information
90 virtual const word& type() const = 0;
93 // Declare run-time constructor selection tables
95 declareRunTimeSelectionTable
100 (const fvMesh& mesh, Istream& schemeData),
107 //- Construct from mesh
108 ddtScheme(const fvMesh& mesh)
113 //- Construct from mesh and Istream
114 ddtScheme(const fvMesh& mesh, Istream&)
122 //- Return a pointer to a new ddtScheme created on freestore
123 static tmp<ddtScheme<Type> > New
132 virtual ~ddtScheme();
137 //- Return mesh reference
138 const fvMesh& mesh() const
143 virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDdt
145 const dimensioned<Type>&
148 virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDdt
150 const GeometricField<Type, fvPatchField, volMesh>&
153 virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDdt
155 const dimensionedScalar&,
156 const GeometricField<Type, fvPatchField, volMesh>&
159 virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDdt
161 const volScalarField&,
162 const GeometricField<Type, fvPatchField, volMesh>&
165 virtual tmp<fvMatrix<Type> > fvmDdt
167 GeometricField<Type, fvPatchField, volMesh>&
170 virtual tmp<fvMatrix<Type> > fvmDdt
172 const dimensionedScalar&,
173 GeometricField<Type, fvPatchField, volMesh>&
176 virtual tmp<fvMatrix<Type> > fvmDdt
178 const volScalarField&,
179 GeometricField<Type, fvPatchField, volMesh>&
183 typedef GeometricField
185 typename flux<Type>::type,
190 tmp<surfaceScalarField> fvcDdtPhiCoeff
192 const GeometricField<Type, fvPatchField, volMesh>& U,
193 const fluxFieldType& phi,
194 const fluxFieldType& phiCorr
197 tmp<surfaceScalarField> fvcDdtPhiCoeff
199 const GeometricField<Type, fvPatchField, volMesh>& U,
200 const fluxFieldType& phi
203 virtual tmp<fluxFieldType> fvcDdtPhiCorr
205 const volScalarField& rA,
206 const GeometricField<Type, fvPatchField, volMesh>& U,
207 const fluxFieldType& phi
210 tmp<surfaceScalarField> fvcDdtPhiCoeff
212 const volScalarField& rho,
213 const GeometricField<Type, fvPatchField, volMesh>& rhoU,
214 const fluxFieldType& phi
217 virtual tmp<fluxFieldType> fvcDdtPhiCorr
219 const volScalarField& rA,
220 const volScalarField& rho,
221 const GeometricField<Type, fvPatchField, volMesh>& U,
222 const fluxFieldType& phi
226 virtual tmp<surfaceScalarField> meshPhi
228 const GeometricField<Type, fvPatchField, volMesh>&
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 } // End namespace fv
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 } // End namespace Foam
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 // Add the patch constructor functions to the hash tables
245 #define makeFvDdtTypeScheme(SS, Type) \
247 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0); \
249 ddtScheme<Type>::addIstreamConstructorToTable<SS<Type> > \
250 add##SS##Type##IstreamConstructorToTable_;
253 #define makeFvDdtScheme(SS) \
255 makeFvDdtTypeScheme(SS, scalar) \
256 makeFvDdtTypeScheme(SS, vector) \
257 makeFvDdtTypeScheme(SS, sphericalTensor) \
258 makeFvDdtTypeScheme(SS, symmTensor) \
259 makeFvDdtTypeScheme(SS, tensor) \
262 tmp<surfaceScalarField> SS<scalar>::fvcDdtPhiCorr \
264 const volScalarField& rA, \
265 const volScalarField& U, \
266 const surfaceScalarField& phi \
269 notImplemented(#SS"<scalar>::fvcDdtPhiCorr"); \
270 return surfaceScalarField::null(); \
274 tmp<surfaceScalarField> SS<scalar>::fvcDdtPhiCorr \
276 const volScalarField& rA, \
277 const volScalarField& rho, \
278 const volScalarField& U, \
279 const surfaceScalarField& phi \
282 notImplemented(#SS"<scalar>::fvcDdtPhiCorr"); \
283 return surfaceScalarField::null(); \
287 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
290 # include "ddtScheme.C"
293 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
297 // ************************************************************************* //