1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
28 Class to create the weighting-factors based on the face-flux.
30 The particular differencing scheme class is supplied as a template
31 argument, the weight function of which is called by the weight function
32 of this class for the internal faces as well as faces of coupled
33 patches (e.g. processor-processor patches). The weight function is
34 supplied with the central-differencing weighting factor, the face-flux,
35 the face neighbour cell values and the face area.
37 This code organisation is both neat and efficient, allowing for
38 convenient implementation of new schemes to run on parallelised cases.
43 \*---------------------------------------------------------------------------*/
48 #include "limitedSurfaceInterpolationScheme.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 /*---------------------------------------------------------------------------*\
56 Class PhiScheme Declaration
57 \*---------------------------------------------------------------------------*/
59 template<class Type, class PhiLimiter>
62 public limitedSurfaceInterpolationScheme<Type>,
65 // Private Member Functions
67 //- Disallow default bitwise copy construct
68 PhiScheme(const PhiScheme&);
70 //- Disallow default bitwise assignment
71 void operator=(const PhiScheme&);
76 //- Runtime type information
77 TypeName("PhiScheme");
82 //- Construct from mesh, faceFlux and blendingFactor
86 const surfaceScalarField& faceFlux,
87 const PhiLimiter& weight
90 limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
94 //- Construct from mesh and Istream.
95 // The name of the flux field is read from the Istream and looked-up
96 // from the mesh objectRegistry
103 limitedSurfaceInterpolationScheme<Type>(mesh, is),
107 //- Construct from mesh, faceFlux and Istream
111 const surfaceScalarField& faceFlux,
115 limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
122 //- Return the interpolation weighting factors
123 virtual tmp<surfaceScalarField> limiter
125 const GeometricField<Type, fvPatchField, volMesh>&
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 } // End namespace Foam
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 // Add the patch constructor functions to the hash tables
138 #define makePhiSurfaceInterpolationScheme(SS, WEIGHT, TYPE) \
140 typedef PhiScheme<TYPE, WEIGHT> Phischeme##WEIGHT_; \
141 defineTemplateTypeNameAndDebugWithName(Phischeme##WEIGHT_, #SS, 0); \
143 surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
144 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshConstructorToTable_; \
146 surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
147 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshFluxConstructorToTable_; \
149 limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
150 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshConstructorToLimitedTable_; \
152 limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
153 <PhiScheme<TYPE, WEIGHT> > add##SS##TYPE##MeshFluxConstructorToLimitedTable_;
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 # include "PhiScheme.C"
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 // ************************************************************************* //