40 #ifndef cellMDLimitedGrad_H 41 #define cellMDLimitedGrad_H 100 "cellMDLimitedGrad(const fvMesh&, Istream& schemeData)",
102 ) <<
"coefficient = " << k_
103 <<
" should be >= 0 and <= 1" 114 const Type& maxDelta,
115 const Type& minDelta,
139 const scalar& maxDelta,
140 const scalar& minDelta,
144 scalar extrapolate = dcf &
g;
146 if (extrapolate > maxDelta)
148 g = g + dcf*(maxDelta - extrapolate)/
magSqr(dcf);
150 else if (extrapolate < minDelta)
152 g = g + dcf*(minDelta - extrapolate)/
magSqr(dcf);
161 const Type& maxDelta,
162 const Type& minDelta,
166 for (
direction cmpt=0; cmpt<Type::nComponents; cmpt++)
168 vector gi(g[cmpt], g[cmpt+3], g[cmpt+6]);
173 minDelta.component(cmpt),
Mesh data needed to do the Finite Volume discretisation.
Mesh data needed to do the Finite Volume discretisation.
word name(const complex &)
Return a string representation of a complex.
const Cmpt & component(const direction) const
dimensioned< scalar > magSqr(const dimensioned< Type > &)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Abstract base class for gradient schemes.
TypeName("cellMDLimited")
RunTime type information.
static void limitFace(typename outerProduct< vector, Type >::type &g, const Type &maxDelta, const Type &minDelta, const vector &dcf)
A class for handling words, derived from string.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const fvMesh & mesh() const
Return mesh reference.
typeOfRank< typename pTraits< arg1 >::cmptType, int(pTraits< arg1 >::rank)+int(pTraits< arg2 >::rank) >::type type
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.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Generic GeometricField class.
const dimensionedVector & g
cellMDLimitedGrad gradient scheme applied to a runTime selected base gradient scheme.
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
A class for managing temporary objects.
static tmp< gradScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return a pointer to a new gradScheme created on freestore.