43 #ifndef filteredLinear3_H 44 #define filteredLinear3_H 57 template<
class LimiterFunc>
78 <<
"coefficient = " << k_
79 <<
" should be >= 0 and <= 1" 86 const scalar cdWeight,
87 const scalar faceFlux,
88 const typename LimiterFunc::phiType& phiP,
89 const typename LimiterFunc::phiType& phiN,
90 const typename LimiterFunc::gradPhiType& gradcP,
91 const typename LimiterFunc::gradPhiType& gradcN,
96 scalar df = phiN - phiP;
99 scalar dP = 2*(d & gradcP);
100 scalar dN = 2*(d & gradcN);
103 scalar
limiter = 1 - k_*(dN - df)*(dP - df)/
max(
sqr(dN + dP), small);
106 return max(
min(limiter, 1), 0);
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
filteredLinear3Limiter(Istream &is)
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Class to generate weighting factors for the filteredLinear differencing scheme.
scalar limiter(const scalar cdWeight, const scalar faceFlux, const typename LimiterFunc::phiType &phiP, const typename LimiterFunc::phiType &phiN, const typename LimiterFunc::gradPhiType &gradcP, const typename LimiterFunc::gradPhiType &gradcN, const vector &d) const
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.