CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   property values in each cells (

Thomas Jacob February 26, 2013 00:56

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

fumiya February 26, 2013 07: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

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

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


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

Hope that helps,

All times are GMT -4. The time now is 05:55.