mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use clamp/clamp_range instead of min(max(..., upper), lower)
This commit is contained in:
@ -529,11 +529,7 @@ void Foam::edgeInterpolation::makeCorrectionVectors() const
|
||||
if (owner.size() > 0)
|
||||
{
|
||||
scalarField sinAlpha(deltaCoeffs*mag(CorrVecs.internalField()));
|
||||
|
||||
forAll(sinAlpha, edgeI)
|
||||
{
|
||||
sinAlpha[edgeI] = max(-1, min(sinAlpha[edgeI], 1));
|
||||
}
|
||||
sinAlpha.clamp_range(-1, 1);
|
||||
|
||||
NonOrthogCoeff = max(Foam::asin(sinAlpha)*180.0/M_PI);
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ public:
|
||||
gradcf = stabilise(gradcf, SMALL);
|
||||
|
||||
scalar phict = 1 - 0.5*gradf/gradcf;
|
||||
scalar limiter = min(max(phict/k_, 0), 1);
|
||||
scalar limiter = clamp(phict/k_, 0, 1);
|
||||
|
||||
return lerp(udWeight, cdWeight, limiter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user