CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Volume of cells with interFoam (https://www.cfd-online.com/Forums/openfoam/82842-volume-cells-interfoam.html)

Andrea_85 December 7, 2010 10:54

Volume of cells with interFoam
 
Dear all,

I just started using OpenFoam as part of my phd and so i am a very new user. At the moment i would like to simulate multiphase flows using interFoam, in simple geometry created with blockMesh.

probably is a very simple questions but...
Is there an easy way to knows the volume of each cell using an unstructured grid (my geometry is a sphere for now..)

I have seen that after using blockMesh appear "faces" "neigbour" "owner" and "point" in your /polyMesh directory but it seems difficult to obtain the volume of each cell from there.

Thank you in advance for any help provided!

santiagomarquezd December 7, 2010 13:23

Andrea, the basic info for the mesh is: the points (and their coordinates), which identifies the vertices of the elements, the numeration of the faces, the ownership of these faces by the elements and the patches. Volume of cells have to be reconstructed from this basic info and is not written in the mesh directory (./constant/polyMesh). At running time, you have the mesh.V() method that gives you this info.
If you want to obtain this info prior to run you have to program a preprocessing tool that loads the mesh and then writes this info to disk.

Regards.

Andrea_85 December 8, 2010 03:57

First of all thanks for the reply,

Can you explain a bit better what you mean by mesh.V method. I need this info after the simulation to calculate the energy.

Thanks

santiagomarquezd December 8, 2010 11:15

Hi Andrea, this method (function of C++ object) is part of fvMesh class that gives you a scalarField with the volumes, a good approach to the use of this method was explained in this thread http://www.cfd-online.com/Forums/ope...l-volumes.html, post #10.

Regards.


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