44 #ifndef limitedCubic_H
45 #define limitedCubic_H
58 template<
class LimiterFunc>
75 <<
"coefficient = " << k_
76 <<
" should be >= 0 and <= 1"
81 twoByk_ = 2.0/
max(k_, SMALL);
86 const scalar cdWeight,
87 const scalar faceFlux,
88 const typename LimiterFunc::phiType& phiP,
89 const typename LimiterFunc::phiType& phiN,
90 const typename LimiterFunc::gradPhiType& gradcP,
91 const typename LimiterFunc::gradPhiType& gradcN,
95 scalar twor = twoByk_*LimiterFunc::r
97 faceFlux, phiP, phiN, gradcP, gradcN, d
113 cdWeight*(phiP - 0.25*(d & gradcN))
114 + (1 - cdWeight)*(phiN + 0.25*(d & gradcP));
116 scalar phiCD = cdWeight*phiP + (1 - cdWeight)*phiN;
119 scalar cubicLimiter = (phif - phiU)/
stabilise(phiCD - phiU, SMALL);
131 return max(
min(
min(twor, cubicLimiter), 2), 0);