PhiScheme.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::PhiScheme
28
29Group
30 grpFvLimitedSurfaceInterpolationSchemes
31
32Description
33 Class to create the weighting-factors based on the face-flux.
34
35 The particular differencing scheme class is supplied as a template
36 argument, the weight function of which is called by the weight function
37 of this class for the internal faces as well as faces of coupled
38 patches (e.g. processor-processor patches). The weight function is
39 supplied with the central-differencing weighting factor, the face-flux,
40 the face neighbour cell values and the face area.
41
42 This code organisation is both neat and efficient, allowing for
43 convenient implementation of new schemes to run on parallelised cases.
44
45SourceFiles
46 PhiScheme.C
47
48\*---------------------------------------------------------------------------*/
49
50#ifndef PhiScheme_H
51#define PhiScheme_H
52
54
55// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57namespace Foam
58{
59
60/*---------------------------------------------------------------------------*\
61 Class PhiScheme Declaration
62\*---------------------------------------------------------------------------*/
63
64template<class Type, class PhiLimiter>
65class PhiScheme
66:
68 public PhiLimiter
69{
70 // Private Member Functions
71
72 //- No copy construct
73 PhiScheme(const PhiScheme&) = delete;
74
75 //- No copy assignment
76 void operator=(const PhiScheme&) = delete;
77
78
79public:
80
81 //- Runtime type information
82 TypeName("PhiScheme");
83
84
85 // Constructors
86
87 //- Construct from mesh, faceFlux and blendingFactor
89 (
90 const fvMesh& mesh,
91 const surfaceScalarField& faceFlux,
92 const PhiLimiter& weight
93 )
94 :
96 PhiLimiter(weight)
97 {}
98
99 //- Construct from mesh and Istream.
100 // The name of the flux field is read from the Istream and looked-up
101 // from the mesh objectRegistry
103 (
104 const fvMesh& mesh,
105 Istream& is
106 )
107 :
109 PhiLimiter(is)
110 {}
111
112 //- Construct from mesh, faceFlux and Istream
114 (
115 const fvMesh& mesh,
116 const surfaceScalarField& faceFlux,
117 Istream& is
118 )
119 :
121 PhiLimiter(is)
122 {}
123
124
125 // Member Functions
126
127 //- Return the interpolation weighting factors
129 (
131 ) const;
132};
133
134
135// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136
137} // End namespace Foam
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141// Add the patch constructor functions to the hash tables
143#define makePhiSurfaceInterpolationScheme(SS, WEIGHT, TYPE) \
144 \
145typedef PhiScheme<TYPE, WEIGHT> Phischeme##WEIGHT_; \
146defineTemplateTypeNameAndDebugWithName(Phischeme##WEIGHT_, #SS, 0); \
147 \
148surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
149<PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshConstructorToTable_; \
150 \
151surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
152<PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshFluxConstructorToTable_; \
153 \
154limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
155<PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshConstructorToLimitedTable_; \
156 \
157limitedSurfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
158<PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshFluxConstructorToLimitedTable_;
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162#ifdef NoRepository
163 #include "PhiScheme.C"
164#endif
165
166// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167
168#endif
169
170// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Class with limiter function which returns the limiter for the Phi differencing scheme.
Definition: Phi.H:57
Class to create the weighting-factors based on the face-flux.
Definition: PhiScheme.H:68
PhiScheme(const fvMesh &mesh, const surfaceScalarField &faceFlux, const PhiLimiter &weight)
Construct from mesh, faceFlux and blendingFactor.
Definition: PhiScheme.H:88
PhiScheme(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &is)
Construct from mesh, faceFlux and Istream.
Definition: PhiScheme.H:113
TypeName("PhiScheme")
Runtime type information.
virtual tmp< surfaceScalarField > limiter(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Definition: PhiScheme.C:39
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Abstract base class for limited surface interpolation schemes.
const fvMesh & mesh() const
Return mesh reference.
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73