CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] ParaFoam Scripting (https://www.cfd-online.com/Forums/paraview/61227-parafoam-scripting.html)

iyer_arvind October 16, 2006 02:39

ParaFoam Scripting
 
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

mattijs October 16, 2006 05:08

Have a look at the file which
 
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.

iyer_arvind October 16, 2006 06:45

dear sir, i guessed that you
 
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!!!

iyer_arvind October 16, 2006 21:39

After a lot of combinations i
 
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)?

iyer_arvind October 16, 2006 23:51

Can anyone post a sample code
 
Can anyone post a sample code to read a file in vtk-python generated by foamToVTK?

hemph October 17, 2006 11:59

I believe the issue is that th
 
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.

iyer_arvind October 22, 2006 02:05

i was not doing Update() http:
 
i was not doing Update() http://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif and thanks for the help.... it was a very valuable hint

lr103476 November 2, 2006 05:06

Hi, So did you succeed in g
 
Hi,

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

Frank


All times are GMT -4. The time now is 07:41.