CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Paraview & paraFoam

ParaFoam Scripting

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 16, 2006, 01:39
Default Dear friends, I run a transie
  #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, 04:08
Default Have a look at the file which
  #2
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 16
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, 05: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, 20: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, 22: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, 10:59
Default I believe the issue is that th
  #6
Senior Member
 
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 8
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, 01: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: 338
Rep Power: 9
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

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
icem- scripting!!!!!!!!!!!!!!!! ganesh CFX 0 March 10, 2009 05:24
using loops in icem cfd scripting krishna CFX 1 February 27, 2009 05:42
icem-cfd-scripting problem... tushar CFX 4 February 20, 2009 02:06
scripting in GridGen Tim CD-adapco 1 June 30, 2007 13:33
field view scripting Rudresh Main CFD Forum 0 April 11, 2007 06:03


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