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

[OpenFOAM] Correctly loading my casefiles via pvpython

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 17, 2016, 18:53
Default Correctly loading my casefiles via pvpython
  #1
New Member
 
Sara
Join Date: Dec 2013
Posts: 10
Rep Power: 12
karma15 is on a distinguished road
Hi Everyone,

I am in the process of using pvpython from Paraview for my post-processing needs. While I have used the python tracer in Paraview to learn exactly what commands I will need for pvpython script, I am just getting stuck with what I think is the OpenFOAM case loading (i.e. transition from using the 'paraFoam' command to loading my OpenFOAM case data using pvpython).

Thus, can someone possibly guide me on what these steps would look like. I have been looking through other forum threads, but still can't seem to find the exact answer.

I was looking at this thread, and it looks like this is the command I should use:
Code:
cfd_OpenFOAM = PV3FoamReader( FileName='/home/cfd/cfd.OpenFOAM' )
but my question is what is the name of my actual version of the "cfd.OpenFOAM" file?

Or should I be using the
Code:
foamToVTK
utility?

Thanks for your help.

Sincerely,
Sara
karma15 is offline   Reply With Quote

Old   August 18, 2016, 04:34
Default
  #2
New Member
 
Join Date: Mar 2015
Posts: 12
Rep Power: 11
JensD is on a distinguished road
Hi Sara,

I have just started to do some basic scripting with the trace function, so I am not an expert on this, but you can just create a blank file (e.g. cfd.OpenFOAM, case.OpenFOAM, ... ) and place it in the simulation folder.

Opening VTK files should be a bit faster as this is native to paraview, however IMO for big cases it takes longer to convert the case to VTK format than the gain on loading in paraview.

Let me know if this helps you somewhat.

Sincerly,
Jens
JensD is offline   Reply With Quote

Old   August 18, 2016, 10:37
Default
  #3
New Member
 
Sara
Join Date: Dec 2013
Posts: 10
Rep Power: 12
karma15 is on a distinguished road
So what does the beginning of your pvpython script look like?

The issue I am having is that when I do the trace method, the data is already loaded (via paraFoam command). But when I try to strictly run it via pvpython, I am having trouble determining which commands to use to actually load the data.

Thanks for your help.
karma15 is offline   Reply With Quote

Old   August 18, 2016, 10:44
Default
  #4
New Member
 
Join Date: Mar 2015
Posts: 12
Rep Power: 11
JensD is on a distinguished road
The beginning is pretty straight forward
Code:
try: paraview.simple
except: from paraview.simple import *
paraview.simple._DisableFirstRenderCameraReset()

case_foam = OpenFOAMReader( FileName='/home/path/case.foam' )
You can also just start the trace function before loading your data, load the data selecting which fields you want, and the trace will give you the script to load the case and the selected fields.
JensD is offline   Reply With Quote

Reply

Tags
pvpython


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
[swak4Foam] difficulties installing swak4foam newbie29 OpenFOAM Community Contributions 120 October 21, 2022 05:01
Identifying Markers in a CGNS Mesh tjim SU2 3 October 12, 2018 02:21
[General] Loading the correct time step with pvpython Jack001 ParaView 1 April 4, 2016 08:14
[General] problem with pvpython when loading state involving Plot Over Lines hadrien51 ParaView 1 October 17, 2012 12:18
Linux Batch - Star-CCM+ .. running Sims in batchmode eRzBeNgEl STAR-CCM+ 3 August 29, 2011 05:43


All times are GMT -4. The time now is 23:48.