Dear All,<br><br>I have been recently experimenting with OpenFOAM and paraview, in particular pvbatch. In particular, I am interested in exporting images and data from paraview, using pvbatch.<br><br>To this end, I do the following:<br>
<br>[1] Run OpenFOAM and generate the required &quot;state file&quot; in paraview (say pressure.pvsm)<br>[2] Run &quot;pvbatch extract.py&quot;, where my extract.py looks as follows:<br><br>from paraview.simple import *<br>
servermanager.LoadState(&quot;/home/jameswh/OpenFOAM/ram-2.1.0/run/tutorials/incompressible/icoFoam/cavity/pressure.pvsm&quot;)<br>GetActiveSource()<br>SetActiveView(GetRenderView())<br>Render()<br>WriteImage(&quot;/home/ram/image1.png&quot;)<br>
<br>and it works fine. However, I have two fundamental problems:<br><br>[1] If I change my input to OpenFOAM, and run the above (extract.py), the images are not scaled to the correct units (pressure). How can I automatically rescale the results value? So, say for case 1 run, my min and max are 5 and 10, for case 2 run, my min and max and 10 and 20. However, since Iam using the pvsm from case 1, my images in case 2 also show 5 and 10, rather than 10 and 20. I found the &quot;properties&quot; tag in the *.pvsm file, and I notice that the values are &quot;hard coded&quot; How can I say &quot;scale values automatically&quot;? I hope my question is clear.<br>
<br>[2] Secondly, I would like to write out values using &quot;Save Data&quot;, and I am looking for an equivalent of &quot;save data&quot; in pvbatch. I tried doing a python trace, but, when I do a Save Data, it does not seem to track/trace anything.<br>
<br>If anyone has encountered the above problems, and possibly have a solution, Id be glad if you could point me in the right direction.<br><br>Thank you for your time.<br><br>regards,<br><br>James WH<br><br>Research Fellow in Engineering,<br>
Oxford.<br>