1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Class to create the weighting-factors based on the face-flux.
31 The particular differencing scheme class is supplied as a template
32 argument, the weight function of which is called by the weight function
33 of this class for the internal faces as well as faces of coupled
34 patches (e.g. processor-processor patches). The weight function is
35 supplied with the central-differencing weighting factor, the face-flux,
36 the face neighbour cell values and the face area.
38 This code organisation is both neat and efficient, allowing for
39 convenient implementation of new schemes to run on parallelised cases.
44 \*---------------------------------------------------------------------------*/
49 #include "limitedSurfaceInterpolationScheme.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 /*---------------------------------------------------------------------------*\
57 Class PhiScheme Declaration
58 \*---------------------------------------------------------------------------*/
60 template<class Type, class PhiLimiter>
63 public limitedSurfaceInterpolationScheme<Type>,
66 // Private Member Functions
68 //- Disallow default bitwise copy construct
69 PhiScheme(const PhiScheme&);
71 //- Disallow default bitwise assignment
72 void operator=(const PhiScheme&);
77 //- Runtime type information
78 TypeName("PhiScheme");
83 //- Construct from mesh, faceFlux and blendingFactor
87 const surfaceScalarField& faceFlux,
88 const PhiLimiter& weight
91 limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
95 //- Construct from mesh and Istream.
96 // The name of the flux field is read from the Istream and looked-up
97 // from the mesh objectRegistry
104 limitedSurfaceInterpolationScheme<Type>(mesh, is),
108 //- Construct from mesh, faceFlux and Istream
112 const surfaceScalarField& faceFlux,
116 limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
123 //- Return the interpolation weighting factors
124 virtual tmp<surfaceScalarField> limiter
126 const GeometricField<Type, fvPatchField, volMesh>&
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 } // End namespace Foam
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 // Add the patch constructor functions to the hash tables
139 #define makePhiSurfaceInterpolationScheme(SS, WEIGHT, TYPE) \
141 typedef PhiScheme<TYPE, WEIGHT> Phischeme##WEIGHT_; \
142 defineTemplateTypeNameAndDebugWithName(Phischeme##WEIGHT_, #SS, 0); \
144 surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
145 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshConstructorToTable_; \
147 surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
148 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshFluxConstructorToTable_; \
150 limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
151 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshConstructorToLimitedTable_; \
153 limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
154 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshFluxConstructorToLimitedTable_;
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 # include "PhiScheme.C"
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 // ************************************************************************* //