|
[Sponsors] |
October 16, 2006, 02:39 |
ParaFoam Scripting
|
#1 |
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 |
|
October 16, 2006, 05:08 |
Have a look at the file which
|
#2 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
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.
|
|
October 16, 2006, 06:45 |
dear sir,
i guessed that you
|
#3 |
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!!! |
|
October 16, 2006, 21:39 |
After a lot of combinations i
|
#4 |
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)? |
|
October 16, 2006, 23:51 |
Can anyone post a sample code
|
#5 |
Guest
Posts: n/a
|
Can anyone post a sample code to read a file in vtk-python generated by foamToVTK?
|
|
October 17, 2006, 11:59 |
I believe the issue is that th
|
#6 |
Senior Member
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 17 |
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. |
|
October 22, 2006, 02:05 |
i was not doing Update() http:
|
#7 |
Guest
Posts: n/a
|
i was not doing Update() and thanks for the help.... it was a very valuable hint
|
|
November 2, 2006, 05:06 |
Hi,
So did you succeed in g
|
#8 |
Senior Member
Frank Bos
Join Date: Mar 2009
Location: The Netherlands
Posts: 340
Rep Power: 18 |
Hi,
So did you succeed in getting the scalars and vectors in mayaVi? Frank
__________________
Frank Bos |
|
|
|
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 |