PhiScheme.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::PhiScheme
26 
27 Description
28  Class to create the weighting-factors based on the face-flux.
29 
30  The particular interpolation 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 centred interpolation weighting factor, the face-flux,
35  the face neighbour cell values and the face area.
36 
37  This code organisation is both neat and efficient, allowing for
38  convenient implementation of new schemes to run on parallelised cases.
39 
40 SourceFiles
41  PhiScheme.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef PhiScheme_H
46 #define PhiScheme_H
47 
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class PhiScheme Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class Type, class PhiLimiter>
60 class PhiScheme
61 :
63  public PhiLimiter
64 {
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("PhiScheme");
70 
71 
72  // Constructors
73 
74  //- Construct from mesh, faceFlux and blendingFactor
76  (
77  const fvMesh& mesh,
78  const surfaceScalarField& faceFlux,
79  const PhiLimiter& weight
80  )
81  :
82  limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
83  PhiLimiter(weight)
84  {}
85 
86  //- Construct from mesh and Istream.
87  // The name of the flux field is read from the Istream and looked-up
88  // from the mesh objectRegistry
90  (
91  const fvMesh& mesh,
92  Istream& is
93  )
94  :
95  limitedSurfaceInterpolationScheme<Type>(mesh, is),
96  PhiLimiter(is)
97  {}
98 
99  //- Construct from mesh, faceFlux and Istream
101  (
102  const fvMesh& mesh,
103  const surfaceScalarField& faceFlux,
104  Istream& is
105  )
106  :
107  limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
108  PhiLimiter(is)
109  {}
110 
111  //- Disallow default bitwise copy construction
112  PhiScheme(const PhiScheme&) = delete;
113 
114 
115  // Member Functions
116 
117  //- Return the interpolation weighting factors
119  (
121  ) const;
122 
123 
124  // Member Operators
125 
126  //- Disallow default bitwise assignment
127  void operator=(const PhiScheme&) = delete;
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 // Add the patch constructor functions to the hash tables
139 #define makePhiSurfaceInterpolationScheme(SS, WEIGHT, TYPE) \
140  \
141 typedef PhiScheme<TYPE, WEIGHT> Phischeme##WEIGHT_; \
142 defineTemplateTypeNameAndDebugWithName(Phischeme##WEIGHT_, #SS, 0); \
143  \
144 surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
145 <PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshConstructorToTable_; \
146  \
147 surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
148 <PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshFluxConstructorToTable_; \
149  \
150 limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
151 <PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshConstructorToLimitedTable_; \
152  \
153 limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
154 <PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshFluxConstructorToLimitedTable_;
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #ifdef NoRepository
159  #include "PhiScheme.C"
160 #endif
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
TypeName("PhiScheme")
Runtime type information.
void operator=(const PhiScheme &)=delete
Disallow default bitwise assignment.
virtual tmp< surfaceScalarField > limiter(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Definition: PhiScheme.C:37
Class to create the weighting-factors based on the face-flux.
Definition: PhiScheme.H:59
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
Class with limiter function which returns the limiter for the Phi interpolation scheme.
Definition: Phi.H:51
Abstract base class for limited surface interpolation schemes.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.
PhiScheme(const fvMesh &mesh, const surfaceScalarField &faceFlux, const PhiLimiter &weight)
Construct from mesh, faceFlux and blendingFactor.
Definition: PhiScheme.H:75