CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   Bounding a scalar between two limits (

Tarak April 11, 2012 11:26

Bounding a scalar between two limits

I am trying to keep a scalar solved from its transport equation between an upper and a lower limit.
e.g bound(k_, k0_); after the k eqn bounds k to a lower value. Similarly I want to bound it between 2 extreme values. Please let me know if you have an idea about this.


marupio April 11, 2012 11:51

GeometricFields implement max and min functions. You can use T.max(value); and T.min(value);.

Note, when you apply limits, you create / destroy mass.

Tarak April 11, 2012 11:51

I think using boundMinMax(k,k0_,k1_) would do it.

All times are GMT -4. The time now is 05:08.