CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Bounding a scalar between two limits (http://www.cfd-online.com/Forums/openfoam-programming-development/99784-bounding-scalar-between-two-limits.html)

Tarak April 11, 2012 11:26

Bounding a scalar between two limits
 
Hii,

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.

Thanks,
Tarak

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 04:06.