39 #ifndef limitedCubicV_H 40 #define limitedCubicV_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
95 vector fV = cdWeight*phiP + (1.0 - cdWeight)*phiN;
97 scalar fVphiP = fV & phiP;
98 scalar fVphiN = fV & phiN;
113 cdWeight*(fVphiP - 0.25*(fV & (d & gradcN)))
114 + (1 - cdWeight)*(fVphiN + 0.25*(fV & (d & gradcP)));
116 scalar fVphiCD = cdWeight*fVphiP + (1 - cdWeight)*fVphiN;
119 scalar cubicLimiter =
120 (fVphif - fVphiU)/
stabilise(fVphiCD - fVphiU, small);
123 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)...
limitedCubicVLimiter(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
Class with limiter function which returns the limiter for the limitedCubicV interpolation scheme base...
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.
tmp< DimensionedField< scalar, GeoMesh > > stabilise(const DimensionedField< scalar, GeoMesh > &dsf, const dimensioned< scalar > &ds)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.