00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
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 
00062 
00063 
00064 template<class Type>
00065 class convectionScheme
00066 :
00067     public refCount
00068 {
00069     
00070 
00071         const fvMesh& mesh_;
00072 
00073 
00074 public:
00075 
00076     
00077     virtual const word& type() const = 0;
00078 
00079 
00080     
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     
00112 
00113         
00114         convectionScheme(const convectionScheme&);
00115 
00116         
00117         convectionScheme
00118         (
00119             const fvMesh& mesh,
00120             const surfaceScalarField&
00121         )
00122         :
00123             mesh_(mesh)
00124         {}
00125 
00126 
00127     
00128 
00129         
00130         static tmp<convectionScheme<Type> > New
00131         (
00132             const fvMesh& mesh,
00133             const surfaceScalarField& faceFlux,
00134             Istream& schemeData
00135         );
00136 
00137 
00138         
00139         
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     
00151 
00152         virtual ~convectionScheme();
00153 
00154 
00155     
00156 
00157         
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     
00190 
00191         void operator=(const convectionScheme<Type>&);
00192 };
00193 
00194 
00195 
00196 
00197 } 
00198 
00199 
00200 
00201 } 
00202 
00203 
00204 
00205 
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