45 #ifndef limitedCubic_H 46 #define limitedCubic_H 59 template<
class LimiterFunc>
76 <<
"coefficient = " << k_
77 <<
" should be >= 0 and <= 1" 82 twoByk_ = 2.0/
max(k_, SMALL);
87 const scalar cdWeight,
88 const scalar faceFlux,
89 const typename LimiterFunc::phiType& phiP,
90 const typename LimiterFunc::phiType& phiN,
91 const typename LimiterFunc::gradPhiType& gradcP,
92 const typename LimiterFunc::gradPhiType& gradcN,
96 scalar twor = twoByk_*LimiterFunc::r
98 faceFlux, phiP, phiN, gradcP, gradcN, d
115 + (1 - cdWeight)*phiN
116 + cdWeight*(1 - cdWeight)
118 (1 - 2*cdWeight)*(phiN - phiP)
119 + cdWeight*(d & gradcP)
120 - (1 - cdWeight)*(d & gradcN)
123 scalar phiCD = cdWeight*phiP + (1 - cdWeight)*phiN;
126 scalar cubicLimiter = (phif - phiU)/
stabilise(phiCD - phiU, SMALL);
138 return clamp(
min(twor, cubicLimiter), 0, 2);
errorManipArg< error, int > exit(error &err, const int errNo=1)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
dimensionedScalar stabilise(const dimensionedScalar &x, const dimensionedScalar &y)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Class with limiter function which returns the limiter for the TVD limited centred-cubic differencing ...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
limitedCubicLimiter(Istream &is)
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
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...