39 #ifndef limitedCubic_H 40 #define limitedCubic_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 twor = twoByk_*LimiterFunc::r
92 faceFlux, phiP, phiN, gradcP, gradcN, d
108 cdWeight*(phiP - 0.25*(d & gradcN))
109 + (1 - cdWeight)*(phiN + 0.25*(d & gradcP));
111 scalar phiCD = cdWeight*phiP + (1 - cdWeight)*phiN;
114 scalar cubicLimiter = (phif - phiU)/
stabilise(phiCD - phiU, small);
126 return max(
min(
min(twor, cubicLimiter), 2), 0);
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
errorManipArg< error, int > exit(error &err, const int errNo=1)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
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.
Class with limiter function which returns the limiter for the TVD limited centred-cubic interpolation...
tmp< DimensionedField< scalar, GeoMesh > > stabilise(const DimensionedField< scalar, GeoMesh > &dsf, const dimensioned< scalar > &ds)
#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