CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [OpenFOAM] Using python script for automatic post processing of openFoam (https://www.cfd-online.com/Forums/paraview/189145-using-python-script-automatic-post-processing-openfoam.html)

vPaquet June 14, 2017 10:54

Using python script for automatic post processing of openFoam
 
Hi,

I'm having some problems with the automation of the post processing of my openFoam case..


1) can't run python script with parafoam but can open my openFoam case

2) can run python script with paraview but can't open my openFoam case

3) I dont know how to fully automate my script i just know how to use: tool-->python shell
is there a way to only use a script that: open paraview -> do stuff with python shell -> close paraview

Thanx!

Joshua14 June 14, 2017 12:42

Have you tried running the script using pvpython?

You should be able to copy and paste your script into the python shell.

Joshua

vPaquet June 14, 2017 12:50

tool -> python shell is greyed in parafoam so i can't use it..

Joshua14 June 14, 2017 12:52

Quote:

Originally Posted by vPaquet (Post 653216)
tool -> python shell is greyed in parafoam so i can't use it..

What version of Paraview are you using?

Joshua

vPaquet June 14, 2017 13:03

paraFoam 4.4.0 64bits Linux

Joshua14 June 14, 2017 13:32

Quote:

Originally Posted by Joshua14 (Post 653213)
Have you tried running the script using pvpython?

What about this?

Joshua

vPaquet June 15, 2017 05:22

What's the difference between pvpython and python script?

I have use Cmake to put PARAVIEW_ENABLE_PYTHON = ON but python script is still greyed

When i launch my script from the bash: paraFoam --script=parapy04.py I get an error message : Python support not enabled. Cannot run python scripts.

Joshua14 June 15, 2017 09:09

Quote:

Originally Posted by vPaquet (Post 653331)
What's the difference between pvpython and python script?

Say you have script.py

If you run "python script.py" then python is used to run the script.

If you do "pvpython script.py" then you use the paraview version of python that already has certain modules loaded into it.

On the other hand, pvbatch is the parallel version of pvpython.

Joshua

Joshua14 June 15, 2017 09:21

You might want to try looking at this CFD Online post:

https://www.cfd-online.com/Forums/pa...n-diabled.html

Joshua

vPaquet June 15, 2017 09:52

Yea I have seen this post but the problem is that I have is that paraview can't open my openFoam case correctly (only take 1/4 of the time steps and mix them up), but paraview have no problems running scripts.

So I use the paraview that was installed with openFoam (it can open my case without problems) but paraFoam cant run python scripts.. I have follow these steps to try to solve the situation but i didnt work: https://www.paraview.org/Wiki/ParaVi...iew_With_CMake
Reistalling paraFoam seems like a pretty intricate task, it's all mixed up in OF files!

Joshua14 June 15, 2017 09:59

Try installing the newest version of paraview 5.3, 5.2 also works well. Either way they have more filters and options then version 4.4.

Joshua

vPaquet June 20, 2017 07:32

Now i have the version 5.4 of paraview installed but still got the same problem.

foamiste December 16, 2021 03:30

Please check this video, the automation in paraview is well explained:
https://youtu.be/h6Y7HZR_SAI


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