39 #ifndef limitedLinear_H
40 #define limitedLinear_H
53 template<
class LimiterFunc>
70 <<
"coefficient = " << k_
71 <<
" should be >= 0 and <= 1"
76 twoByk_ = 2.0/
max(k_, small);
81 const scalar cdWeight,
82 const scalar faceFlux,
83 const typename LimiterFunc::phiType& phiP,
84 const typename LimiterFunc::phiType& phiN,
85 const typename LimiterFunc::gradPhiType& gradcP,
86 const typename LimiterFunc::gradPhiType& gradcN,
90 scalar r = LimiterFunc::r
92 faceFlux, phiP, phiN, gradcP, gradcN, d
95 return max(
min(twoByk_*r, 1), 0);
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Class with limiter function which returns the limiter for the TVD limited linear interpolation scheme...
limitedLinearLimiter(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
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)