OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

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