CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   volScalarField: how to get the coordinates of the cells (http://www.cfd-online.com/Forums/openfoam/92324-volscalarfield-how-get-coordinates-cells.html)

mrv4real September 10, 2011 02:59

volScalarField: how to get the coordinates of the cells
 
Hi,

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,
mrv4real

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

Hi,

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 ...

Thanks!
mrv4real

tonyuprm September 11, 2011 14:20

Hi,

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

U.mesh().C()[cellI]

*cellI is an index

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

U.mesh().C()[cellI].x()

gl,

Tony

mrv4real September 11, 2011 14:27

Hi,

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,
mrv4real

elvis January 17, 2012 07:21

Hi,

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 "http://www.openfoamworkshop.org/2012/OFW7_Former.html currently a dead link http://www.openfoamworkshop.org/6th_...am/Program.htmto that 6th workshop") and that you can convert from VTK to many formats =>(VRML http://www.vtk.org/doc/release/5.8/html/a02298.html, STL http://www.vtk.org/doc/release/5.8/html/a01973.html, OBJ http://www.vtk.org/doc/release/5.8/html/a01303.html to name a few)


All times are GMT -4. The time now is 15:35.