Module Reference

dustpylib Package

DustPyLib is a package with auxiliary tools and extensions for the dust evolution software DustPy.

dustpylib.dynamics Package

This package contains modules about dynamical extensions.

dustpylib.dynamics.backreaction Package

This package contains methods to implement the dust backreaction coefficients. The setup_backreaction(sim) function automatically implements all the required modifications to the Simulation object.

dustpylib.dynamics.backreaction.BackreactionCoefficients(sim)[source]

Updater of the dust.backreaction Group.

Obtain the backreaction coefficients considering the contribution of each dust species. For more information check Garate et al. (2019), equations 23 - 26 in Appendix. This implementation does not consider the vertical structure. Hence, all the dust species and the gas feel the same backreaction.


Assigns the backreaction coefficients are returned to: sim.dust.backreaction.A sim.dust.backreaction.B

dustpylib.dynamics.backreaction.BackreactionCoefficients_VerticalStructure(sim)[source]

Updater of the dust.backreaction Group.

Obtain the backreaction coefficients considering the vertical structure. For more information check Garate et al. (2019), equations 23 - 26 in Appendix.

Considers that the vertical distribution is gaussian for the gas and the dust. The final velocity is the mass flux vertical average at each location. For more information check Garate et al. (2019), equations 31 - 35 in Appendix.


This updater assigns: - the backreaction coefficients used for the gas calculations, accounting for dust vertical settling sim.dust.backreaction.A sim.dust.backreaction.B

  • the backreaction coefficients used for the dust calculations, accounting for dust vertical settling

sim.dust.backreaction.A_dust_settling sim.dust.backreaction.B_dust_settling

dustpylib.dynamics.backreaction.dustDiffusivity_Backreaction(sim)[source]

Reduces the dust diffusivity, accounts for the effect of the local dust-to-gas ratio.

dustpylib.dynamics.backreaction.setup_backreaction(sim, vertical_setup=False)[source]

Add the backreaction setup to your simulation object. Call the backreaction setup function after the initialization and then run, as follows:

sim.initialize() setup_backreaction(sim) sim.run()

Functions

BackreactionCoefficients(sim)

Updater of the dust.backreaction Group.

BackreactionCoefficients_VerticalStructure(sim)

Updater of the dust.backreaction Group.

dustDiffusivity_Backreaction(sim)

Reduces the dust diffusivity, accounts for the effect of the local dust-to-gas ratio.

setup_backreaction(sim[, vertical_setup])

Add the backreaction setup to your simulation object.

vrad_dust_BackreactionVerticalStructure(sim)

dustpylib.grid Package

This package contains methods to manipulate the grid.

dustpylib.grid.refinement Package

This package contains methods to refine the grid.

dustpylib.grid.refinement.refine_radial_local(ri, r0, num=3)[source]

Function refines the radial grid locally bysplitting grid cells recursively at a specific location.

Parameters:
  • ri (array-like, (Nr,)) – Radial grid cell interfaces

  • r0 (float) – Radial location to be refined

  • num (int, optional, default: 3) – Number of refinement steps

Returns:

ri_fine – Refined radial grid cell interfaces

Return type:

array-like, (Nr+,)

Functions

refine_radial_local(ri, r0[, num])

Function refines the radial grid locally bysplitting grid cells recursively at a specific location.

dustpylib.planetesimals Package

This package contains modules about planetesimals.

dustpylib.planetesimals.formation Package

This package contains extensions about planetesimal formation.

dustpylib.planetesimals.formation.drazkowska2016(OmegaK, rho_dust, rho_gas, Sigma_dust, St, p2g_crit=1.0, St_crit=0.01, zeta=0.01)[source]

Function calculates the dust source term due to planetesimal formation of Darzkowska et al. (2016).

Parameters:
  • OmegaK (array-like, (Nr,)) – Keplerian frequency

  • rho_dust (array-like, (Nr, Nm)) – Midplane dust volume density

  • rho_gas (array-like, (Nr,)) – Midplane gas volume density

  • Sigma_dust (array-like, (Nr, Nm)) – Dust surface density

  • St (array-like, (Nr, Nm)) – Stokes numbers

  • p2g_crit (float, optional, default: 1.) – Critical midplane pebbles-to-gas ratio of particles above St_crit above which planetesimal formation is triggered

  • St_crit (float, optional, default: 0.01) – Critical Stokes number above which dust particles contribute to trigger planetesimal formation

  • zeta (float, optional, default: 0.1) – Planetesimal formation efficiency

Returns:

S – Dust source terms due to planetesimal formation

Return type:

array-like, (Nr, Nm)

dustpylib.planetesimals.formation.miller2021(OmegaK, rho_dust, rho_gas, Sigma_dust, St, d2g_crit=1.0, n=0.03, zeta=0.1)[source]

