CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   property values in each cells (http://www.cfd-online.com/Forums/openfoam/113745-property-values-each-cells.html)

Thomas Jacob February 25, 2013 23:56

property values in each cells
 
how can i get the values of pressure in each cell

fumiya February 26, 2013 06:15

Hi Thomas,

You can access the cell center value of pressure field p by p[cell_label].

If you want to access every cell, you can use
Code:

forAll(p, cellI)
{
    //You can use p[cellI]
}

Using the "findCell" function, you can find the cell label that contains
the position you specify:

Code:

vector pos(0,0,0); //Change the position as you like
label cellI = mesh.findCell(pos);

Hope that helps,
Fumiya


All times are GMT -4. The time now is 02:15.