CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] Automating ParaFoam for exporting CSV files (https://www.cfd-online.com/Forums/paraview/85086-automating-parafoam-exporting-csv-files.html)

kumar February 17, 2011 04:12

Automating ParaFoam for exporting CSV files
 
Hello ,
I am using interFoam for jet simulations and I want to export my data into matlab. I perform the following operations:
Start ParaFoam

1) Load Mesh parts - ALL
2) Load Volume Fields - alpha1
3) Display - Representation - points
4) Select color by - Volpoint interpolation (alpha1)
5) Split Horizontal
6) Spreadsheet view
7) Export - filename.csv

Then i am able to easily import this file in Matlab.

But I have around 100 timesteps, and i dont want to perform this action for all the time steps. Is there an easy way to record these actions and then execute the script for all the time steps.
any idea on performing this is helpful

regards
K.Suresh kumar

wyldckat February 19, 2011 13:34

Greetings kumar,

AFAIK, you have at least two possible solutions:
  • Check ParaView's wiki and learn about Python scripting within ParaView. Other than that, ParaView doesn't have macro functionality :( (edit: I was wrong about macros capabilities, see next 2 posts)
  • The other possibility is to export to CSV directly in OpenFOAM, by applying the patches available here and following the instructions available in that same page.
Best regards and good luck!
Bruno

Bernhard February 21, 2011 02:39

No macro's in Paraview? What do you mean with that? Since you can 'trace' a series of actions via the python shell, and save it as Python script. You can then execute it via the GUI if you like. But writing a loop around this should not be too complicated in this case.

wyldckat February 21, 2011 04:51

Greetings Bernhard,

Quote:

Originally Posted by Bernhard (Post 296194)
No macro's in Paraview? What do you mean with that?

I'm use to seeing the term "Macros" in OpenOffice, Office and some other text editors, where mouse clicks and keyboard actions can be recorded...
Hey, wait, it does have macros!!! :rolleyes: Apparently I've been partially asleep for a while now :(

Quote:

Originally Posted by Bernhard (Post 296194)
Since you can 'trace' a series of actions via the python shell, and save it as Python script.

:eek: Indeed it does!! ParaView 3.6.1 doesn't (at least via GUI), but ParaView 3.8.0 has a tracing capability!!

On the menu "Tools->Python Shell", select the "Trace" tab and click on the "Start Trace". Do the actions. "Stop Trace" and "Edit Trace", make the changes you want and save the script. Then it's just a matter of running the script!!

Many thanks Bernhard!

Best regards,
Bruno

David* May 2, 2011 11:10

Hello,

my ParaView is the version from the OF homepage (paraviewopenfoam381), but it has no python and no macro functionality. Do I need to just download and install ParaView from the official page to restore this functions?
And which functions am I losing by doing this (or are the two versions just the same?)?

Thanks for every hint
David

/edit: I had to download the 'official' ParaView 3.10.1 and modify it following this instructions:
http://www.cfd-online.com/Forums/blo...-openfoam.html


All times are GMT -4. The time now is 02:00.