Go to the documentation of this file.
45 #ifndef cellMDLimitedGrad_H
46 #define cellMDLimitedGrad_H
99 k_(readScalar(schemeData))
101 if (k_ < 0 || k_ > 1)
104 <<
"coefficient = " << k_
105 <<
" should be >= 0 and <= 1"
116 const Type& maxDelta,
117 const Type& minDelta,
141 const scalar& maxDelta,
142 const scalar& minDelta,
146 scalar extrapolate = dcf &
g;
148 if (extrapolate > maxDelta)
150 g =
g + dcf*(maxDelta - extrapolate)/
magSqr(dcf);
152 else if (extrapolate < minDelta)
154 g =
g + dcf*(minDelta - extrapolate)/
magSqr(dcf);
163 const Type& maxDelta,
164 const Type& minDelta,
168 for (
direction cmpt=0; cmpt<Type::nComponents; cmpt++)
170 vector gi(
g[cmpt],
g[cmpt+3],
g[cmpt+6]);
175 minDelta.component(cmpt),
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
const Cmpt & x() const
Access to the vector x component.
const Cmpt & component(const direction) const
A class for handling words, derived from Foam::string.
A class for managing temporary objects.
Mesh data needed to do the Finite Volume discretisation.
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) >::type type
const Cmpt & z() const
Access to the vector z component.
static tmp< gradScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new gradScheme created on freestore.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
word name(const complex &c)
Return string representation of complex.
TypeName("cellMDLimited")
RunTime type information.
const fvMesh & mesh() const
Return mesh reference.
cellMDLimitedGrad(const fvMesh &mesh, Istream &schemeData)
Construct from mesh and schemeData.
Abstract base class for gradient schemes.
Mesh data needed to do the Finite Volume discretisation.
const uniformDimensionedVectorField & g
errorManipArg< error, int > exit(error &err, const int errNo=1)
const Cmpt & y() const
Access to the vector y component.
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.
cellMDLimitedGrad gradient scheme applied to a runTime selected base gradient scheme.
static void limitFace(typename outerProduct< vector, Type >::type &g, const Type &maxDelta, const Type &minDelta, const vector &dcf)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Generic GeometricField class.