mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use GeometricField clamp_min, clamp_max, clamp_range
- newer naming allows for less confusing code.
Eg,
max(lower) -> clamp_min(lower)
min(upper) -> clamp_max(upper)
- prefer combined method, for few operations.
Eg,
max(lower) + min(upper) -> clamp_range(lower, upper)
The updated naming also helps avoid some obvious coding errors.
Eg,
Re.min(1200.0);
Re.max(18800.0);
instead of
Re.clamp_range(1200.0, 18800.0);
- can also use implicit conversion of zero_one to MinMax<Type> for
this type of code:
lambda_.clamp_range(zero_one{});
This commit is contained in:
@ -92,7 +92,7 @@ void blendField
|
||||
volScalarField fld(fieldHeader, mesh);
|
||||
scalarField& pf = fld.primitiveFieldRef();
|
||||
pf = (1 - mask)*pf + mask*boundaryLayerField;
|
||||
fld.max(SMALL);
|
||||
fld.clamp_min(SMALL);
|
||||
|
||||
// Correct the processor patches only.
|
||||
// Do not correct BC
|
||||
@ -131,7 +131,7 @@ void calcOmegaField
|
||||
scalarField& pf = omega.primitiveFieldRef();
|
||||
|
||||
pf = (1 - mask)*pf + mask*epsilonBL/(Cmu*kBL + SMALL);
|
||||
omega.max(SMALL);
|
||||
omega.clamp_min(SMALL);
|
||||
|
||||
// Correct the processor patches only.
|
||||
// Do not correct BC
|
||||
|
||||
Reference in New Issue
Block a user