Function calculates the dust source term due to planetesimal formation of Miller et al. (2021).

Parameters:
  • OmegaK (array-like, (Nr,)) – Keplerian frequency

  • rho_dust (array-like, (Nr, Nm)) – Midplane dust volume density

  • rho_gas (array-like, (Nr,)) – Midplane gas volume density

  • Sigma_dust (array-like, (Nr, Nm)) – Dust surface density

  • St (array-like, (Nr, Nm)) – Stokes numbers

  • d2g_crit (float, optional, default: 1.) – Critical midplane dust-to-gas ratio above which planetesimal formation is triggered

  • n (float, optional, default: 0.03) – Smoothness parameter of dust-to-gas ratio transition

  • zeta (float, optional, default: 0.1) – Planetesimal formation efficiency

Returns:

S – Dust source terms due to planetesimal formation

Return type:

array-like, (Nr, Nm)

dustpylib.planetesimals.formation.schoonenberg2018(OmegaK, rho_dust, rho_gas, Sigma_dust, St, d2g_crit=1.0, zeta=0.1)[source]

Function calculates the dust source term due to planetesimal formation of Schoonenberg et al. (2018).

Parameters:
  • OmegaK (array-like, (Nr,)) – Keplerian frequency

  • rho_dust (array-like, (Nr, Nm)) – Midplane dust volume density

  • rho_gas (array-like, (Nr,)) – Midplane gas volume density

  • Sigma_dust (array-like, (Nr, Nm)) – Dust surface density

  • St (array-like, (Nr, Nm)) – Stokes numbers

  • d2g_crit (float, optional, default: 1.) – Critical midplane dust-to-gas ratio above which planetesimal formation is triggered

  • zeta (float, optional, default: 0.1) – Planetesimal formation efficiency

Returns:

S – Dust source terms due to planetesimal formation

Return type:

array-like, (Nr, Nm)

Functions

drazkowska2016(OmegaK, rho_dust, rho_gas, ...)

Function calculates the dust source term due to planetesimal formation of Darzkowska et al. (2016).

miller2021(OmegaK, rho_dust, rho_gas, ...[, ...])

Function calculates the dust source term due to planetesimal formation of Miller et al. (2021).

schoonenberg2018(OmegaK, rho_dust, rho_gas, ...)

Function calculates the dust source term due to planetesimal formation of Schoonenberg et al. (2018).

dustpylib.radtrans Package

This package contains interfaces to radiative transfer codes from DustPy models.

dustpylib.radtrans.radmc3d Package

This package contains an interface to create RADMC-3D input files from DustPy models.

class dustpylib.radtrans.radmc3d.Model(sim, ignore_last=True)[source]

Main model class that can read in DustPy models and can create RADMC-3D input files. Attributes with trailing underscore are imported from DustPy, while the other attributes will be used to create RADMC-3D input files.

read_image :

Reads RADMC-3D image file

read_spectrum :

Reads RADMC_3d spectrum file

write_files :

Writes all required RADMC-3D input files into the specified directory

write_opacity_files :

Writes only the required RADMC-3D opacity into files into the specified directory

Attributes:
ac_grid

Particle size bin centers in cm for RADMC-3D model.

ai_grid

Particle size bin interfaces in cm for RADMC-3D model

phic_grid

Azimuthal grid cell centers in rad for RADMC-3D model.

phii_grid

Azimuthal grid cell interfaces in rad for RADMC-3D model.

rc_grid

Radial grid cell centers in cm for RADMC-3D model.

ri_grid

Radial grid cell interfaces in cm for RADMC-3D model.

thetac_grid

Polar grid cell centers in rad for RADMC-3D model.

thetai_grid

Polar grid cell interfaces in rad for RADMC-3D model.

Methods

write_files([datadir, write_opacities, ...])

Function writes all required RADMC-3D input files.

write_opacity_files([datadir, opacity, ...])

Function writes the required opacity files.

H_dust_

Dust scale heights array in cm from DustPy

M_star_

Stellar mass in g

R_star_

Stellar radius in cm

Sigma_dust_

Dust surface density profile in g/cm² from DustPy

T_gas_

Temperature profile in K from DustPy

T_star_

Stellar effective temperature in K

a_dust_

Particle size array in cm from DustPy

property ac_grid

Particle size bin centers in cm for RADMC-3D model. Do not set manually. Only use size bin interfaces.

property ai_grid

Particle size bin interfaces in cm for RADMC-3D model

datadir

Directory to store the RADMC-3D input files

lam_grid

Wavelength grid for RADMC-3D in cm

opacity

Opacity model. “birnstiel2018” (default) or “ricci2010”

property phic_grid

Azimuthal grid cell centers in rad for RADMC-3D model. Do not set manually. Only use cell interfaces.

