42 #ifndef limitedCubicV_H 43 #define limitedCubicV_H 56 template<
class LimiterFunc>
73 <<
"coefficient = " << k_
74 <<
" should be >= 0 and <= 1" 79 twoByk_ = 2.0/
max(k_, SMALL);
84 const scalar cdWeight,
85 const scalar faceFlux,
86 const typename LimiterFunc::phiType& phiP,
87 const typename LimiterFunc::phiType& phiN,
88 const typename LimiterFunc::gradPhiType& gradcP,
89 const typename LimiterFunc::gradPhiType& gradcN,
93 scalar twor = twoByk_*LimiterFunc::r
95 faceFlux, phiP, phiN, gradcP, gradcN, d
98 vector fV = cdWeight*phiP + (1.0 - cdWeight)*phiN;
100 scalar fVphiP = fV & phiP;
101 scalar fVphiN = fV & phiN;
117 + (1 - cdWeight)*fVphiN
118 + cdWeight*(1 - cdWeight)
120 (1 - 2*cdWeight)*(fVphiN - fVphiP)
121 + cdWeight*(fV & (d & gradcP))
122 - (1 - cdWeight)*(fV & (d & gradcN))
125 scalar fVphiCD = cdWeight*fVphiP + (1 - cdWeight)*fVphiN;
128 scalar cubicLimiter =
129 (fVphif - fVphiU)/
stabilise(fVphiCD - fVphiU, SMALL);
132 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)
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.
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 ...