CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to compare volume scalar field with constant values (http://www.cfd-online.com/Forums/openfoam-solving/70438-how-compare-volume-scalar-field-constant-values.html)

sachin November 24, 2009 13:59

How to compare volume scalar field with constant values
 
Hi,
I wanted to compare one volscalarfield w.r.t a constant value
To be more precise if I want to compare enthalpy h with specific value say enthalpy of sat liq
i need to find in all h values i.e forAll(arg1,arg2)
what should these arguments be

Please do let me know

thanks
sachin

l_r_mcglashan November 24, 2009 14:05

Something like:

Code:

forAll(enthalpy,celli)
{
    if(enthalpy[celli] == satEnthalpy){}
    else{}
}

Sounds like you know how to do it already if you've found the forAll macro.

sachin November 24, 2009 14:07

thanks for your quick reply,
I was having a basic idea...was just missing the arguments
sachin

l_r_mcglashan November 24, 2009 14:09

That's probably a bit sloppy for a volScalarField.

Code:

forAll(enthalpy.internalField(),celli)
{
        if(enthalpy[celli] == satEnthalpy){}
        else{}
}



All times are GMT -4. The time now is 17:23.