CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Paraview & paraFoam (http://www.cfd-online.com/Forums/openfoam-paraview/)
-   -   setting up pvpython to act like parafoam (http://www.cfd-online.com/Forums/openfoam-paraview/123984-setting-up-pvpython-act-like-parafoam.html)

jonathanbyrn September 25, 2013 07:10

setting up pvpython to act like parafoam
 
Hey.
I used trace to generate a python script that would add a slice to a model and render it. It works fine when I run:
paraFoam --script=genimage.py
but it opens up paraview to do the rendering. I wanted to do all this from the commandline so I tried using pvpython and pvbatch but they cannot find the source.

I examined the the paraFoam script and it seems to be creating a config file that specifies the initial source but when I open x.OpenFOAM but there is nothing in it.

My question is how do I get pvpython to load my source in the same way paraFoam does?

I also tried pyFoamPVSnapshot.py but it seems to be expecting an older version of paraview, has it been deprecated?

jonathanbyrn September 26, 2013 09:42

It turns out paraFoam just creates a dummy file, e.g.; cfd.OpenFOAM and then calls paraview with the command:

paraview --data=cfd.OpenFOAM

The equivalent can be done in a pvpython script by calling:

cfd_OpenFOAM = PV3FoamReader( FileName='/home/cfd/cfd.OpenFOAM' )


All times are GMT -4. The time now is 16:26.