limitWith.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::limitWith
28
29Group
30 grpFvLimitedSurfaceInterpolationSchemes
31
32Description
33 limitWith differencing scheme limits the specified scheme with the
34 specified limiter.
35
36SourceFiles
37 limitWith.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef limitWith_H
42#define limitWith_H
43
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class limitWith Declaration
54\*---------------------------------------------------------------------------*/
55
56template<class Type>
57class limitWith
58:
60{
61 // Private Member Functions
62
63 //- Interpolation scheme
65
66 //- Limiter
68
69
70 //- No copy construct
71 limitWith(const limitWith&) = delete;
72
73 //- No copy assignment
74 void operator=(const limitWith&) = delete;
75
76
77public:
78
79 //- Runtime type information
80 TypeName("limitWith");
81
82
83 // Constructors
84
85 //- Construct from mesh and Istream.
86 // The name of the flux field is read from the Istream and looked-up
87 // from the mesh objectRegistry
89 (
90 const fvMesh& mesh,
91 Istream& is
92 )
93 :
95 tInterp_
96 (
98 ),
99 tLimiter_
100 (
102 )
103 {}
104
105 //- Construct from mesh, faceFlux and Istream
107 (
108 const fvMesh& mesh,
109 const surfaceScalarField& faceFlux,
110 Istream& is
111 )
112 :
114 tInterp_
115 (
116 surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
117 ),
118 tLimiter_
119 (
120 limitedSurfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
121 )
122 {}
123
124
125 // Member Functions
126
127 //- Return the interpolation weighting factors
129 (
131 ) const
132 {
133 return tLimiter_().weights
134 (
135 vf,
136 tInterp_().weights(vf),
137 tLimiter_().limiter(vf)
138 );
139 }
140
141 //- Return true if this scheme uses an explicit correction
142 virtual bool corrected() const
143 {
144 return tInterp_().corrected();
145 }
146
147 //- Return the explicit correction to the face-interpolate
148 // for the given field
151 {
152 return tLimiter_().limiter(vf)*tInterp_().correction(vf);
153 }
154};
155
156
157// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158
159} // End namespace Foam
160
161// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162
163#endif
164
165// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
limitWith differencing scheme limits the specified scheme with the specified limiter.
Definition: limitWith.H:59
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
Definition: limitWith.H:141
TypeName("limitWith")
Runtime type information.
limitWith(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &is)
Construct from mesh, faceFlux and Istream.
Definition: limitWith.H:106
virtual tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > correction(const GeometricField< Type, fvPatchField, volMesh > &vf) const
Return the explicit correction to the face-interpolate.
Definition: limitWith.H:149
virtual tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &vf) const
Return the interpolation weighting factors.
Definition: limitWith.H:128
Abstract base class for limited surface interpolation schemes.
Abstract base class for surface interpolation schemes.
const fvMesh & mesh() const
Return mesh reference.
static tmp< surfaceInterpolationScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
A class for managing temporary objects.
Definition: tmp.H:65
Namespace for OpenFOAM.
tmp< areaScalarField > limiter(const areaScalarField &phi)
Definition: faNVDscheme.C:38
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73