OpenFOAM logo
Open Source CFD Toolkit

PhiScheme.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     PhiScheme
00027 
00028 Description
00029 
00030     Class to create the weighting-factors based on the face-flux.
00031     The particular differencing scheme class is supplied as a template argument,
00032     the weight function of which is called by the weight function of this class
00033     for the internal faces as well as faces of coupled patches
00034     (e.g. processor-processor patches). The weight function is supplied the
00035     central-differencing weighting factor, the face-flux, the cell and face
00036     gradients (from which the normalised variable distribution may be created)
00037     and the cell centre distance.
00038 
00039     This code organisation is both neat and efficient, allowing for convenient
00040     implementation of new schemes to run on parallelised cases.
00041 
00042 SourceFiles
00043     PhiScheme.C
00044 
00045 \*---------------------------------------------------------------------------*/
00046 
00047 #ifndef PhiScheme_H
00048 #define PhiScheme_H
00049 
00050 #include "limitedSurfaceInterpolationScheme.H"
00051 
00052 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00053 
00054 namespace Foam
00055 {
00056 
00057 /*---------------------------------------------------------------------------*\
00058                            Class PhiScheme Declaration
00059 \*---------------------------------------------------------------------------*/
00060 
00061 template<class PhiLimiter>
00062 class PhiScheme
00063 :
00064     public limitedSurfaceInterpolationScheme<vector>,
00065     public PhiLimiter
00066 {
00067     // Private Member Functions
00068 
00069         //- Disallow default bitwise copy construct
00070         PhiScheme(const PhiScheme&);
00071 
00072         //- Disallow default bitwise assignment
00073         void operator=(const PhiScheme&);
00074 
00075 
00076 public:
00077 
00078     //- Runtime type information
00079     TypeName("PhiScheme");
00080 
00081 
00082     // Constructors
00083 
00084         //- Construct from mesh, faceFlux and blendingFactor
00085         PhiScheme
00086         (
00087             const fvMesh& mesh,
00088             const surfaceScalarField& faceFlux,
00089             const PhiLimiter& weight
00090         )
00091         :
00092             limitedSurfaceInterpolationScheme<vector>(mesh, faceFlux),
00093             PhiLimiter(weight)
00094         {}
00095 
00096         //- Construct from mesh and Istream. 
00097         //  The name of the flux field is read from the Istream and looked-up
00098         //  from the mesh objectRegistry
00099         PhiScheme
00100         (
00101             const fvMesh& mesh,
00102             Istream& is
00103         )
00104         :
00105             limitedSurfaceInterpolationScheme<vector>(mesh, is),
00106             PhiLimiter(is)
00107         {}
00108 
00109         //- Construct from mesh, faceFlux and Istream
00110         PhiScheme
00111         (
00112             const fvMesh& mesh,
00113             const surfaceScalarField& faceFlux,
00114             Istream& is
00115         )
00116         :
00117             limitedSurfaceInterpolationScheme<vector>(mesh, faceFlux),
00118             PhiLimiter(is)
00119         {}
00120 
00121 
00122     // Member Functions
00123 
00124         //- Return the interpolation weighting factors
00125         virtual tmp<surfaceScalarField> limiter
00126         (
00127             const GeometricField<vector, fvPatchField, volMesh>&
00128         ) const;
00129 };
00130 
00131 
00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00133 
00134 } // End namespace Foam
00135 
00136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00137 
00138 // Add the patch constructor functions to the hash tables
00139 
00140 #define makePhiSurfaceInterpolationScheme(SS, WEIGHT)                          \
00141                                                                                \
00142 typedef PhiScheme<WEIGHT> Phischeme##WEIGHT_;                                  \
00143 defineTemplateTypeNameAndDebugWithName(Phischeme##WEIGHT_, #SS, 0);            \
00144                                                                                \
00145 surfaceInterpolationScheme<vector>::addMeshConstructorToTable                  \
00146 <PhiScheme<WEIGHT> > add##SS##vectorMeshConstructorToTable_;                   \
00147                                                                                \
00148 surfaceInterpolationScheme<vector>::addMeshFluxConstructorToTable              \
00149 <PhiScheme<WEIGHT> > add##SS##vectorMeshFluxConstructorToTable_;               \
00150                                                                                \
00151 limitedSurfaceInterpolationScheme<vector>::addMeshConstructorToTable           \
00152 <PhiScheme<WEIGHT> > add##SS##vectorMeshConstructorToLimitedTable_;            \
00153                                                                                \
00154 limitedSurfaceInterpolationScheme<vector>::addMeshFluxConstructorToTable       \
00155 <PhiScheme<WEIGHT> > add##SS##vectorMeshFluxConstructorToLimitedTable_;
00156 
00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00158 
00159 #ifdef NoRepository
00160 #   include "PhiScheme.C"
00161 #endif
00162 
00163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00164 
00165 #endif
00166 
00167 // ************************************************************************* //
For further information go to www.openfoam.org