CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

volScalarField: how to get the coordinates of the cells

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By tonyuprm

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2011, 03:59
Default volScalarField: how to get the coordinates of the cells
  #1
New Member
 
mrv4real
Join Date: Sep 2011
Posts: 11
Rep Power: 14
mrv4real is on a distinguished road
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
mrv4real is offline   Reply With Quote

Old   September 10, 2011, 16:37
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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
nimasam is offline   Reply With Quote

Old   September 10, 2011, 16:43
Default
  #3
New Member
 
mrv4real
Join Date: Sep 2011
Posts: 11
Rep Power: 14
mrv4real is on a distinguished road
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
mrv4real is offline   Reply With Quote

Old   September 11, 2011, 15:20
Default
  #4
Member
 
Tony
Join Date: Jun 2010
Posts: 54
Rep Power: 15
tonyuprm is on a distinguished road
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
pixarzhang likes this.
tonyuprm is offline   Reply With Quote

Old   September 11, 2011, 15:27
Default
  #5
New Member
 
mrv4real
Join Date: Sep 2011
Posts: 11
Rep Power: 14
mrv4real is on a distinguished road
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
mrv4real is offline   Reply With Quote

Old   January 17, 2012, 07:21
Default
  #6
Senior Member
 
Elvis
Join Date: Mar 2009
Location: Sindelfingen, Germany
Posts: 620
Blog Entries: 6
Rep Power: 24
elvis will become famous soon enough
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)
elvis is offline   Reply With Quote

Reply

Tags
interfoam, openfoam, postprocessing, volscalarfield

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 06:50
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 04:23
[snappyHexMesh] external flow with snappyHexMesh chelvistero OpenFOAM Meshing & Mesh Conversion 11 January 15, 2010 20:43
physical boundary error!! kris Siemens 2 August 3, 2005 01:32


All times are GMT -4. The time now is 18:21.