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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::PhiScheme
28 
29 Group
30  grpFvLimitedSurfaceInterpolationSchemes
31 
32 Description
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 
45 SourceFiles
46  PhiScheme.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef PhiScheme_H
51 #define PhiScheme_H
52 
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class PhiScheme Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class Type, class PhiLimiter>
65 class 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 
79 public:
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  :
95  limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
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  :
120  limitedSurfaceInterpolationScheme<Type>(mesh, faceFlux),
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
142 
143 #define makePhiSurfaceInterpolationScheme(SS, WEIGHT, TYPE) \
144  \
145 typedef PhiScheme<TYPE, WEIGHT> Phischeme##WEIGHT_; \
146 defineTemplateTypeNameAndDebugWithName(Phischeme##WEIGHT_, #SS, 0); \
147  \
148 surfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
149 <PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshConstructorToTable_; \
150  \
151 surfaceInterpolationScheme<TYPE>::addMeshFluxConstructorToTable \
152 <PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshFluxConstructorToTable_; \
153  \
154 limitedSurfaceInterpolationScheme<TYPE>::addMeshConstructorToTable \
155 <PhiScheme<TYPE, WEIGHT>> add##SS##TYPE##MeshConstructorToLimitedTable_; \
156  \
157 limitedSurfaceInterpolationScheme<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 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::PhiLimiter
Class with limiter function which returns the limiter for the Phi differencing scheme.
Definition: Phi.H:56
Foam::PhiScheme
Class to create the weighting-factors based on the face-flux.
Definition: PhiScheme.H:64
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::PhiScheme::TypeName
TypeName("PhiScheme")
Runtime type information.
Foam::PhiScheme::limiter
virtual tmp< surfaceScalarField > limiter(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Definition: PhiScheme.C:39
Foam::PhiLimiter::PhiLimiter
PhiLimiter(Istream &is)
Definition: Phi.H:62
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
PhiScheme.C
Foam::limitedSurfaceInterpolationScheme
Abstract base class for limited surface interpolation schemes.
Definition: limitedSurfaceInterpolationScheme.H:54
limitedSurfaceInterpolationScheme.H
Foam::surfaceInterpolationScheme::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: surfaceInterpolationScheme.H:144
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >