CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Assigning and retrieving geometrical mesh properties (https://www.cfd-online.com/Forums/openfoam-solving/60565-assigning-retrieving-geometrical-mesh-properties.html)

schnitzlein June 28, 2005 08:39

I generated a mesh consisting
 
I generated a mesh consisting of triangles, quadrilaterals and prismas. To each cell a set of geometric properties (from the physics) is assigned. Is there a way to assign these properties during the run or prior? How can this be achieved? These properties are necessary to calculate the momentum source term for each cell.

In order to accomplish this I need the information to which cell (it would be sufficient to know the index) each entry of the U-field belongs to. The geometric information can then be retrieved by looking at the appropriate entry of the properties field.

Moreover, how can I retrieve the velocities on a element-wise basis?

Thank you.

mattijs June 28, 2005 14:27

2] if cellI is your cell label
 
2] if cellI is your cell label:

U[cellI]

gives you access to the cell value of U.

mesh.C()[cellI] gives you the cell centre of the cell.


1] to read in a cell-by-cell property read a volScalarField like e.g. p (see createFields.H in any solver). Just put e.g. 'calculated' b.c. on your field.


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