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 | Copyright (C) 2011-2016 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 differencing 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  //- Disallow default bitwise copy construct
66  limitWith(const limitWith&);
67 
68  //- Disallow default bitwise assignment
69  void operator=(const limitWith&);
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("limitWith");
76 
77 
78  // Constructors
79 
80  //- Construct from mesh and Istream.
81  // The name of the flux field is read from the Istream and looked-up
82  // from the mesh objectRegistry
84  (
85  const fvMesh& mesh,
86  Istream& is
87  )
88  :
89  surfaceInterpolationScheme<Type>(mesh),
90  tInterp_
91  (
92  surfaceInterpolationScheme<Type>::New(mesh, is)
93  ),
94  tLimiter_
95  (
96  limitedSurfaceInterpolationScheme<Type>::New(mesh, is)
97  )
98  {}
99 
100  //- Construct from mesh, faceFlux and Istream
102  (
103  const fvMesh& mesh,
104  const surfaceScalarField& faceFlux,
105  Istream& is
106  )
107  :
108  surfaceInterpolationScheme<Type>(mesh),
109  tInterp_
110  (
111  surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
112  ),
113  tLimiter_
114  (
115  limitedSurfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
116  )
117  {}
118 
119 
120  // Member Functions
121 
122  //- Return the interpolation weighting factors
124  (
126  ) const
127  {
128  return tLimiter_().weights
129  (
130  vf,
131  tInterp_().weights(vf),
132  tLimiter_().limiter(vf)
133  );
134  }
135 
136  //- Return true if this scheme uses an explicit correction
137  virtual bool corrected() const
138  {
139  return tInterp_().corrected();
140  }
141 
142  //- Return the explicit correction to the face-interpolate
143  // for the given field
146  {
147  return tLimiter_().limiter(vf)*tInterp_().correction(vf);
148  }
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
Definition: limitWith.H:136
void limiter(scalarField &allLambda, const RdeltaTType &rDeltaT, const RhoType &rho, const volScalarField &psi, const surfaceScalarField &phiBD, const surfaceScalarField &phiCorr, const SpType &Sp, const SuType &Su, const scalar psiMax, const scalar psiMin)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
limitWith differencing scheme limits the specified scheme with the specified limiter.
Definition: limitWith.H:51
virtual tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &vf) const
Return the interpolation weighting factors.
Definition: limitWith.H:123
TypeName("limitWith")
Runtime type information.
static tmp< surfaceInterpolationScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
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:144
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Abstract base class for limited surface interpolation schemes.
A class for managing temporary objects.
Definition: PtrList.H:54
Abstract base class for surface interpolation schemes.
Namespace for OpenFOAM.