OpenFOAM logo
Open Source CFD Toolkit

convectionScheme.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2005 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     convectionScheme
00027 
00028 Description
00029     Abstract base class for convection schemes.
00030 
00031 SourceFiles
00032     convectionScheme.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef convectionScheme_H
00037 #define convectionScheme_H
00038 
00039 #include "tmp.H"
00040 #include "volFieldsFwd.H"
00041 #include "surfaceFieldsFwd.H"
00042 #include "typeInfo.H"
00043 #include "runTimeSelectionTables.H"
00044 #include "multivariateSurfaceInterpolationScheme.H"
00045 
00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00047 
00048 namespace Foam
00049 {
00050 
00051 template<class Type>
00052 class fvMatrix;
00053 
00054 class fvMesh;
00055 
00056 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00057 
00058 namespace fv
00059 {
00060 
00061 /*---------------------------------------------------------------------------*\
00062                            Class convectionScheme Declaration
00063 \*---------------------------------------------------------------------------*/
00064 
00065 template<class Type>
00066 class convectionScheme
00067 :
00068     public refCount
00069 {
00070     // Private data
00071 
00072         const fvMesh& mesh_;
00073 
00074 
00075     // Private Member Functions
00076 
00077         //- Disallow copy construct
00078         convectionScheme(const convectionScheme&);
00079 
00080         //- Disallow default bitwise assignment
00081         void operator=(const convectionScheme&);
00082 
00083 
00084 public:
00085 
00086     //- Runtime type information
00087     virtual const word& type() const = 0;
00088 
00089 
00090     // Declare run-time constructor selection tables
00091 
00092         declareRunTimeSelectionTable
00093         (
00094             tmp,
00095             convectionScheme,
00096             Istream,
00097             (
00098                 const fvMesh& mesh,
00099                 const surfaceScalarField& faceFlux,
00100                 Istream& schemeData
00101             ),
00102             (mesh, faceFlux, schemeData)
00103         );
00104 
00105         declareRunTimeSelectionTable
00106         (
00107             tmp,
00108             convectionScheme,
00109             Multivariate,
00110             (
00111                 const fvMesh& mesh,
00112                 const typename multivariateSurfaceInterpolationScheme<Type>::
00113                     fieldTable& fields,
00114                 const surfaceScalarField& faceFlux,
00115                 Istream& schemeData
00116             ),
00117             (mesh, fields, faceFlux, schemeData)
00118         );
00119 
00120 
00121     // Constructors
00122 
00123         //- Construct from mesh, flux and Istream
00124         convectionScheme
00125         (
00126             const fvMesh& mesh,
00127             const surfaceScalarField&
00128         )
00129         :
00130             mesh_(mesh)
00131         {}
00132 
00133 
00134     // Selectors
00135 
00136         //- Return a pointer to a new convectionScheme created on freestore
00137         static tmp<convectionScheme<Type> > New
00138         (
00139             const fvMesh& mesh,
00140             const surfaceScalarField& faceFlux,
00141             Istream& schemeData
00142         );
00143 
00144 
00145         //- Return a pointer to a new multivariate convectionScheme
00146         //  created on freestore
00147         static tmp<convectionScheme<Type> > New
00148         (
00149             const fvMesh& mesh,
00150             const typename multivariateSurfaceInterpolationScheme<Type>::
00151                 fieldTable& fields,
00152             const surfaceScalarField& faceFlux,
00153             Istream& schemeData
00154         );
00155 
00156 
00157     // Destructor
00158 
00159         virtual ~convectionScheme();
00160 
00161 
00162     // Member Functions
00163 
00164         //- Return mesh reference
00165         const fvMesh& mesh() const
00166         {
00167             return mesh_;
00168         }
00169 
00170         virtual tmp<GeometricField<Type, fvPatchField, surfaceMesh> >
00171         interpolate
00172         (
00173             const surfaceScalarField&,
00174             const GeometricField<Type, fvPatchField, volMesh>&
00175         ) const = 0;
00176 
00177         virtual tmp<GeometricField<Type, fvPatchField, surfaceMesh> > flux
00178         (
00179             const surfaceScalarField&,
00180             const GeometricField<Type, fvPatchField, volMesh>&
00181         ) const = 0;
00182 
00183         virtual tmp<fvMatrix<Type> > fvmDiv
00184         (
00185             const surfaceScalarField&,
00186             GeometricField<Type, fvPatchField, volMesh>&
00187         ) const = 0;
00188 
00189         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDiv
00190         (
00191             const surfaceScalarField&,
00192             const GeometricField<Type, fvPatchField, volMesh>&
00193         ) const = 0;
00194 };
00195 
00196 
00197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00198 
00199 } // End namespace fv
00200 
00201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00202 
00203 } // End namespace Foam
00204 
00205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00206 
00207 // Add the patch constructor functions to the hash tables
00208 
00209 #define makeFvConvectionTypeScheme(SS, Type)                                   \
00210                                                                                \
00211 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00212                                                                                \
00213 convectionScheme<Type>::addIstreamConstructorToTable<SS<Type> >                \
00214     add##SS##Type##IstreamConstructorToTable_;
00215 
00216 
00217 #define makeFvConvectionScheme(SS)                                             \
00218                                                                                \
00219 makeFvConvectionTypeScheme(SS, scalar)                                         \
00220 makeFvConvectionTypeScheme(SS, vector)                                         \
00221 makeFvConvectionTypeScheme(SS, tensor)                                         \
00222 makeFvConvectionTypeScheme(SS, sphericalTensor)
00223 
00224 
00225 #define makeMultivariateFvConvectionTypeScheme(SS, Type)                       \
00226                                                                                \
00227 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00228                                                                                \
00229 convectionScheme<Type>::addMultivariateConstructorToTable<SS<Type> >           \
00230     add##SS##Type##MultivariateConstructorToTable_;
00231 
00232 
00233 #define makeMultivariateFvConvectionScheme(SS)                                 \
00234                                                                                \
00235 makeMultivariateFvConvectionTypeScheme(SS, scalar)                             \
00236 makeMultivariateFvConvectionTypeScheme(SS, vector)                             \
00237 makeMultivariateFvConvectionTypeScheme(SS, tensor)                             \
00238 makeMultivariateFvConvectionTypeScheme(SS, sphericalTensor)
00239 
00240 
00241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00242 
00243 #ifdef NoRepository
00244 #   include "convectionScheme.C"
00245 #endif
00246 
00247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00248 
00249 #endif
00250 
00251 // ************************************************************************* //
For further information go to www.openfoam.org