45#ifndef cellLimitedGrad_H
46#define cellLimitedGrad_H
63template<
class Type,
class Limiter>
92 cellLimitedGrad(
const cellLimitedGrad&) =
delete;
95 void operator=(
const cellLimitedGrad&) =
delete;
109 gradScheme<Type>(
mesh),
111 basicGradScheme_(
fv::gradScheme<Type>::
New(
mesh, schemeData)),
112 k_(readScalar(schemeData))
114 if (k_ < 0 || k_ > 1)
117 <<
"coefficient = " << k_
118 <<
" should be >= 0 and <= 1"
129 const scalar maxDelta,
130 const scalar minDelta,
131 const scalar extrapolate
137 const Type& maxDelta,
138 const Type& minDelta,
139 const Type& extrapolate
166template<
class Type,
class Limiter>
170 const scalar maxDelta,
171 const scalar minDelta,
172 const scalar extrapolate
177 if (extrapolate > SMALL)
179 r = maxDelta/extrapolate;
181 else if (extrapolate < -SMALL)
183 r = minDelta/extrapolate;
194template<
class Type,
class Limiter>
198 const Type& maxDelta,
199 const Type& minDelta,
200 const Type& extrapolate
203 for (
direction cmpt=0; cmpt<pTraits<Type>::nComponents; ++cmpt)
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Mesh data needed to do the Finite Volume discretisation.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
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.
void limitFace(Type &limiter, const Type &maxDelta, const Type &minDelta, const Type &extrapolate) const
void limitFaceCmpt(scalar &limiter, const scalar maxDelta, const scalar minDelta, const scalar extrapolate) const
TypeName("cellLimited")
RunTime type information.
cellLimitedGrad(const fvMesh &mesh, Istream &schemeData)
Construct from mesh and schemeData.
virtual void calcGrad(GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh > &res, const GeometricField< Type, fvPatchField, volMesh > &) const
Calculate the grad of the given field into supplied field.
Abstract base class for gradient schemes.
const fvMesh & mesh() const
Return const reference to mesh.
static tmp< gradScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new gradScheme created on freestore.
scalar limiter(const scalar r) const
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank)>::type type
A class for managing temporary objects.
Mesh data needed to do the Finite Volume discretisation.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Namespace for finite-volume.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
label & setComponent(label &val, const direction) noexcept
Non-const access to integer-type (has no components).
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
tmp< areaScalarField > limiter(const areaScalarField &phi)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.