FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::fv::convectionScheme
00026 
00027 Description
00028     Abstract base class for convection schemes.
00029 
00030 SourceFiles
00031     convectionScheme.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef convectionScheme_H
00036 #define convectionScheme_H
00037 
00038 #include <OpenFOAM/tmp.H>
00039 #include <finiteVolume/volFieldsFwd.H>
00040 #include <finiteVolume/surfaceFieldsFwd.H>
00041 #include <OpenFOAM/typeInfo.H>
00042 #include <OpenFOAM/runTimeSelectionTables.H>
00043 #include <finiteVolume/multivariateSurfaceInterpolationScheme.H>
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 template<class Type>
00051 class fvMatrix;
00052 
00053 class fvMesh;
00054 
00055 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00056 
00057 namespace fv
00058 {
00059 
00060 /*---------------------------------------------------------------------------*\
00061                            Class convectionScheme Declaration
00062 \*---------------------------------------------------------------------------*/
00063 
00064 template<class Type>
00065 class convectionScheme
00066 :
00067     public refCount
00068 {
00069     // Private data
00070 
00071         const fvMesh& mesh_;
00072 
00073 
00074 public:
00075 
00076     //- Runtime type information
00077     virtual const word& type() const = 0;
00078 
00079 
00080     // Declare run-time constructor selection tables
00081 
00082         declareRunTimeSelectionTable
00083         (
00084             tmp,
00085             convectionScheme,
00086             Istream,
00087             (
00088                 const fvMesh& mesh,
00089                 const surfaceScalarField& faceFlux,
00090                 Istream& schemeData
00091             ),
00092             (mesh, faceFlux, schemeData)
00093         );
00094 
00095         declareRunTimeSelectionTable
00096         (
00097             tmp,
00098             convectionScheme,
00099             Multivariate,
00100             (
00101                 const fvMesh& mesh,
00102                 const typename multivariateSurfaceInterpolationScheme<Type>::
00103                     fieldTable& fields,
00104                 const surfaceScalarField& faceFlux,
00105                 Istream& schemeData
00106             ),
00107             (mesh, fields, faceFlux, schemeData)
00108         );
00109 
00110 
00111     // Constructors
00112 
00113         //- Copy construct
00114         convectionScheme(const convectionScheme&);
00115 
00116         //- Construct from mesh, flux and Istream
00117         convectionScheme
00118         (
00119             const fvMesh& mesh,
00120             const surfaceScalarField&
00121         )
00122         :
00123             mesh_(mesh)
00124         {}
00125 
00126 
00127     // Selectors
00128 
00129         //- Return a pointer to a new convectionScheme created on freestore
00130         static tmp<convectionScheme<Type> > New
00131         (
00132             const fvMesh& mesh,
00133             const surfaceScalarField& faceFlux,
00134             Istream& schemeData
00135         );
00136 
00137 
00138         //- Return a pointer to a new multivariate convectionScheme
00139         //  created on freestore
00140         static tmp<convectionScheme<Type> > New
00141         (
00142             const fvMesh& mesh,
00143             const typename multivariateSurfaceInterpolationScheme<Type>::
00144                 fieldTable& fields,
00145             const surfaceScalarField& faceFlux,
00146             Istream& schemeData
00147         );
00148 
00149 
00150     // Destructor
00151 
00152         virtual ~convectionScheme();
00153 
00154 
00155     // Member Functions
00156 
00157         //- Return mesh reference
00158         const fvMesh& mesh() const
00159         {
00160             return mesh_;
00161         }
00162 
00163         virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
00164         interpolate
00165         (
00166             const surfaceScalarField&,
00167             const GeometricField<Type, fvPatchField, volMesh>&
00168         ) const = 0;
00169 
00170         virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > flux
00171         (
00172             const surfaceScalarField&,
00173             const GeometricField<Type, fvPatchField, volMesh>&
00174         ) const = 0;
00175 
00176         virtual tmp<fvMatrix<Type> > fvmDiv
00177         (
00178             const surfaceScalarField&,
00179             GeometricField<Type, fvPatchField, volMesh>&
00180         ) const = 0;
00181 
00182         virtual tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDiv
00183         (
00184             const surfaceScalarField&,
00185             const GeometricField<Type, fvPatchField, volMesh>&
00186         ) const = 0;
00187 
00188 
00189     // Member operators
00190 
00191         void operator=(const convectionScheme<Type>&);
00192 };
00193 
00194 
00195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00196 
00197 } // End namespace fv
00198 
00199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00200 
00201 } // End namespace Foam
00202 
00203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00204 
00205 // Add the patch constructor functions to the hash tables
00206 
00207 #define makeFvConvectionTypeScheme(SS, Type)                                   \
00208                                                                                \
00209 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00210                                                                                \
00211 convectionScheme<Type>::addIstreamConstructorToTable<SS<Type> >                \
00212     add##SS##Type##IstreamConstructorToTable_;
00213 
00214 
00215 #define makeFvConvectionScheme(SS)                                             \
00216                                                                                \
00217 makeFvConvectionTypeScheme(SS, scalar)                                         \
00218 makeFvConvectionTypeScheme(SS, vector)                                         \
00219 makeFvConvectionTypeScheme(SS, sphericalTensor)                                \
00220 makeFvConvectionTypeScheme(SS, symmTensor)                                     \
00221 makeFvConvectionTypeScheme(SS, tensor)
00222 
00223 
00224 #define makeMultivariateFvConvectionTypeScheme(SS, Type)                       \
00225                                                                                \
00226 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00227                                                                                \
00228 convectionScheme<Type>::addMultivariateConstructorToTable<SS<Type> >           \
00229     add##SS##Type##MultivariateConstructorToTable_;
00230 
00231 
00232 #define makeMultivariateFvConvectionScheme(SS)                                 \
00233                                                                                \
00234 makeMultivariateFvConvectionTypeScheme(SS, scalar)                             \
00235 makeMultivariateFvConvectionTypeScheme(SS, vector)                             \
00236 makeMultivariateFvConvectionTypeScheme(SS, sphericalTensor)                    \
00237 makeMultivariateFvConvectionTypeScheme(SS, symmTensor)                         \
00238 makeMultivariateFvConvectionTypeScheme(SS, tensor)
00239 
00240 
00241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00242 
00243 #ifdef NoRepository
00244 #   include <finiteVolume/convectionScheme.C>
00245 #endif
00246 
00247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00248 
00249 #endif
00250 
00251 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines