PLUTO
flow_past_cyc.py
Go to the documentation of this file.
1 import os
2 import matplotlib.pyplot as plt
3 import pyPLUTO as pp
4 import numpy as np
5 
6 I = pp.Image()
7 plutodir = os.environ['PLUTO_DIR']
8 wdir = plutodir+'/Test_Problems/HD/Viscosity/Flow_Past_Cylinder/'
9 
10 try:
11  D = pp.pload(10,datatype='hdf5',level=3, w_dir=wdir)
12 
13 except IndexError:
14  print 'data.0010.hdf5 not found .. Loading data.0000.hdf5 at level 0'
15  D = pp.pload(0,datatype='hdf5',w_dir=wdir)
16 
17 #Plot 2D AMR R-Phi Polar Data on Cartesian X-Y Plane.
18 I.pldisplay(D, D.rho, x1=D.x1, x2=D.x2,
19  polar=[True, True], fignum=1,
20  cbar=[True, 'horizontal'],figsize=[8,8],
21  label1='X', label2='Y',title=r'Density [$\rho$]')
22 ax1 = plt.gca()
23 ax1.axis([-10, 50,-20.0, 20.0])
24 
25 #Using the OplotBox routine to overplot sublevels.
26 I.oplotbox(D.AMRLevel,lrange=[0,3],geom=D.geometry)
27 
28 plt.savefig('amr_flowcyc.png')