STYLE: use clamp/clamp_range instead of max(min(..., upper), lower)

This commit is contained in:
Mark Olesen
2023-02-01 18:39:19 +01:00
parent 4d45cfd5a9
commit ba6667a344
38 changed files with 89 additions and 151 deletions

View File

@ -1,14 +1,5 @@
{
alphav =
max
(
min
(
(rho - rholSat)/(rhovSat - rholSat),
scalar(1)
),
scalar(0)
);
alphav = clamp((rho - rholSat)/(rhovSat - rholSat), zero_one{});
alphal = 1.0 - alphav;
Info<< "max-min alphav: " << max(alphav).value()

View File

@ -108,7 +108,7 @@ void setAlpha
{
cutCell.calcSubCell(cellI, 0.0);
alpha1[cellI] = max(min(cutCell.VolumeOfFluid(), 1), 0);
alpha1[cellI] = clamp(cutCell.VolumeOfFluid(), 0, 1);
if (writeOBJ && (mag(cutCell.faceArea()) >= 1e-14))
{