40 #ifndef cellLimitedGrad_H 41 #define cellLimitedGrad_H 58 template<
class Type,
class Limiter>
103 if (k_ < 0 || k_ > 1)
108 ) <<
"coefficient = " << k_
109 <<
" should be >= 0 and <= 1" 123 const scalar maxDelta,
124 const scalar minDelta,
125 const scalar extrapolate
131 const Type& maxDelta,
132 const Type& minDelta,
133 const Type& extrapolate
158 template<
class Type,
class Limiter>
162 const scalar maxDelta,
163 const scalar minDelta,
164 const scalar extrapolate
169 if (extrapolate > small)
171 r = maxDelta/extrapolate;
173 else if (extrapolate < -small)
175 r = minDelta/extrapolate;
186 template<
class Type,
class Limiter>
190 const Type& maxDelta,
191 const Type& minDelta,
192 const Type& extrapolate
195 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
TypeName("cellLimited")
RunTime type information.
void operator=(const cellLimitedGrad &)=delete
Disallow default bitwise assignment.
cellLimitedGrad(const fvMesh &mesh, Istream &schemeData)
Construct from mesh and schemeData.
virtual tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > > calcGrad(const GeometricField< Type, fvPatchField, volMesh > &vsf, const word &name) const
Return the gradient of the given field to the gradScheme::grad.
errorManipArg< error, int > exit(error &err, const int errNo=1)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
Generic GeometricField class.
Mesh data needed to do the Finite Volume discretisation.
A class for handling words, derived from string.
cellLimitedGrad gradient scheme applied to a runTime selected base gradient scheme.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
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)
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
word name(const complex &)
Return a string representation of a complex.
Abstract base class for gradient schemes.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
void limitFaceCmpt(scalar &limiter, const scalar maxDelta, const scalar minDelta, const scalar extrapolate) const
Mesh data needed to do the Finite Volume discretisation.
static tmp< gradScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new gradScheme created on freestore.
A class for managing temporary objects.
const fvMesh & mesh() const
Return mesh reference.
label & setComponent(label &l, const direction)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
void limitFace(Type &limiter, const Type &maxDelta, const Type &minDelta, const Type &extrapolate) const