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 max(min(..., upper), lower)
This commit is contained in:
@ -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()
|
||||
|
||||
@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user