CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] Using python script for automatic post processing of openFoam

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

Like Tree1Likes
  • 1 Post By Joshua14

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 14, 2017, 10:54
Default Using python script for automatic post processing of openFoam
  #1
New Member
 
Join Date: Apr 2017
Posts: 6
Rep Power: 5
vPaquet is on a distinguished road
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!
vPaquet is offline   Reply With Quote

Old   June 14, 2017, 12:42
Default
  #2
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 5
Joshua14 is on a distinguished road
Have you tried running the script using pvpython?

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

Joshua
Joshua14 is offline   Reply With Quote

Old   June 14, 2017, 12:50
Default
  #3
New Member
 
Join Date: Apr 2017
Posts: 6
Rep Power: 5
vPaquet is on a distinguished road
tool -> python shell is greyed in parafoam so i can't use it..
vPaquet is offline   Reply With Quote

Old   June 14, 2017, 12:52
Default
  #4
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 5
Joshua14 is on a distinguished road
Quote:
Originally Posted by vPaquet View Post
tool -> python shell is greyed in parafoam so i can't use it..
What version of Paraview are you using?

Joshua
Joshua14 is offline   Reply With Quote

Old   June 14, 2017, 13:03
Default
  #5
New Member
 
Join Date: Apr 2017
Posts: 6
Rep Power: 5
vPaquet is on a distinguished road
paraFoam 4.4.0 64bits Linux
vPaquet is offline   Reply With Quote

Old   June 14, 2017, 13:32
Default
  #6
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 5
Joshua14 is on a distinguished road
Quote:
Originally Posted by Joshua14 View Post
Have you tried running the script using pvpython?
What about this?

Joshua
Joshua14 is offline   Reply With Quote

Old   June 15, 2017, 05:22
Default
  #7
New Member
 
Join Date: Apr 2017
Posts: 6
Rep Power: 5
vPaquet is on a distinguished road
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.

Last edited by vPaquet; June 15, 2017 at 08:58.
vPaquet is offline   Reply With Quote

Old   June 15, 2017, 09:09
Default
  #8
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 5
Joshua14 is on a distinguished road
Quote:
Originally Posted by vPaquet View Post
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
vPaquet likes this.
Joshua14 is offline   Reply With Quote

Old   June 15, 2017, 09:21
Default
  #9
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 5
Joshua14 is on a distinguished road
You might want to try looking at this CFD Online post:

Python Shell button is diabled

Joshua
Joshua14 is offline   Reply With Quote

Old   June 15, 2017, 09:52
Default
  #10
New Member
 
Join Date: Apr 2017
Posts: 6
Rep Power: 5
vPaquet is on a distinguished road
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!
vPaquet is offline   Reply With Quote

Old   June 15, 2017, 09:59
Default
  #11
Member
 
Joshua
Join Date: Dec 2016
Location: St. Louis, Missouri
Posts: 91
Rep Power: 5
Joshua14 is on a distinguished road
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
Joshua14 is offline   Reply With Quote

Old   June 20, 2017, 07:32
Default
  #12
New Member
 
Join Date: Apr 2017
Posts: 6
Rep Power: 5
vPaquet is on a distinguished road
Now i have the version 5.4 of paraview installed but still got the same problem.
vPaquet is offline   Reply With Quote

Reply

Tags
openfoam, parafoam, paraview, python

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PyFoam with Python Post Processing godfatherBond OpenFOAM Post-Processing 0 October 18, 2018 15:18
python script to create geometry for salome, and then mesh 6863523 Mesh Generation & Pre-Processing 4 March 18, 2017 09:00
Post processing in CFD Post or Fluent. Blobs OpenFOAM Post-Processing 2 June 26, 2016 07:23
Post processing from OpenFoam to Tecplot danielec87 Tecplot 2 August 14, 2012 14:19
CentFOAM Python Script Installation: Error socon009 OpenFOAM Installation 2 May 26, 2012 09:36


All times are GMT -4. The time now is 12:42.