CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   OpenFoam c++ syntax for min(... ) equation ? (https://www.cfd-online.com/Forums/openfoam-programming-development/162259-openfoam-c-syntax-min-equation.html)

klausb November 6, 2015 16:52

OpenFoam c++ syntax for min(... ) equation ?
 
Hello,

what is the OpenFoam c++ syntax for the following equation:

fynew = min(fy, 1.0, 0.5+0.0025*Rt)

where fy and Rt are known equations.

Klaus

alexeym November 6, 2015 17:01

Hi,

it depends. See http://en.cppreference.com/w/cpp/algorithm/min.

So basically you add one more min:

fynew = min(fy, min(1.0, 0.5+0.0025*Rt))


All times are GMT -4. The time now is 06:49.