limitWith.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::limitWith
26 
27 Description
28  limitWith interpolation scheme limits the specified scheme with the
29  specified limiter.
30 
31 SourceFiles
32  limitWith.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef limitWith_H
37 #define limitWith_H
38 
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class limitWith Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class Type>
52 class limitWith
53 :
54  public surfaceInterpolationScheme<Type>
55 {
56  // Private Member Functions
57 
58  //- Interpolation scheme
60 
61  //- Limiter
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeName("limitWith");
69 
70 
71  // Constructors
72 
73  //- Construct from mesh and Istream.
74  // The name of the flux field is read from the Istream and looked-up
75  // from the mesh objectRegistry
76  limitWith
77  (
78  const fvMesh& mesh,
79  Istream& is
80  )
81  :
83  tInterp_
84  (
86  ),
87  tLimiter_
88  (
90  )
91  {}
92 
93  //- Construct from mesh, faceFlux and Istream
94  limitWith
95  (
96  const fvMesh& mesh,
97  const surfaceScalarField& faceFlux,
98  Istream& is
99  )
100  :
102  tInterp_
103  (
104  surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
105  ),
106  tLimiter_
107  (
108  limitedSurfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
109  )
110  {}
111 
112  //- Disallow default bitwise copy construction
113  limitWith(const limitWith&) = delete;
114 
115 
116  // Member Functions
117 
118  //- Return the interpolation weighting factors
120  (
121  const VolField<Type>& vf
122  ) const
123  {
124  return tLimiter_().weights
125  (
126  vf,
127  tInterp_().weights(vf),
128  tLimiter_().limiter(vf)
129  );
130  }
131 
132  //- Return true if this scheme uses an explicit correction
133  virtual bool corrected() const
134  {
135  return tInterp_().corrected();
136  }
137 
138  //- Return the explicit correction to the face-interpolate
139  // for the given field
141  correction(const VolField<Type>& vf) const
142  {
143  return tLimiter_().limiter(vf)*tInterp_().correction(vf);
144  }
145 
146 
147  // Member Operators
148 
149  //- Disallow default bitwise assignment
150  void operator=(const limitWith&) = delete;
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
limitWith interpolation scheme limits the specified scheme with the specified limiter.
Definition: limitWith.H:54
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
Definition: limitWith.H:132
virtual tmp< surfaceScalarField > weights(const VolField< Type > &vf) const
Return the interpolation weighting factors.
Definition: limitWith.H:119
void operator=(const limitWith &)=delete
Disallow default bitwise assignment.
TypeName("limitWith")
Runtime type information.
virtual tmp< SurfaceField< Type > > correction(const VolField< Type > &vf) const
Return the explicit correction to the face-interpolate.
Definition: limitWith.H:140
limitWith(const fvMesh &mesh, Istream &is)
Construct from mesh and Istream.
Definition: limitWith.H:76
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:55
void limiter(surfaceScalarField &lambda, const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phiBD, const surfaceScalarField &phiCorr, const SpType &Sp, const SuType &Su, const PsiMaxType &psiMax, const PsiMinType &psiMin)
Namespace for OpenFOAM.