41 #ifndef limitedCubicV_H 42 #define limitedCubicV_H 55 template<
class LimiterFunc>
72 <<
"coefficient = " << k_
73 <<
" should be >= 0 and <= 1" 78 twoByk_ = 2.0/
max(k_, SMALL);
83 const scalar cdWeight,
84 const scalar faceFlux,
85 const typename LimiterFunc::phiType& phiP,
86 const typename LimiterFunc::phiType& phiN,
87 const typename LimiterFunc::gradPhiType& gradcP,
88 const typename LimiterFunc::gradPhiType& gradcN,
92 scalar twor = twoByk_*LimiterFunc::r
94 faceFlux, phiP, phiN, gradcP, gradcN, d
97 vector fV = cdWeight*phiP + (1.0 - cdWeight)*phiN;
99 scalar fVphiP = fV & phiP;
100 scalar fVphiN = fV & phiN;
115 cdWeight*(fVphiP - 0.25*(fV & (d & gradcN)))
116 + (1 - cdWeight)*(fVphiN + 0.25*(fV & (d & gradcP)));
118 scalar fVphiCD = cdWeight*fVphiP + (1 - cdWeight)*fVphiN;
121 scalar cubicLimiter =
122 (fVphif - fVphiU)/
stabilise(fVphiCD - fVphiU, SMALL);
125 return max(
min(
min(twor, cubicLimiter), 2), 0);
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)
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 differencing scheme based...
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...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...