CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   property values in each cells (https://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 09:04.