protoRT.disk_model
Created on Fri Aug 12 09:25:13 2022
@author: daniel
Module Contents
Classes
Generate and visualize a 1D midplane model of a protoplanetary disk. |
Functions
Configure matplotlib style settings for consistent plot appearance. |
- class protoRT.disk_model.Model(r, r_c, M_star, M_disk, grain_size=0.1, grain_rho=1, T0=150, q=3.0 / 7, gamma=1, mmol=2.3, Z=0.01, stoke=None)[source]
Generate and visualize a 1D midplane model of a protoplanetary disk.
This class defines a physically consistent disk structure, including gas and dust surface densities, temperature, and stability parameters. It enables proper unit conversion and parameter initialization for use in simulations and radiative transfer calculations.
Note
All units are assumed to be in CGS.
- Parameters:
r (float or ndarray) – Disk radii where quantities are evaluated (cm).
r_c (float) – Characteristic disk radius (cm), typically ~30 AU (compact) to 300 AU (large).
M_star (float) – Mass of the central star (g).
M_disk (float) – Total disk mass (g).
grain_size (float, optional) – Grain size (cm); used only if stoke is None. Default is 0.1.
grain_rho (float, optional) – Internal grain density (g/cm³). Default is 1.
T0 (float, optional) – Reference temperature at 1 AU (K). Default is 150.
q (float, optional) – Temperature power-law index. Default is 3/7.
gamma (float, optional) – Adiabatic index. Default is 1 (isothermal).
mmol (float, optional) – Mean molecular weight. Default is 2.3.
Z (float, optional) – Global dust-to-gas mass ratio. Default is 0.01.
stoke (float, optional) – Stokes number. If provided, grain size is derived from it.
- grain_size
Grain size (cm); either input directly or derived from Stokes number.
- Type:
float or ndarray
- omega
Keplerian angular velocity (rad/s).
- Type:
ndarray
- sigma_g
Gas surface density profile (g/cm²).
- Type:
ndarray
- sigma_d
Dust surface density profile (g/cm²).
- Type:
ndarray
- T
Temperature profile (K).
- Type:
ndarray
- cs
Sound speed (cm/s).
- Type:
ndarray
- H
Gas pressure scale height (cm).
- Type:
ndarray
- h
Disk aspect ratio (H/r).
- Type:
ndarray
- Q
Toomre Q parameter.
- Type:
ndarray
- G
Self-gravity parameter (G-tilde).
- Type:
ndarray
- beta
Dimensionless radial pressure gradient parameter.
- Type:
ndarray
- get_params(print_params=True)[source]
Compute all physical disk parameters and optionally print them.
This method calculates the complete set of disk parameters including gas and dust surface densities, temperature, sound speed, disk thickness, and stability indicators like Toomre Q and the beta parameter. Depending on whether stoke is provided, it computes the corresponding grain size or Stokes number.
- Parameters:
print_params (bool, optional) – If True, the computed parameters are printed to the console. Default is True.
- Returns:
Updates instance attributes in-place.
- Return type:
None
- calc_sigma_g()[source]
Calculate the gas surface density profile.
Follows the exponential tapering model from Drazkowska et al. (2022).
- Returns:
Sets self.sigma_g as a function of radius (g/cm²).
- Return type:
None
- calc_sigma_d()[source]
Calculate the dust surface density profile.
Computed as a constant fraction of the gas surface density using the global dust-to-gas mass ratio Z.
- Returns:
Sets self.sigma_d as a function of radius (g/cm²).
- Return type:
None
- calc_stokes()[source]
Calculate the Stokes number from grain properties and gas density.
Assumes Epstein drag regime, valid for small particles in low-density gas.
- Returns:
Sets self.stoke as a function of radius (dimensionless).
- Return type:
None
- calc_grain_sizes()[source]
Compute grain sizes from a fixed Stokes number.
This inverts the Stokes number formula to recover grain size at each radius.
- Returns:
Sets self.grain_size as a function of radius (cm).
- Return type:
None
- calc_omega()[source]
Compute Keplerian angular velocity at each radius.
- Returns:
Sets self.omega in units of rad/s.
- Return type:
None
- calc_Q()[source]
Compute the Toomre Q parameter for gravitational stability.
- Returns:
Sets self.Q (dimensionless).
- Return type:
None
- calc_T()[source]
Compute the disk temperature profile from a power-law model.
Follows Ida et al. (2016), applicable to outer disk regions where viscous heating is negligible.
- Returns:
Sets self.T as a function of radius (K).
- Return type:
None
- calc_h()[source]
Compute the disk aspect ratio h = H / r.
- Returns:
Sets self.h (dimensionless).
- Return type:
None
- calc_cs()[source]
Compute the sound speed based on local temperature and molecular weight (using hydrogen molecule mass)
- Returns:
Sets self.cs as a function of radius (cm/s).
- Return type:
None
- calc_H()[source]
Compute the gas pressure scale height of the disk.
- Returns:
Sets self.H as a function of radius (cm).
- Return type:
None
- calc_G()[source]
Compute the dimensionless self-gravity parameter G-tilde.
Defined as G = sqrt(8 / pi) / Q.
- Returns:
Sets self.G (dimensionless).
- Return type:
None
- calc_beta()[source]
Compute the radial pressure gradient parameter β.
The dimensionless β parameter accounts for the radial variation in pressure, and is defined as:
β = h × dlnp/dlnr
Assuming power-law profiles for surface density, temperature, and Keplerian rotation, the gradient simplifies to:
dlnp/dlnr ≈ −1 − 0.5 × q − 1.5
- For the default temperature index q = 3/7, this evaluates to:
β ≈ h × (−2.2857)
- Returns:
Updates the self.beta attribute (dimensionless).
- Return type:
None
- plot(xticks=[5, 20, 40, 60, 80, 100], ax1_xlim=None, ax1_ylim=None, ax2_xlim=None, ax2_ylim=None, ax3_xlim=None, ax3_ylim=None, ax4_xlim=None, ax4_ylim=None, ax1_ylog=True, ax2_ylog=True, ax3_ylog=True, ax4_ylog=False, include_grid=False, savefig=False, path=None, box_index=None, plot_vertical=False, title='Protoplanetary Disk Model')[source]
Plot the radial structure of the disk model. Only plots four key model parameters: gas and dust density profiles, temperature profile, grain size or stokes number, and aspect ratio.
- Parameters:
ax{1..4}_xlim (tuple or None) – Axis limits for each subplot.
ax{1..4}_ylim (tuple or None) – Axis limits for each subplot.
ax{1..4}_ylog (bool) – Whether to use log scaling on the y-axis.
include_grid (bool) – Add grid to all subplots.
savefig (bool) – If True, save the figure instead of displaying.
path (str or None) – Path to save the figure. Defaults to home directory.
box_index (int or None) – Index of radius value to highlight.
plot_vertical (bool) – Arrange plots vertically if True; otherwise in 2x2 grid.
title (str) – Title of the plot.
- Return type:
None
- protoRT.disk_model._set_style_()[source]
Configure matplotlib style settings for consistent plot appearance.
This function updates matplotlib.pyplot.rcParams to define a custom plotting style, which is used before saving figures.
- Returns:
Applies changes to matplotlib’s global rcParams.
- Return type:
None