OpenFOAM logo
Open Source CFD Toolkit

faConvectionScheme.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     faConvectionScheme.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef faConvectionScheme_H
00037 #define faConvectionScheme_H
00038 
00039 #include "tmp.H"
00040 #include "areaFieldsFwd.H"
00041 #include "edgeFieldsFwd.H"
00042 #include "typeInfo.H"
00043 #include "runTimeSelectionTables.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 template<class Type>
00051 class faMatrix;
00052 
00053 class faMesh;
00054 
00055 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00056 
00057 namespace fa
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 faMesh& mesh_;
00072 
00073 
00074     // Private Member Functions
00075 
00076         //- Disallow copy construct
00077         convectionScheme(const convectionScheme&);
00078 
00079         //- Disallow default bitwise assignment
00080         void operator=(const convectionScheme&);
00081 
00082 
00083 public:
00084 
00085     // Declare run-time constructor selection tables
00086 
00087         declareRunTimeSelectionTable
00088         (
00089             tmp,
00090             convectionScheme,
00091             Istream,
00092             (
00093                 const faMesh& mesh,
00094                 const edgeScalarField& faceFlux,
00095                 Istream& schemeData
00096             ),
00097             (mesh, faceFlux, schemeData)
00098         );
00099 
00100 
00101     // Constructors
00102 
00103         //- Construct from mesh, flux and Istream
00104         convectionScheme
00105         (
00106             const faMesh& mesh,
00107             const edgeScalarField& faceFlux
00108         )
00109         :
00110             mesh_(mesh)
00111         {}
00112 
00113 
00114     // Selectors
00115 
00116         //- Return a pointer to a new convectionScheme created on freestore
00117         static tmp<convectionScheme<Type> > New
00118         (
00119             const faMesh& mesh,
00120             const edgeScalarField& faceFlux,
00121             Istream& schemeData
00122         );
00123 
00124 
00125     // Destructor
00126 
00127         virtual ~convectionScheme();
00128 
00129 
00130     // Member Functions
00131 
00132         //- Return mesh reference
00133         const faMesh& mesh() const
00134         {
00135             return mesh_;
00136         }
00137 
00138         virtual tmp<GeometricField<Type, faPatchField, edgeMesh> > flux
00139         (
00140             const edgeScalarField&,
00141             const GeometricField<Type, faPatchField, areaMesh>&
00142         ) const = 0;
00143 
00144         virtual tmp<faMatrix<Type> > famDiv
00145         (
00146             const edgeScalarField&,
00147             GeometricField<Type, faPatchField, areaMesh>&
00148         ) const = 0;
00149 
00150         virtual tmp<GeometricField<Type, faPatchField, areaMesh> > facDiv
00151         (
00152             const edgeScalarField&,
00153             const GeometricField<Type, faPatchField, areaMesh>&
00154         ) const = 0;
00155 };
00156 
00157 
00158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00159 
00160 } // End namespace fa
00161 
00162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00163 
00164 } // End namespace Foam
00165 
00166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00167 
00168 // Add the patch constructor functions to the hash tables
00169 
00170 #define makeFaConvectionTypeScheme(SS, Type)                                   \
00171                                                                                \
00172 defineNamedTemplateTypeNameAndDebug(SS<Type>, 0);                              \
00173                                                                                \
00174 convectionScheme<Type>::addIstreamConstructorToTable<SS<Type> >                \
00175     add##SS##Type##IstreamConstructorToTable_;
00176 
00177 
00178 #define makeFaConvectionScheme(SS)                                             \
00179                                                                                \
00180 makeFaConvectionTypeScheme(SS, scalar)                                         \
00181 makeFaConvectionTypeScheme(SS, vector)                                         \
00182 makeFaConvectionTypeScheme(SS, tensor)
00183 
00184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00185 
00186 #ifdef NoRepository
00187 #   include "faConvectionScheme.C"
00188 #endif
00189 
00190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00191 
00192 #endif
00193 
00194 // ************************************************************************* //
For further information go to www.openfoam.org