property phii_grid

Azimuthal grid cell interfaces in rad for RADMC-3D model.

radmc3d_options

RADMC-3D options for radmc3d.inp file

property rc_grid

Radial grid cell centers in cm for RADMC-3D model. Do not set manually. Only use cell interfaces.

rc_grid_

Radial grid cell centers from DustPy model

property ri_grid

Radial grid cell interfaces in cm for RADMC-3D model.

ri_grid_

Radial grid cell interfaces from DustPy model

property thetac_grid

Polar grid cell centers in rad for RADMC-3D model. Do not set manually. Only use cell interfaces.

property thetai_grid

Polar grid cell interfaces in rad for RADMC-3D model.

write_files(datadir=None, write_opacities=True, opacity=None, smooth_opacities=False)[source]

Function writes all required RADMC-3D input files.

Parameters:
  • datadir (str, optional, default: None) – Data directory in which the files are written. None defaults to the datadir attribute of the parent class.

  • write_opacities (booelan, optional, default: True) – If False, does not compute nor write opacity files.

  • opacity (str, optional, default: None) – Opacity model to be used. Either ‘birnstiel2018’ or ‘ricci2010’. None defaults to ‘birnstiel2018’.

  • smooth_opacities (bool, optional, default: False) – Smooth the opacities by averaging over multiple particle sizes. This slows down the computation.

write_opacity_files(datadir=None, opacity=None, smooth_opacities=False)[source]

Function writes the required opacity files.

Parameters:
  • datadir (str, optional, default: None) – Data directory in which the files are written. None defaults to the datadir attribute of the parent class.

  • opacity (str, optional, default: None) – Opacity model to be used. Either ‘birnstiel2018’ or ‘ricci2010’. None defaults to ‘birnstiel2018’.

  • smooth_opacities (bool, optional, default: False) – Smooth the opacities by averaging over multiple particle sizes. This slows down the computation.

dustpylib.radtrans.radmc3d.read_image(path)[source]

This functions reads an image file created by RADMC-3D and returns a dictionary with the image data.

Parameters:

path (str) – Path to the image data file

Returns:

d – Dictionary with the image data

Return type:

dict

dustpylib.radtrans.radmc3d.read_model(datadir='')[source]

This functions reads the RADMC-3D model files and returns a namespace with the data. It should only be used for models created by DustPyLib. For more complex models use Radmc3dPy.

Parameters:

datadir (str, optional, default: "") – The path of the directory with the RADMC-3D input files

Returns:

data – Namespace with the model data

Return type:

namespace

dustpylib.radtrans.radmc3d.read_spectrum(path)[source]

This functions reads a spectrum file created by RADMC-3D and returns a dictionary with the SED data.

Parameters:

path (str) – Path to the spectrum data file

Returns:

d – Dictionary with the SED data

Return type:

dict

Functions

read_image(path)

This functions reads an image file created by RADMC-3D and returns a dictionary with the image data.

read_model([datadir])

This functions reads the RADMC-3D model files and returns a namespace with the data.

read_spectrum(path)

This functions reads a spectrum file created by RADMC-3D and returns a dictionary with the SED data.

Classes

Model(sim[, ignore_last])

Main model class that can read in DustPy models and can create RADMC-3D input files.

dustpylib.substructures Package

This package contains modules to create substructures in DustPy simulations.

dustpylib.substructures.gaps Package

This package contains extensions to create gaps in the disk profile.

dustpylib.substructures.gaps.duffell2020(r, a, q, h, alpha0)[source]

Function calculates the planetary gap profile according Duffell (2020).

Parameters:
  • r (array-like, (Nr,)) – Radial grid

  • a (float) – Semi-major axis of planet

  • q (float) – Planet-star mass ratio

  • h (float) – Aspect ratio at planet location

  • alpha0 (float) – Unperturbed alpha viscosity parameter

Returns:

f – Pertubation of surface density due to planet

Return type:

array-like, (Nr,)

dustpylib.substructures.gaps.kanagawa2017(r, a, q, h, alpha0)[source]

Function calculates the planetary gap profile according Kanagawa et al. (2017).

Parameters:
  • r (array-like, (Nr,)) – Radial grid

  • a (float) – Semi-major axis of planet

  • q (float) – Planet-star mass ratio

  • h (float) – Aspect ratio at planet location

  • alpha0 (float) – Unperturbed alpha viscosity parameter

Returns:

f – Pertubation of surface density due to planet

Return type:

array-like, (Nr,)

Functions

duffell2020(r, a, q, h, alpha0)

Function calculates the planetary gap profile according Duffell (2020).

kanagawa2017(r, a, q, h, alpha0)

Function calculates the planetary gap profile according Kanagawa et al. (2017).