CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   volScalarField: how to get the coordinates of the cells (

mrv4real September 10, 2011 02:59

volScalarField: how to get the coordinates of the cells

i ran the damBreak tutorial with interFoam and everything works fine. Now i am working on the postprocessing and would like to visualize the alpha1 file in the timestep directories.

I didn't find it in other post, could someone help me, how to get the coordinates of the cells, for which in alpha1 the scalar value is given?

Thanks a lot,

nimasam September 10, 2011 15:37

could you tell me what do u want exactly?
alpha1 is in each time directory to visualize it you can just select alpha1 in paraFoam!

if you want to see the coordinate of each cell! you can use integrateVariable in paraView filter

mrv4real September 10, 2011 15:43


using paraFoam is what i did till now, but i have to visualize the results in an existing native OpenGL application.

So i have to get the alpha value and the coordinates to write my glVertex ...


tonyuprm September 11, 2011 14:20


You can write out information from the solver. The coordinates are accessed from a volVectorField such as "U" in this case:


*cellI is an index

A specific coordinate such as the x axis is accessed by:




mrv4real September 11, 2011 14:27


but is there also away, to get the coordinates of a cell from the files in constant/polyMesh and so on?

As I understand it, the alpha1 file has the values of the alfa-value for every cell in a timestep.

In the polyMesh are the faces, points and so on but how do I find the definition of the cells, for which the alfa value is given in alhpa1?

Thanks a lot,

elvis January 17, 2012 07:21


what about these options foamMeshToFluent , foamToFieldview, foamToEnsight,
Not to forget foamToVTK

but keep in mind that paraview is scriptable (there is some material from the OF 6th workshop " currently a dead link that 6th workshop") and that you can convert from VTK to many formats =>(VRML, STL, OBJ to name a few)

All times are GMT -4. The time now is 09:43.