CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Post-Processing (
-   -   Finding the minimum of a field value (

sega January 27, 2009 09:34

Hallo again. To find the ce
Hallo again.

To find the cells containing the interface in interFoam I'm currently thinking about something like this.

If (gamma-0.5) has a minimum-value, than there should be the cell containing the interface.


Well, how can I check if this min is true?

I think the coordinate of the cell containing the mininum can be accessed by .mesh().C()[cellI] ?

Any ideas?

ntrask January 27, 2009 12:14

Hallo, min will return the

min will return the global minimum of a field, when I want to do something like that I usually use the pos and neg functions.

i.e. pos(gamma-0.5) will return a volScalar field that is zero if gamma is less than 0.5 and 1 otherwise. neg(gamma-0.5) would return a 1 if its greater than 0.5.

You can then loop through the field and pick off the cells equal to 1.


sega March 10, 2009 08:22

You mean I should loop through
You mean I should loop through the field an pick the cells where pos(gamma-0.5) and neg(gamma-0.5) both are equal to 1 ?

Or did I get it wrong?

nimasam August 26, 2010 09:12

did you find any way to find those cells which contains interface ?
if yes what was ur solution ?

All times are GMT -4. The time now is 00:07.