46#ifndef cellMDLimitedGrad_H
47#define cellMDLimitedGrad_H
66class cellMDLimitedGrad
82 cellMDLimitedGrad(
const cellMDLimitedGrad&) =
delete;
85 void operator=(
const cellMDLimitedGrad&) =
delete;
99 gradScheme<Type>(
mesh),
100 basicGradScheme_(
fv::gradScheme<Type>::
New(
mesh, schemeData)),
101 k_(readScalar(schemeData))
103 if (k_ < 0 || k_ > 1)
106 <<
"coefficient = " << k_
107 <<
" should be >= 0 and <= 1"
118 const Type& maxDelta,
119 const Type& minDelta,
143 const scalar& maxDelta,
144 const scalar& minDelta,
148 const scalar extrapolate = dcf &
g;
150 if (extrapolate > maxDelta)
152 g =
g + dcf*(maxDelta - extrapolate)/
magSqr(dcf);
154 else if (extrapolate < minDelta)
156 g =
g + dcf*(minDelta - extrapolate)/
magSqr(dcf);
165 const Type& maxDelta,
166 const Type& minDelta,
170 for (
direction cmpt = 0; cmpt < Type::nComponents; ++cmpt)
172 vector gi(
g[cmpt],
g[cmpt+3],
g[cmpt+6]);
176 maxDelta.component(cmpt),
177 minDelta.component(cmpt),
const uniformDimensionedVectorField & g
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
const Cmpt & x() const noexcept
Access to the vector x component.
const Cmpt & z() const noexcept
Access to the vector z component.
const Cmpt & y() const noexcept
Access to the vector y component.
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 for optional caching.
static void limitFace(typename outerProduct< vector, Type >::type &g, const Type &maxDelta, const Type &minDelta, const vector &dcf)
cellMDLimitedGrad(const fvMesh &mesh, Istream &schemeData)
Construct from mesh and schemeData.
TypeName("cellMDLimited")
RunTime type information.
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.
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank)>::type type
A class for managing temporary objects.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
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.
GeometricField< vector, fvPatchField, volMesh > volVectorField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
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)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.