In [1]:
import sys
#sys.path.insert(0,'/user/scratch14.4/PyPPM')
import os
from ppmpy import ppm

In [4]:
YProfile_dir = '/data/ASDR/CSA/rpod2/PPM/YProfiles/'
os.listdir(YProfile_dir)


Out[4]:
['agb-entrainment-convergence',
 'AGBTP_M2.0Z1.e-5',
 'RAWD',
 'M4ZAMS',
 'O-shell-mixing',
 'sakurai',
 'O-shell-M25',
 'C-ingestion',
 'sakurai-num-exp-robustness-onset-GOSH']

In [10]:
project_dir = os.listdir(YProfile_dir)[6]
print project_dir


O-shell-M25

In [11]:
#reload(ppm)
ppm.set_YProf_path(os.path.join(YProfile_dir,project_dir))

In [12]:
print ppm.ppm_path
print ppm.cases


/data/ASDR/CSA/rpod2/PPM/YProfiles/O-shell-M25
['D10', 'D11', 'D14', 'D23', 'D17', 'D4', 'D29', 'D24b', 'D1_toomuchoutput', 'D5', 'D2_dump94-112-notviolent', 'D3', 'D9', 'D26', 'D22', 'D19', 'D15', 'D16', 'D28', 'D27', 'D8', 'D1', 'D18', 'D6', 'D12', 'D25', 'D20', 'D24a', 'D21', 'D2']

In [13]:
ppm.set_nice_params()

High-res standard run


In [14]:
d2=ppm.yprofile('D2') # O-shell 1536^3 case


Reading attributes from file  YProfile-01-0163.bobaaa
There are 164 YProfile files in the /data/ASDR/CSA/rpod2/PPM/YProfiles/O-shell-M25/D2 directory.
Ndump values range from 0 to 163
Time values range from 0.0 to 1640.0

In [17]:
# figure out where we want to put the convective boundary
ifig=10;close(ifig);figure(ifig)
d2.plot('Y','A',shape='--',fname=120)



In [19]:
rtop=8.15
ifig=11;close(ifig);figure(ifig)
d2.Richardson_plot(ifig=ifig,fname1=0, fname2= 120, R_top = rtop)


R_top centred on the nearest cell: R_top = 8.148.
R_low centred on the cell nearest to R_top - 1: R_low = 7.152.

O-shell case with 50 times heating rate


In [20]:
d10=ppm.yprofile('D10') # O-shell 50x heat, 768^3 case


Reading attributes from file  YProfile-01-0262.bobaaa
There are 263 YProfile files in the /data/ASDR/CSA/rpod2/PPM/YProfiles/O-shell-M25/D10 directory.
Ndump values range from 0 to 262
Time values range from 0.0 to 2620.0

In [21]:
# find the top of the convection zone
ifig=50;close(ifig);figure(ifig)
d10.plot('Y','A',fname=120)



In [22]:
ifig=12;close(ifig);figure(ifig)
d10.vprofs(120,ifig=12)



In [23]:
rtop=8.88
ifig=51;close(ifig);figure(ifig)
d10.Richardson_plot(ifig=ifig,fname1=0, fname2= 120, R_top = rtop,ylim_max=2.4)
legend(loc=3)


R_top centred on the nearest cell: R_top = 8.868.
R_low centred on the cell nearest to R_top - 1: R_low = 7.873.
Out[23]:
<matplotlib.legend.Legend at 0x7f2e2e49d310>

In [24]:
d2.Richardson_plot?


Signature: d2.Richardson_plot(fname1=0, fname2=2, R_low=None, R_top=None, do_plots=False, logRi_levels=[-1.0, -0.6, 0.0, 1.0, 2.0, 3.0], ylim_max=2.02, compressible_fluid=True, plot_type=0, ifig=101)
Docstring:
Make a plot of radius vs tangential velocity in the vicinity of the
boundary and draw on lines of constant Richardson number. Compared to
the function that produced Fig. 9 of Woodward+ (2015) this one takes
into account the compressibility of the gas. Several bugs have been
removed, too.


Parameters
----------
fname1 : int
    Which dump do you want to take the stratification from?
fname2 : int
    Which dump do you want to take the velocities from?
R_low : float
    The minimum radius in the plot. If invalid or None it will be set
    to R_top - 1.
R_top : float
    Radius of top of convection zone. If invalid or None it will be set 
    to the radius at which FV H+He = 0.9.
do_plots : logical
    Do you want to do some intermittent plotting?
logRi_levels : list, optional
    Values of Ri for which to draw contours.
ylim_max : float
    Max of ylim (min is automatically determined) in the final plot.
compressible_fluid : logical
    You can set it to False to use the Richardson criterion for
    an incompressible fluid.
plot_type : int
    plot_type = 0: Use a variable lower endpoint and a fixed upper endpoint of
    the radial interval, in which Ri is calculated. Ri is plotted
    for a range of assumed velocity differences with respect to
    the upper endpoint.
    plot_type = 1: Compute Ri locally assuming that the local velocities vanish
    on a certain length scale, which is computed from the radial
    profile of the RMS horizontal velocity.
ifig : int
    Figure number for the Richardson plot (a new window must be opened).

Examples
---------

.. ipython::

    In [136]: data_dir = '/data/ppm_rpod2/YProfiles/'
       .....: project = 'AGBTP_M2.0Z1.e-5'
       .....: ppm.set_YProf_path(data_dir+project)
    
    @savefig richardson.png width=6in
    In [136]: F4 = ppm.yprofile('F4')
       .....: F4.Richardson_plot()
       
File:      /user/scratch14.4/PyPPM/ppmpy/ppm.py
Type:      instancemethod