CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] ParaFoam Scripting

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 16, 2006, 02:39
Default ParaFoam Scripting
  #1
iyer_arvind
Guest
 
Posts: n/a
Dear friends,
I run a transient case with an output of 15,000 transient files, which i have to analyze. The condition is such that i cannot post-process (like finding vorticity etc) on all the files and then view them in paraFoam, due to space constraints. Hence, i would like to follow:

[load data-> calculate->save->load in paraView->plot->delete file]

cycle on each file individually

This will obviously require scripting, i could not find a resource for scripting on paraView's User's Guide

Can anyone suggest where i can find more information on the needed scripting?

Regards,
IAS
  Reply With Quote

Old   October 16, 2006, 05:08
Default Have a look at the file which
  #2
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Have a look at the file which does the demo (Help->Play Demo). Or save a batch script and study that. Alternatively use foamToVTK and Visit which uses Python instead of TCL and has got a good user guide which explains batch processing.
mattijs is offline   Reply With Quote

Old   October 16, 2006, 06:45
Default dear sir, i guessed that you
  #3
iyer_arvind
Guest
 
Posts: n/a
dear sir,
i guessed that you were mentioning MayaVi (correct me if i were wrong, your post missed it) but i am myself facing some strange problem. exporting foamToVTK does all the export(at least it says so ;) ), and i am able to see the fields in ASCII, if i open the file in the text editor, but neither paraview nor MayaVi is able to show any of the scalars.

i Tried with the small mesh of cavity (icofoam) and that paraview was able to get the scalar not MayaVi. i am unable to find out where the problem is. If thats not all,

Mayavi is able to open Ensight file, but exported file from openFoam simply crashes it!!

ANSYS ICEM CFD is unable to open the fieldview file i exported from OpenFOAM

something is seriously wrong somewhere!!!
  Reply With Quote

Old   October 16, 2006, 21:39
Default After a lot of combinations i
  #4
iyer_arvind
Guest
 
Posts: n/a
After a lot of combinations i found out that foamToVTK does not export in the same form as VTK-Legacy file fromat as documented by VTK (please correct me if i am wrong).

I intended to use vtk-python to view these results, it would have made my job really simple, and reader never registered any scalar or vector in the file.

My find was that paraview uses a different way to access these files.

If my observation is indeed right, is there a way to get the data into vtk-python (WITHOUT PARAVIEW)?
  Reply With Quote

Old   October 16, 2006, 23:51
Default Can anyone post a sample code
  #5
iyer_arvind
Guest
 
Posts: n/a
Can anyone post a sample code to read a file in vtk-python generated by foamToVTK?
  Reply With Quote

Old   October 17, 2006, 11:59
Default I believe the issue is that th
  #6
Senior Member
 
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 17
hemph is on a distinguished road
I believe the issue is that the variables are stored as field data using foamToVTK. As far as I know, you have to filter them to attribute data to do something useful.

I do:

reader = vtkUnstructuredGridReader()
reader.SetFileName('fileName')
reader.Update()

gfilter = vtkFieldDataToAttributeDataFilter()
gfilter.SetInput(reader.GetOutput())
gfilter.SetInputFieldToPointDataField()
gfilter.SetOutputAttributeDataToPointData()
gfilter.SetScalarComponent(0, "p", 0)
gfilter.SetVectorComponent(0, "U", 0)
gfilter.SetVectorComponent(1, "U", 1)
gfilter.SetVectorComponent(2, "U", 2)

Then you do your vtk-thing to gfilter instead of reader.
hemph is offline   Reply With Quote

Old   October 22, 2006, 02:05
Default i was not doing Update() http:
  #7
iyer_arvind
Guest
 
Posts: n/a
i was not doing Update() and thanks for the help.... it was a very valuable hint
  Reply With Quote

Old   November 2, 2006, 05:06
Default Hi, So did you succeed in g
  #8
Senior Member
 
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18
lr103476 is on a distinguished road
Hi,

So did you succeed in getting the scalars and vectors in mayaVi?

Frank
__________________
Frank Bos
lr103476 is offline   Reply With Quote

Reply


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
[OpenFOAM] Unable to launch parafoam & boonhow ParaView 5 March 23, 2022 09:09
[OpenFOAM.com] paraFoam cannot open due to Qt issues - [Solved/Information] u2berggeist OpenFOAM Installation 2 July 2, 2018 18:03
[OpenFOAM] How to use paraFoam on a cluster andreas ParaView 1 March 6, 2013 18:11
[OpenFOAM] OpenFoam (Ubuntu): paraFoam via Xming+PuTTY raketenmaid ParaView 4 February 5, 2013 06:20
python scripting in paraFoam chegdan OpenFOAM Post-Processing 0 March 31, 2010 20:06


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