OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute itand/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     Foam::fv::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 public:
00076 
00077     //- Runtime type information
00078     virtual const word& type() const = 0;
00079 
00080 
00081     // Declare run-time constructor selection tables
00082 
00083         declareRunTimeSelectionTable
00084         (
00085             tmp,
00086             convectionScheme,
00087             Istream,
00088             (
00089                 const fvMesh& mesh,
00090                 const surfaceScalarField& faceFlux,
00091                 Istream& schemeData
00092             ),
00093             (mesh, faceFlux, schemeData)
00094         );
00095 
00096         declareRunTimeSelectionTable
00097         (
00098             tmp,
00099             convectionScheme,
00100             Multivariate,
00101             (
00102                 const fvMesh& mesh,
00103                 const typename multivariateSurfaceInterpolationScheme<Type>::
00104                     fieldTable& fields,
00105                 const surfaceScalarField& faceFlux,
00106                 Istream& schemeData
00107             ),
00108             (mesh, fields, faceFlux, schemeData)
00109         );
00110 
00111 
00112     // Constructors
00113 
00114         //- Copy construct
00115         convectionScheme(const convectionScheme&);
00116 
00117         //- Construct from mesh, flux and Istream
00118         convectionScheme
00119         (
00120             const fvMesh& mesh,
00121             const surfaceScalarField&
00122         )
00123         :
00124             mesh_(mesh)
00125         {}
00126 
00127 
00128     // Selectors
00129 
00130         //- Return a pointer to a new convectionScheme created on freestore
00131         static tmp<convectionScheme<Type> > New
00132         (
00133             const fvMesh& mesh,
00134             const surfaceScalarField& faceFlux,
00135             Istream& schemeData
00136         );
00137 
00138 
00139         //- Return a pointer to a new multivariate convectionScheme
00140         //  created on freestore
00141         static tmp<convectionScheme<Type> > New
00142         (
00143             const fvMesh& mesh,
00144             const typename multivariateSurfaceInterpolationScheme<Type>::
00145                 fieldTable& fields,
00146             const surfaceScalarField& faceFlux,
00147             Istream& schemeData
00148         );
00149 
00150 
00151     // Destructor
00152 
00153         virtual ~convectionScheme();
00154 
00155 
00156     // Member Functions
00157 
00158         //- Return mesh reference
00159         const fvMesh& mesh() const
00160         {
00161             return mesh_;
00162         }
00163 
00164         virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00165         interpolate
00166         (
00167             const surfaceScalarField&,
00168             const GeometricField<Type, fvPatchField, volMesh>&
00169         ) const = 0;
00170 
00171         virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > flux
00172         (
00173             const surfaceScalarField&,
00174             const GeometricField<Type, fvPatchField, volMesh>&
00175         ) const = 0;
00176 
00177         virtual tmp<fvMatrix<Type> > fvmDiv
00178         (
00179             const surfaceScalarField&,
00180             GeometricField<Type, fvPatchField, volMesh>&
00181         ) const = 0;
00182 
00183         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDiv
00184         (
00185             const surfaceScalarField&,
00186             const GeometricField<Type, fvPatchField, volMesh>&
00187         ) const = 0;
00188 
00189 
00190     // Member operators
00191 
00192         void operator=(const convectionScheme<Type>&);
00193 };
00194 
00195 
00196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00197 
00198 } // End namespace fv
00199 
00200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00201 
00202 } // End namespace Foam
00203 
00204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00205 
00206 // Add the patch constructor functions to the hash tables
00207 
00208 #define makeFvConvectionTypeScheme(SS, Type)                                   \
00209                                                                                \
00210 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00211                                                                                \
00212 convectionScheme<Type>::addIstreamConstructorToTable<SS<Type> >                \
00213     add##SS##Type##IstreamConstructorToTable_;
00214 
00215 
00216 #define makeFvConvectionScheme(SS)                                             \
00217                                                                                \
00218 makeFvConvectionTypeScheme(SS, scalar)                                         \
00219 makeFvConvectionTypeScheme(SS, vector)                                         \
00220 makeFvConvectionTypeScheme(SS, sphericalTensor)                                \
00221 makeFvConvectionTypeScheme(SS, symmTensor)                                     \
00222 makeFvConvectionTypeScheme(SS, tensor)
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, sphericalTensor)                    \
00238 makeMultivariateFvConvectionTypeScheme(SS, symmTensor)                         \
00239 makeMultivariateFvConvectionTypeScheme(SS, tensor)
00240 
00241 
00242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00243 
00244 #ifdef NoRepository
00245 #   include "convectionScheme.C"
00246 #endif
00247 
00248 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00249 
00250 #endif
00251 
00252 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd