Documentation

Submodules

Time integration

This submodule can be used to integrate in time new or already existing simulation.

diffenix.time_integration.new_simulation(consts_params: dict | None = None, directory_params: str | None = None) tuple[str, dict[str, Any]][source]

Add directories/files needed to save the new simulation

Parameters

consts_paramsdict, optional
The dictionary with all constantes and parameter for the simulation, default use the globals values defined in

Constantes.py

directory_paramsstr, optional

The path to a directory containing several .npz files for a given set of constants. The first non integrated set of constant will be used for this new simulation

Returns

tuple[str, dict[str, Any]]

the name of the new simulation’s directory the dictionary with all the constants

diffenix.time_integration.restart(number: int | str, tf: float64 = np.float64(100.0), save_time_step: float64 = np.float64(0.1), rtol: float64 | None = None, method: str | None = None, integrate_only_surface_density: bool = False) Sol[source]

Restart the simulation number

Parameters

numberint

The number of the simulation to be restarted

tf : np.float64, optional, default = 10 Myr

save_time_stepnp.float64, optional, default = 0.1 Myr

The time-steps to save the simulation

integrate_only_surface_densitybool, optional, default=False

To integrate only the evolution of surfaces densitys

Returns

Sol

The integrated solution

diffenix.time_integration.time_integration(tf: float64 = np.float64(100.0), save_time_step: float64 = np.float64(0.1), consts_params: dict | None = None, directory_params: str | None = None, integrate_only_surface_density: bool = False) Sol[source]

Build a new simulation and integrate it until tf

Parameters

tf : np.float64, optional, default = 10 Myr

save_time_stepnp.float64, optional, default = 0.1 Myr

The time-steps to save the simulation

consts_paramsdict, optional

The dictionary with all constantes and parameter for the simulation, default use the globals values defined in Constantes.py

directory_paramsstr, optional

The path to a directory containing several .npz files for a given set of constants. The first non integrated set of constant will be used for this new simulation

integrate_only_surface_densitybool, optional, default=False

To integrate only the evolution of surfaces densitys

Returns

Sol

The new simulation

Systems

All of the operations related to the gas evolution are mades in this submodule. The object Sol contain all the informations nedded to run the simulation and the results. It also have dedicated plot method that generate several Phenigraph Graphique that can be modified after by the user.

class diffenix.systems.Sol(filename: str = '', consts: dict | None = None, directory='', mdot_st: float64 = np.float64(1e-20), mus0: ndarray | None = None, mass_fracs0: ndarray | None = None, noms_mus0: ndarray[str] | None = None)[source]

Bases: object

The object contains all the information needed tu run and exploits a viscous diffusion simulation. It can be saved into a compressed .npz file. This object can generate phenigraph’s Graphique to analyze the results.

add_planets_to_graph(graph: Graphique, name_planets: list | ndarray | None = None, show: bool = False) None[source]

Add a gray-shaded area for each planet representing there influence zone (the zone where they accrete) to a given Graphique (assuming the x-axis is in code unit)

Parameters

graphg.Graphique

The Graphique to which represent the planets

name_planetslist[str] | np.ndarray[str], optional, default=None

A list with the planet’s name, if not None, the gray shaded area will be replaced by colored shaded area (one for each planet) and the label will be name_planets

showbool, default=False

To show the Graphique after the operation

Returns

None

calc_flux_radmc(temporal_size: int = 50, size_grid: int = 20, incl: float64 = 13, phi: float64 = 59.0) None[source]
calc_single_flux_radmc(i: int, directory: str | None = None, size_grid: int = 128, incl: float64 = 13, phi: float64 = 59.0) ndarray[float64][source]

Parameters

i: int

The index at which the surface density is plotted

directorystr, default=self.directory+’/’+i

The directory where the configuration are stored

size_gridint, default=128

The size of the spatial grid (the water surface density is interpolated on it)

Returns

np.ndarray[np.float64]

The spatially integrated luminosity flux

compteur: int = 0
constantes() dict[source]

All the constants needed for the integration

Returns

dictdict
A dictionary with all the constantes :
  • C_L : np.float64, 1/6371009 m -> au: length conversion factor

  • C_M : np.float64, 1/(5.9722*1e24) kg -> Mearth : mass conversion factor

  • C_t : np.float64, 1 / (3600 * 24 * 365.25 * 1e6) : s-> 1 Myr : time conversion factor

  • Ts : np.float64, Surface temperature of the central star

  • Ms : np.float64, Mass of the central star

  • Rs : np.float64, Radius of the central star

  • Ls : np.float64, Luminosity of the central star

  • a_in : np.float64, Inner radius of the integration domain

  • a0 : np.float64,

  • a_out : np.float64, Outer radius of the integration domain

  • T0 : np.float64, Temperature at a0

  • mH_init : np.float64, The initial hydrogen mass

  • AB_mdot_st_init : np.float64, The gas mass generation rate that generate the initial steady state

  • AB_Mbelt : np.float64, Asteroid belt’s size

  • AB_Abelt : np.float64, Asteroids albedo

  • AB_a0 : np.float64, Asteroid belt’s central radius

  • AB_delta_r : np.float64, Half of asteroid belt size

  • AB_K : np.float64, Thermal diffusion coefficient in asteroids

  • AB_Phi : np.float64, Porosity

  • AB_rp : np.float64, Asteroid’s pore radius

  • AB_f_ice : np.float64, Ice to total mass ratio

  • AB_rho_refr : np.float64, Refractory’s materials density in asteroids

  • AB_rho_ice : np.float64 Ice density

  • AB_sublimation_model : str, {“none”, “thermal_full”, “constant_rate”} The model use to estimate

the gas generation rate for the asteroid belt :
  • none : No gas is produced

  • thermal_full : the gas is produced by sublimation : all sublimation, thermal diffusion and molecular

diffusion are take into acompte

  • constant_rate : The gas is produced at a constant rate of const_mdot

  • AB_const_mdot : np.float64, The gass mass generation rate for a constant_rate sublimation model

  • AB_SD_amax : np.double, Maximum size of asteroids

  • AB_SD_abig : np.double, Intermediate size

  • AB_SD_amed : np.double, Medium size for size distribution

  • AB_SD_amin : np.double, Minimal size

  • AB_SD_qh : np.double, Power slope of the distribution between abig and amax

  • AB_SD_qm : np.double, Power slope of the distribution between amed and abig

  • AB_SD_ql : np.double, Power slope of the distribution between amin and amed

  • AB_s_min: np.float64 = np.double(316) * C_L # Minimum size for collision model

  • AB_sb: np.float64 = np.double(316) * C_L # Intermediate size for collision model

  • AB_s_max: np.float64 = np.double(316) * C_L # Maximum size for collision model

  • AB_e: np.float64 = np.double(0.075) # Eccentricity

  • AB_i: np.float64 = AB_e / np.double(2.) # Inclination

  • AB_As: np.float64 = np.double(5.) * C_E / C_M # Massique energy to disrupt the asteroids

  • AB_bs: np.float64 = np.double(-0.1)

  • AB_bg: np.float64 = np.double(0.5)

  • AB_t0_diss: np.float64 = 10 * Gyr # Belt’s lifetime before dissipation

  • AB_t1_diss: np.float64 = 10 * Gyr # Dissipation timescale

  • KB_mdot_st_init : np.float64, The gas mass generation rate that generate the initial steady state

  • KB_Mbelt : np.float64, Kuiper belt’s mass

  • KB_Abelt : np.float64, KBO’s albedo

  • KB_a0 : np.float64, Kuiper belt central radius

  • KB_delta_r : np.float64, Half of Kuiper belt size

  • KB_K : np.float64, Thermal diffusion coefficient in KBO

  • KB_Phi : np.float64, KBO’s porosity

  • KB_rp : np.float64, KBO’s pore’s radius

  • KB_f_ice : np.float64, Initial ice to total mass ratio in KBO

  • KB_rho_refr : np.float64, Refractory’s materials density in KBO

  • KB_rho_ice : np.float64, Ice density

  • KB_sublimation_model : str, {“none”, “thermal_full”, “constant_rate”} The model use to estimate the

gas generation rate for the Kuiper belt:
  • none : No gas is produced

  • thermal_full : the gas is produced by sublimation : all sublimation, thermal diffusion and molecular

diffusion are take into acompte

  • constant_rate : The gas is produced at a constant rate of const_mdot

  • KB_const_mdot : np.float64, The gass mass generation rate for a constant_rate sublimation model

  • KB_SD_amax : np.double, Maximum size of KBO

  • KB_SD_abig : np.double, Intermediate size

  • KB_SD_amed : np.double, Medium size

  • KB_SD_amin : np.double, Minimal size

  • KB_SD_qh : np.double, Power slope of the distribution between abig and amax

  • KB_SD_qm : np.double, Power slope of the distribution between amed and abig

  • KB_SD_ql : np.double, Power slope of the distribution between amin and amed

  • KB_s_min: np.float64 = np.double(316) * C_L # Minimum size for collision model

  • KB_sb: np.float64 = np.double(316) * C_L # Intermediate size for collision model

  • KB_s_max: np.float64 = np.double(316) * C_L # Maximum size for collision model

  • KB_e: np.float64 = np.double(0.075) # Eccentricity

  • KB_i: np.float64 = KB_e / np.double(2.) # Inclination

  • KB_As: np.float64 = np.double(5.) * C_E / C_M # Massique energy to disrupt the asteroids

  • KB_bs: np.float64 = np.double(-0.1)

  • KB_bg: np.float64 = np.double(0.5)

  • KB_t0_diss: np.float64 = 10 * Gyr # Belt’s lifetime before dissipation

  • KB_t1_diss: np.float64 = 10 * Gyr # Dissipation timescale

  • a_planet : list[np.double], planet’s semi-major axis

  • m_planet : list[np.double], planet’s masses

  • f_accr : np.float64, Hydrodynamic accretion efficiency

  • t0 : The dissipation time of the protoplanetary disc

  • IT_s : int, number of spatial steps

  • dip : int, half of the number of sink cells for a given planets to model the accretion

  • rtol : np.float64, Relative tolerance for temporal integration

  • atolnp.float64, Absolute tolerance for temporal integration (by default too small hence to

    relative tolerance will always be the limiting factor)

  • method_root : str, ‘LSODA’,’BDF’,’DOP853’,’RK45’ : Temporal integration method_root

get_final_mass_fractions(y: ndarray, tps: float64, step: int = 1, x: float64 | None = None) ndarray[source]

Transform the result get by solve_ivp for the integration of the mass fractions to the format of self.sigmas

Parameters

ynp.ndarray

result of solve_ivp

tpsnp.ndarray

times associated with y

stepint, optional, default=

Only the tps[::step] will be saved

xnp.ndarray, optional, default: self.x

The radial coordinate

Returns

None

get_final_surface_densitys(y: ndarray, tps: ndarray, step: int = 1) None[source]

Save into this Sol the result of a temporal integration contain in ys. This save a fraction of y in self.f (fraction given by step) and calculate some test variable such as the flux at the planets levels or the variables needed to calculate the mass conservation (inner and outer flux, total mass produced…)

Parameters

ynp.ndarray

result of solve_ivp = sigma * (r ** (2 + pls_temp))

tpsnp.ndarray

times associated with y

stepint, optional, default=

Only the tps[::step] will be saved

Returns

None

graph_image_surface_density(species: int | ndarray | list[int] = 9223372036854775807, plot_sigma_crit: bool = True, vmin: float64 | str = np.float64(1e-10), vmax: float64 | str | None = None, size_time: int = 500, size_radius: int = 1000, color_sigma_crit_h2o: str | tuple = 'w', color_sigma_crit_co: str | tuple = 'g', cmap: str = 'inferno', nb_levels: int = 10, color_min: str | tuple | None = None, color_max: str | tuple | None = None, plot_planets: bool = True, planets_names: list[str] | None = None, show: bool = True, save: bool = False, directory: str | None = None, plot_label_levels: bool = True, **kwargs_ax) Graphique[source]

Build a Graphique that represant the evolution of surface density as function of time and radius

Parameters

speciesstr | int, optional

The specie for which the surface density is represanted, default the total surface density is represanted

plot_sigma_critbool, optional, default = True

To plot a specific level line at the critical surface density

vminnp.float64 | str , optional, {“auto”, np.loat64}, default = 1e-10 * Mearth / Myr

The minimum value of surface density to represant in the result (below it will be considered as saturated) If “auto”, the minimal value will be the minimal value of the surface density represanted

vmaxnp.float64 | str, optional, {“auto”, np.loat64},

The maximum value of surface density to represant in the result (above it will be considered as saturated) Default, v_max is not considered like for “auto” where the maximal value will be the maximal value of the surface density represanted

size_timeint, optional, default=1000

The image’s size for the time coordinate (x-axis)

size_radiusint, optional, default=1000

The image’s size for the radius coordinate (y-axis)

color_sigma_crit_h2ostr, optional, default = “w”

The color of the level line associated with the critical surface density of water

color_sigma_crit_costr, optional, default = “g”

The color of the level line associated with the critical surface density of CO

cmapstr, optional, default = “inferno”

The colormap used for the image

nb_levelsint, optional, default=10
The number of levels in the image

The number of levels to plot in addition to the image

color_minstr | tuple, optional

The color associated with the minimum value for a default cmap

color_maxstr | tuple, optional

The color associated with the maximum value for a default cmap

plot_planetsbool, optional, default = True

Whether or not to plot a grey shaded era that delimitate the planet’s sink cell’s era

planets_nameslist[str], optional

A list of names for the planets to write close to the grey shadeds eras

plot_label_levelsbool, optional, default=False

To plot (or not) labels for the contours (if True, labels are only plot every two levels)

showbool, optional, default = True

Whether to show the image

savebool, optional, default = False

Whether to save the image (if True, both the Graphique and the png image will be saved)

directorystr, optional

The directory to save the Graphique, default=self.directory

Returns

g.Graphique

graph_surface_density(times: ndarray | None = None, idx: ndarray | None = None, species: int | ndarray | list[int] = 9223372036854775807, plot_mean_volumique_density: bool = False, include_last_index: bool = False, plot_sigma_crit: bool = True, name_planets: ndarray[str] | list[str] | None = None, show: bool = True, save: bool = False, directory: str | None = None, lw: float64 = 2.0, **args_ax) Graphique[source]

Create a Graphique of surface density as a function of radius for different time for given species

Parameters

timesnp.ndarray, optional,

table of the times we want to show the surface density. If None and idx is None, an arbitrary subset of self.tps will be taken

idxnp.ndarray, optional

index table of self.tps we want to show the surface density. If None, an arbitrary subset of self.tps will be taken

speciesint | str | np.ndarray | list[int] | list[str], optional, default: plot all species

the species we want to show (if -1 plot the total surface density), if < number of species plot the species associated with self.mu[species] else plot all the species if str, the specie associated with this name is plotted

plot_mean_volumique_densitybool, optional, default=False

If True plot the volumique density instead of the surface density

include_last_indexbool, optional, default=False

Systematically include the last surface density (even if self.tps[-1] is not in time)

plot_sigma_critbool, optional, default=True

To plot a line at the critical surface density to shield the main molecule

name_planets

The planet’s names. If not None (default), plot a vertical line at the planet’s positions

showbool, optional, default=True

To show the Graphique before returning it

savebool, optional, default=False

To save the Graphique

directorystr, optional, default=self.directory

The directory of the Graphique

lwint, optional, default=2

The line-weight of surface density

args_axdict

additional keywords argument for the generation of the axis associated with the graphique (ex

x_lim=[1,100])

Returns

g.Graphique

the requested Graphique

graphs(plot_planets=True, planets_names: list[str] | None = None, show: bool = True, save: bool = False, directory: str | None = None) list[Graphique][source]
graphs_accretion(name_planets: list[str] | ndarray[str] | None = None, show: bool = False, directory: str | None = None, save: bool = False, times: ndarray[float64] | None = None, absolute: bool = False, include_last_index: bool = True) list[Graphique][source]
initialization(mus0: ndarray, mass_fracs0: ndarray, nom_mus0) None[source]

Initialize the solution with a steady state of the first element generated by a 10**-10 Mearth/Myr gas generation rate The radii are linearly spaced between a_min and a_max with IT_s points

Returns

None

interp_sigma(t: float64) float64 | ndarray[float64][source]

Return surface density

Parameters

iint, optional

The index at wich calculate sigma

Returns

np.float64 | np.ndarray

mass_conservation() ndarray[source]

Calculate the mass conservation in the whole system

Returns

np.ndarray

An array fo size self.diag[“time”], equal to zero only if the mass is conserved

mass_flux(i: int | ndarray = 9223372036854775807) ndarray[source]

The mass flux for the temporal index(s) i of tps/f

Parameters

iint | np.ndarray, optional, default: the radial speed is calculated for every index

The temporal index(s) from which calculate the radial speed

Returns

np.ndarray

The mass flux

momentum_conservation() ndarray[source]

Calculate the momentum conservation in the whole system

Returns

np.ndarray

An array fo size self.diag[“time”], equal to zero only if the mass is conserved

radial_speed(i: int | ndarray = 9223372036854775807) ndarray[source]

The radial speed for the temporal index(s) i of tps/f

Parameters

iint | np.ndarray, optional, default: the radial speed is calculated for every index

The temporal index(s) from which calculate the radial speed

Returns

np.ndarray

The radial speed

radmc_setup(i: int, directory: str | None = None, size_grid: int = 128) None[source]

Generate the configuration file for radmc3d for the surface density at time self.tps[i]

Parameters

i: int

The index at which the surface density is plotted

directorystr, default=self.directory+’/’+i

The directory where the configuration are stored

size_gridint, default=128

THe size of the spatial grid (the water surface density is interpolated on it)

Returns

None

save(filename: str = '', directory: str = './') None[source]

Save the object in the compressed format .npz

Parameters

filenamestr, optional, default=self.filename

The name of the .npz file

directorystr, optional, default=self.filename

The name of the directory of the .npz file. If there is any “/” in filename, then it will be assumed that filename contains the whole path to the file and directory will be ignored

Returns

None

sigma(i: int = 9223372036854775807) float64 | ndarray[float64][source]

Return surface density

Parameters

iint, optional

The index at wich calculate sigma

Returns

np.float64 | np.ndarray

split_y(y: ndarray) ndarray[source]

Split y the argument of the time integration system in n lists, n the number of chemical elements

Parameters

ynp.ndarray

The array to be reshaped

Returns

np.ndarray

masses_fractions(y)

time_integration(tf: float64, dtmax: float64 = np.float64(inf), build_graphs: bool = False, integrate_only_surface_density: bool = False) None[source]

Time integration of surface density and mass fraction until tf The surface density is integrated first Steps of 0.3 Myr are made to save the result

Parameters

tfnp.float64

The final integration time

dtmaxnp.float64, optional, default=the maximum timestep to keep a stable spatial integration of surface
density

The maximum timestep

build_graphsbool, optional, default=True

To build and save surface density and accretions Graphiques

integrate_only_surface_densitybool, optional, default=False

To integrate only the evolution of surfaces densitys

Returns

None

total_mass() ndarray[source]

Calculate the total mass as a function of time

Returns

turbulent_speed(i: int | ndarray = 9223372036854775807) ndarray[source]

The turbulent speed for the temporal index(s) i of mass_fractions

Parameters

iint | np.ndarray, optional, default:the turbulence speed is calculated for every index

The temporal index(s) from which calculate the radial speed

Returns

np.ndarray

The turbulent speeds

update_constantes(dic: dict) None[source]

Update all the constants needed for the integration

Parameters

dic: dict
A dictionary with all the constantes :
  • C_L : np.float64, 1/6371009 m -> au: length conversion factor

  • C_M : np.float64, 1/(5.9722*1e24) kg -> Mearth : mass conversion factor

  • C_t : np.float64, 1 / (3600 * 24 * 365.25 * 1e6) : s-> 1 Myr : time conversion factor

  • Ts : np.float64, Surface temperature of the central star

  • Ms : np.float64, Mass of the central star

  • Rs : np.float64, Radius of the central star

  • Ls : np.float64, Luminosity of the central star

  • a_in : np.float64, Inner radius of the integration domain

  • a0 : np.float64,

  • a_out : np.float64, Outer radius of the integration domain

  • T0 : np.float64, Temperature at a0

  • mH_init : np.float64, The initial hydrogen mass

  • AB_mdot_st_init : np.float64, The gas mass generation rate that generate the initial steady state

  • AB_Mbelt : np.float64, Asteroid belt’s size

  • AB_Abelt : np.float64, Asteroids albedo

  • AB_a0 : np.float64, Asteroid belt’s central radius

  • AB_delta_r : np.float64, Half of asteroid belt size

  • AB_K : np.float64, Thermal diffusion coefficient in asteroids

  • AB_Phi : np.float64, Porosity

  • AB_rp : np.float64, Asteroid’s pore radius

  • AB_f_ice : np.float64, Ice to total mass ratio

  • AB_rho_refr : np.float64, Refractory’s materials density in asteroids

  • AB_rho_ice : np.float64 Ice density

  • AB_sublimation_model : str, {“none”, “thermal_full”, “constant_rate”} The model use to estimate

the gas generation rate for the asteroid belt :
  • none : No gas is produced

  • thermal_full : the gas is produced by sublimation : all sublimation, thermal diffusion and molecular

diffusion are take into acompte

  • constant_rate : The gas is produced at a constant rate of const_mdot

  • AB_const_mdot : np.float64, The gass mass generation rate for a constant_rate sublimation model

  • AB_SD_amax : np.double, Maximum size of asteroids

  • AB_SD_abig : np.double, Intermediate size

  • AB_SD_amed : np.double, Medium size for size distribution

  • AB_SD_amin : np.double, Minimal size

  • AB_SD_qh : np.double, Power slope of the distribution between abig and amax

  • AB_SD_qm : np.double, Power slope of the distribution between amed and abig

  • AB_SD_ql : np.double, Power slope of the distribution between amin and amed

  • AB_s_min: np.float64 = np.double(316) * C_L # Minimum size for collision model

  • AB_sb: np.float64 = np.double(316) * C_L # Intermediate size for collision model

  • AB_s_max: np.float64 = np.double(316) * C_L # Maximum size for collision model

  • AB_e: np.float64 = np.double(0.075) # Eccentricity

  • AB_i: np.float64 = AB_e / np.double(2.) # Inclination

  • AB_As: np.float64 = np.double(5.) * C_E / C_M # Massique energy to disrupt the asteroids

  • AB_bs: np.float64 = np.double(-0.1)

  • AB_bg: np.float64 = np.double(0.5)

  • AB_t0_diss: np.float64 = 10 * Gyr # Belt’s lifetime before dissipation

  • AB_t1_diss: np.float64 = 10 * Gyr # Dissipation timescale

  • KB_mdot_st_init : np.float64, The gas mass generation rate that generate the initial steady state

  • KB_Mbelt : np.float64, Kuiper belt’s mass

  • KB_Abelt : np.float64, KBO’s albedo

  • KB_a0 : np.float64, Kuiper belt central radius

  • KB_delta_r : np.float64, Half of Kuiper belt size

  • KB_K : np.float64, Thermal diffusion coefficient in KBO

  • KB_Phi : np.float64, KBO’s porosity

  • KB_rp : np.float64, KBO’s pore’s radius

  • KB_f_ice : np.float64, Initial ice to total mass ratio in KBO

  • KB_rho_refr : np.float64, Refractory’s materials density in KBO

  • KB_rho_ice : np.float64, Ice density

  • KB_sublimation_model : str, {“none”, “thermal_full”, “constant_rate”} The model use to estimate the

gas generation rate for the Kuiper belt:
  • none : No gas is produced

  • thermal_full : the gas is produced by sublimation : all sublimation, thermal diffusion and molecular

diffusion are take into acompte

  • constant_rate : The gas is produced at a constant rate of const_mdot

  • KB_const_mdot : np.float64, The gass mass generation rate for a constant_rate sublimation model

  • KB_SD_amax : np.double, Maximum size of KBO

  • KB_SD_abig : np.double, Intermediate size

  • KB_SD_amed : np.double, Medium size

  • KB_SD_amin : np.double, Minimal size

  • KB_SD_qh : np.double, Power slope of the distribution between abig and amax

  • KB_SD_qm : np.double, Power slope of the distribution between amed and abig

  • KB_SD_ql : np.double, Power slope of the distribution between amin and amed

  • KB_s_min: np.float64 = np.double(316) * C_L # Minimum size for collision model

  • KB_sb: np.float64 = np.double(316) * C_L # Intermediate size for collision model

  • KB_s_max: np.float64 = np.double(316) * C_L # Maximum size for collision model

  • KB_e: np.float64 = np.double(0.075) # Eccentricity

  • KB_i: np.float64 = KB_e / np.double(2.) # Inclination

  • KB_As: np.float64 = np.double(5.) * C_E / C_M # Massique energy to disrupt the asteroids

  • KB_bs: np.float64 = np.double(-0.1)

  • KB_bg: np.float64 = np.double(0.5)

  • KB_t0_diss: np.float64 = 10 * Gyr # Belt’s lifetime before dissipation

  • KB_t1_diss: np.float64 = 10 * Gyr # Dissipation timescale

  • a_planet : list[np.double], planet’s semi-major axis

  • m_planet : list[np.double], planet’s masses

  • f_accr : np.float64, Hydrodynamic accretion efficiency

  • t0 : The dissipation time of the protoplanetary disc

  • IT_s : int, number of spatial steps

  • dip : int, half of the number of sink cells for a given planets to model the accretion

  • rtol : np.float64, Relative tolerance for temporal integration

  • atolnp.float64, Absolute tolerance for temporal integration (by default too small hence to

    relative tolerance will always be the limiting factor)

  • method_root : str, ‘LSODA’,’BDF’,’DOP853’,’RK45’ : Temporal integration method_root

Returns

None

y(i: int) ndarray[source]

Return the masses fractions flatten into a one dimensional array for a given time (argument of the time integration system)

Parameters

iint

The index to which return the mass fraction

Returns

diffenix.systems.T(r: ndarray | float64, t: float64 = -1, Ms: float64 = np.float64(332942.6342051505)) ndarray | float64[source]

Calculate and return the temperature at radius r

Parameters

rnp.ndarray

radius

tnp.ndarray

The current time

Returns

np.ndarray | np.float

The temperature

diffenix.systems.T0(t: float64 = -1, a0: float64 = np.float64(2.6499999999999995), Ms: float64 = np.float64(332942.6342051505)) ndarray | float64[source]

Calculate and return the temperature at a0

Parameters

tnp.ndarray

The current time

a0np.float64

The distance to the central star at wich the temperature is calculated

Msnp.float64

The mass of the central star

Returns

np.ndarray | np.float

The temperature

diffenix.systems.boundary_conditions(ys: ndarray, sol: Sol) ndarray[source]

Define the inner and outer boundary conditions for the surface density

Parameters

ysnp.ndarray

log of surface density

Nunp.ndarray

Viscosity

solSol

Associated Sol

Returns

np.ndarray

diffenix.systems.boundary_conditions_mf(ys: ndarray, sol: Sol) ndarray[source]

Define the inner and outer boundary conditions for the mass fractions

Parameters

ysnp.ndarray

Mass fractions

Nunp.ndarray

Viscosity

solSol

Associated Sol

Returns

np.ndarray

diffenix.systems.mass_flux(sol: Sol, ys: ndarray, t: float64) ndarray[source]

Calculate the total mass flux for a given sigma, sol and m_out

Parameters

solSol

Associated Sol

ysnp.ndarray

sigma * r ** (2 + pls_temp)

tnp.float64

time

Returns

np.ndarray

the radial speed

diffenix.systems.mass_frac_dot(t: float64, ys: ndarray, sol: Sol) ndarray[source]

Calculate the gas generation and destruction rate relatively to each species, The accretion onto planet is not expected to have any influence onto the mass fraction

Parameters

tnp.float64

the current time

ysnp.ndarray

The mass fractions shape=(n_species, len(self.r))

solSol

Object Sol associated with the resolution

Returns

np.ndarray

diffenix.systems.mass_steady_state(sol: Sol, mdot: float64 | None = None, a0: float64 | None = None, mu: float64 | None = None) float64[source]

Return the mass of a steady state disc where gas is produced at radius a0 with a mass generation rate mdot

Parameters

solSol

The associated Sol

mdotnp.float64

Mass input rate at a0, if mtot is not None, this parameter is ignored

a0np.float64, optional, default=sol.a0

The radius at wich the gas is produced

munp.float64

Mean molar mass, default sol.mu.mean()

Returns

np.ndarray

the surface density of the steady state

diffenix.systems.merge_y(y: ndarray) ndarray[source]

Do the inverse operation of split_y

Parameters

ynp.ndarray

The array to be reshaped

Returns

np.ndarray

The new array

diffenix.systems.new_space_grid(old_grid: ndarray[float64], last_masse_frac: ndarray[float64]) ndarray[float64][source]
diffenix.systems.radial_speed(sol: Sol, ys: ndarray, t: float64) ndarray[source]

Calculate the radial speed for a given sigma, sol and m_out

Parameters

solSol

Associated Sol

ysnp.ndarray

sigma * r ** (2 + pls_temp)

tnp.float64

time

Returns

np.ndarray

the radial speed

diffenix.systems.sigma_dot(t: float64, ys: ndarray, phi: ndarray, sol: Sol) ndarray[source]

Calculate the gas generation and destruction rate

Parameters

tnp.float64

the current time

ysnp.ndarray

sigma * (r**(2 + alpha_t))

phinp.ndarray

mass flux

solSol

Object Sol associated with the resolution

Returns

np.ndarray

sigma_dot

diffenix.systems.split_y(y: ndarray, len_radius: int, nb_species: int) ndarray[source]

Split y the argument of the time integration system in n lists, n the number of chemical elements

Parameters

ynp.ndarray

The array to be reshaped

len_radiusint

The lenght of the radius array

nb_speciesint

The number of chemicals species

Returns

np.ndarray

masses_fractions(y)

diffenix.systems.steady_state(sol: Sol, mdot: float64 | None = None, mtot: float64 | None = None, a0: float64 | None = None, mu: float64 | None = None)[source]

Return the log of steady state for a given mdot

Parameters

solSol

The associated Sol

mdotnp.float64

Mass input rate at a0, if mtot is not None, this parameter is ignored

mtotnp.float64, optional

The disc’s total mass,

a0np.float64, optional, default=sol.a0

The radius at wich the gas is produced

munp.float64

Mean molar mass, default sol.mu.mean()

Returns

np.ndarray

the surface density of the steady state

diffenix.systems.system_mass_fraction(t: float64, y: array, sol: Sol, verbose: bool = True) ndarray[source]

Define the system to integrate in time to get the evolution of mass fractions, the spatial differentiation is made here to estimate the spatial derivatives

Parameters

tnp.float64

The current time

ynp.ndarray

The one dimensional array of mass fractions (shape=(n_species*len(self.r)))

solSol

The associated Sol

verbosebool, optional, default=True

To print some information

Returns

np.ndarray

d(log(sigma)/dt

diffenix.systems.system_sigma_tot(t: float64, y: array, sol: Sol, verbose: bool = True) ndarray[source]

Define the system to integrate in time to get the evolution of surface density. The spatial differentiation is made here to estimate the spatial derivatives

Parameters

tnp.float64

The current time

ynp.ndarray

The log of surface density

solSol

The associated Sol

verbosebool

To print some information

Returns

np.ndarray

d(log(sigma)/dt

diffenix.systems.turbulent_speed(y: ndarray, sol: Sol, t: float64) ndarray[source]

Calculate the turbulent speed for a given sigma, sol and m_out

Parameters

ynp.ndarray

mass fractions at time t

solSol

Associated Sol

tnp.float64

time

Returns

np.ndarray

the radial speed

Solve asteroid belt

All of the operations related to the gas prodcution rate are made in this submodule. The Sol_ast_belt object is used by the Sol object of the system module to estimate the gas production rate

class diffenix.solve_asteroid_belt.Compteur[source]

Bases: object

This object can be used to estimate the number of calls for a function if given in parameter and incremented in the function (mutable object)

class diffenix.solve_asteroid_belt.SolrhoBelt(sublimation_model: str, Mbelt: float64, Ms: float64, a0: float64, delta_a: float64, tinit: float64, tmax: float64, rho_refr: float64, rho_ice: float64, f_ice: float64, A_ast: float64, K: float64, Its: int, Phi: float64, dmin: float64, sb: float64, dmax: float64, e: float64, i: float64, As: float64, bs: float64, bg: float64, Its_p: int, rp: float64, Itt: int, t0_diss: float64, t1_diss: float64, radius: ndarray[float64] | None = None, kwargs_N: dict | None = None, sig_dots: ndarray | None = None, tps: ndarray | None = None, m_init: float64 = np.float64(0.0), const_mdot: float64 = np.float64(0.0), **kwargs)[source]

Bases: object

const(prefix: str = '') dict[source]
graph_image_surface_density(vmin: float64 | str = np.float64(1.0000000000000003e-10), vmax: float64 | str | None = None, size_time: int = 500, size_radius: int = 1000, cmap: str = 'inferno', nb_levels: int = 10, color_min: str | tuple | None = None, color_max: str | tuple | None = None, show: bool = True, save: bool = False, directory: str | None = None, plot_label_levels: bool = True, **kwargs_ax) Graphique[source]
Build a Graphique that represant the evolution of surface density generation rate

as function of time and radius

Parameters

vminnp.float64 | str , optional, {“auto”, np.loat64}, default = 1e-10 * Mearth / Myr

The minimum value of surface density to represant in the result (below it will be considered as saturated) If “auto”, the minimal value will be the minimal value of the surface density represanted

vmaxnp.float64 | str, optional, {“auto”, np.loat64},

The maximum value of surface density to represant in the result (above it will be considered as saturated) Default, v_max is not considered like for “auto” where the maximal value will be the maximal value of the surface density represanted

size_timeint, optional, default=1000

The image’s size for the time coordinate (x-axis)

size_radiusint, optional, default=1000

The image’s size for the radius coordinate (y-axis)

cmapstr, optional, default = “inferno”

The colormap used for the image

nb_levelsint, optional, default=10
The number of levels in the image

The number of levels to plot in addition to the image

color_minstr | tuple, optional

The color associated with the minimum value for a default cmap

color_maxstr | tuple, optional

The color associated with the maximum value for a default cmap

plot_label_levelsbool, optional, default=False

To plot (or not) labels for the contours (if True, labels are only plot every two levels)

showbool, optional, default = True

Whether to show the image

savebool, optional, default = False

Whether to save the image (if True, both the Graphique and the png image will be saved)

directorystr, optional

The directory to save the Graphique, default=self.directory

Returns

g.Graphique

return_kwargsN(prefix: str = '') dict[source]
diffenix.solve_asteroid_belt.linear_interp(t_new, t_old, values)[source]
diffenix.solve_asteroid_belt.mbelt_coll(t: float64, smin: float64 = np.float64(6.684587122268445e-20), smax: float64 = np.float64(2.673834848907378e-05), sb: float64 = np.float64(2.1123295306368286e-09), qp: float64 = np.float64(3.0), qs: float64 = np.float64(1.8333333333333333), qg: float64 = np.float64(1.67), e: float64 = np.float64(0.075), i: float64 | None = None, r: float64 | None = None, dr: float64 = np.float64(3.9999999999999996), As: float64 = np.float64(222498.51379990004), bs: float64 = np.float64(-0.1), bg: float64 = np.float64(0.5), M0: float64 = np.float64(0.01), Ms: float64 = np.float64(332942.6342051505), rho_ast: float64 = np.float64(1401463855786.2883), method_root: str = 'lm', st_est: float64 | ndarray | None = None) float64 | ndarray[source]

Estimate the masse of a collisional belt as function of time (formula 38 of Löhne et al. 2008)

Parameters

tnp.float64

The time

sminnp.float64

Minimum size of bodys

smaxnp.float64

Maximum size of bodys

sbnp.float64

Medium size

qpnp.float64

Primordial slope as defined in Löhne et al. 2008

qsnp.float64

Intermediate slope

qgnp.float64

Slope for bodys in collisional regim

enp.float64

Eccentricity

inp.float64

Inclination

rnp.float64

Distance of the center of the belt to the central star

drnp.float64

Radial extension of the belt

Asnp.float64

Minimal disruption energy (see formula 1 of Löhne et al. 2008)

bsnp.float64

Slope of the massique disruption energy (see formula 1 of Löhne et al 2008)

bgnp.float64

Slope of the massique disruption energy (see formula 1 of Löhne et al. 2008)

M0np.float64

Initial belt’s mass

Msnp.float64

Central star’s mass

rho_astnp.float64

Density of asteroids/KBO

method_rootstr, optional, default=”lm”

The method for the root-finding routine used to find st the size such as tau(st)=t

st_estnp.float64

Estimation of st

Returns

np.float64 | np.ndarray

mbelt

References

Löhne et al. 2008

diffenix.solve_asteroid_belt.mdot_s(s: float64, t: ndarray, r: ndarray, consts: dict, It_d=300) ndarray[source]

Compute the gas mass generation rate for a given bodie at differents radius

Parameters

s: np.float64

The size of the considered bodie

t: np.ndarray

The time at which evaluate the gas mass generation rate

r: np.ndarray

The distances from the central star at which evaluate the gas mass generation rate

constsdict

The dictionary of constants

It_dint

The number of iterations

Returns

np.ndarray

the gas mass generation rate as function of time and radius

diffenix.solve_asteroid_belt.mdot_s_l(rd: ndarray, t: ndarray, temp: ndarray, consts: dict) ndarray[source]

Compute the gas mass generation for a given bodie

Parameters

rdnp.ndarray

The radial coordinates inside the asteroid / KBO

tnp.ndarray

The time

tempnp.ndarray

The array of temperature as function of rd and t calculated by thermal_diff

consts: dict

The dictionary of constants

Returns

np.ndarray

the gas mass generation rate as function of time

diffenix.solve_asteroid_belt.mdot_s_surf(s: float64, t: ndarray, r: ndarray, consts: dict, It_d=300) ndarray[source]

Compute the gas mass generation rate for a given bodies at differents radius if the gas sublimate only at its surface

Parameters

s: np.float64

The size of the considered bodie

t: np.ndarray

The time at which evaluate the gas mass generation rate

r: np.ndarray

The distances from the central star at which evaluate the gas mass generation rate

constsdict

The dictionary of constants

It_dint

The number of iterations

Returns

np.ndarray

the gas mass generation rate as function of time and radius

diffenix.solve_asteroid_belt.mdot_s_vol(s: float64, t: ndarray, r: ndarray, consts: dict, It_d=300) ndarray[source]

Compute the gas mass generation rate for a given bodies at differents radius if the gas sublimate in the whole volume neglecting thermal diffusion

Parameters

s: np.float64

The size of the considered bodie

t: np.ndarray

The time at which evaluate the gas mass generation rate

r: np.ndarray

The distances from the central star at which evaluate the gas mass generation rate

constsdict

The dictionary of constants

It_dint

The number of iterations

Returns

np.ndarray

the gas mass generation rate as function of time and radius

diffenix.solve_asteroid_belt.minit(r: ndarray, pinit: float64, rho_ice: float64, a0: float64, delta_a: float64, Mbelt: float64, kwargsN) float64[source]
diffenix.solve_asteroid_belt.number_density(a, amax: float64, abig: float64, amed: float64, amin: float64, qh: float64, qm: float64, ql: float64, Mtot: float64 = np.float64(1.0), rho: float64 = np.float64(1.0)) float64 | ndarray[source]

Return the number density of asteroid of size a

Parameters

anp.float64 | np.ndarray

The diameter(s) of asteroids

amaxnp.float64

The maximum diameter

abignp.float64

A reference diameter

amed : np.float64

aminnp.float64

The minimum diameter

qhnp.float64

The slope of distribution for the highest radius

qmnp.float64

The slope of distribution for medium seized asteroids

qlnp.float64

The slope of distribution for the smallest asteroids

Mtotnp.float64, optional, default=1

The total mass of the belt. The result is directly proportional to Mtot. number_density(Mtot)=Mtot*number_density(1.). It can be used to estimate the number density in a belt = sigma*number_density(1.) with sigma the surface density

rhonp.float64

The mean density of asteroids

Returns

np.float64 | np.ndarray

The number density of asteroids for diameter(s) a

diffenix.solve_asteroid_belt.sig_dot_full_diff(tps: ndarray, r: ndarray, const: dict, kwargsN: dict | None = None, It_d: int = 100) ndarray[source]

Compute the gas surface density generation rate for a belt discribed into the const dictionary

Parameters

tpsnp.ndarray

The time at which evaluate the result

rnp.ndarray

The distance to the central star at which evaluate the solution

constdict

The dictionary of constants

kwargsNdict

The dictionary that defined the size distribution

It_dint

The number of depth steps for thermal diffusion integration

Returns

np.ndarray

diffenix.solve_asteroid_belt.sig_dot_sub_surf(tps: ndarray, r: ndarray, const: dict, kwargsN: dict | None = None, It_d: int = 100) ndarray[source]

Compute the gas surface density generation rate for a belt discribed into the const dictionary if the sublimation append only at the surface of asteroids

Parameters

tpsnp.ndarray

The time at which evaluate the result

rnp.ndarray

The distance to the central star at which evaluate the solution

constdict

The dictionary of constants

kwargsNdict

The dictionary that defined the size distribution

It_dint

The number of depth steps for thermal diffusion integration

Returns

np.ndarray

diffenix.solve_asteroid_belt.sig_dot_sub_vol(tps: ndarray, r: ndarray, const: dict, kwargsN: dict | None = None, It_d: int = 100) ndarray[source]

Compute the gas surface density generation rate for a belt discribed into the const dictionary if the sublimation append only at the surface of asteroids

Parameters

tpsnp.ndarray

The time at which evaluate the result

rnp.ndarray

The distance to the central star at which evaluate the solution

constdict

The dictionary of constants

kwargsNdict

The dictionary that defined the size distribution

It_dint

The number of depth steps for thermal diffusion integration

Returns

np.ndarray

diffenix.solve_asteroid_belt.sigma_dot(Mbelt: float64, r: ndarray, tps: ndarray, a0: float64, delta_a: float64, tinit: float64, tmax: float64, f_ice: float64, rho_refr: float64, rho_ice: float64, Abelt: float64, K: float64, Its: int, Phi: float64, dmin: float64, dmax: float64, Its_p: int, rp: float64, Itt: int, kwargsN: dict, **kwargs) ndarray[source]

Estimate the surface density mass generation rate for asteroids of diameters d at the distance r of the central star and of diameter d in a belt of mass Mbelt during the time times_loc

Parameters

Mbeltnp.float64

The total belt’s mass

rnp.ndarray

The distance to the central star

pnp.ndarray

The asteroids/KBO diameters

tpsnp.ndarray

The time

a0np.float64

The belt’s semi-major axis

delta_anp.float64

The (half) size pf the belt

tinitnp.float64

The initial time

tmaxnp.float64

The maximum time

f_icenp.float64

The initial ice to refractory mass ratio

rho_refrnp.float64

The asteroids/KBO density

rho_icenp.float64

The asteroids/KBO ice density

Abeltnp.float64

The asteroids/KBO albedo

Knp.float64

The thermal diffusion coefficient

Itsnp.float64

The number of spatial steps

Phinp.float64

The porosity (dimensionless number)

dminnp.float64

The minimum diameters

dmaxnp.float64

The maximum diameters

Its_pnp.float64

The number of diameters steps

rpnp.float64

The pore’s radius

Ittnp.float64

The number of time steps

kwargsNdict

The directory with all informations to build the belt’s size number distribution

kwargs : dict

Returns

np.ndarray

diffenix.solve_asteroid_belt.sigmap_rho(t: ~numpy.float64 | ~numpy.ndarray, rr: ~numpy.ndarray, pp: ~numpy.ndarray, consts: dict, comp: ~diffenix.solve_asteroid_belt.Compteur = <diffenix.solve_asteroid_belt.Compteur object>) ndarray[source]

Calculate and return the gas generation rate at depth p, radius r and time t. This doesn’t take into acompte the limited amonth of material

Parameters

tnp.ndarray | np.float64

The current time

rnp.ndarray | np.float64

The distance to the central star (semi-major axis)

pnp.ndarray | np.float64

The depth into the asteroid/KBO

constsdict

The constantes

compCompteur, optional

To estimate the number of iterations

Returns

np.ndarray | np.float64

diffenix.solve_asteroid_belt.tau_diff(pp: ndarray, rr: ndarray, t: float64 | ndarray, consts: dict) ndarray[source]

Calculate the diffusion timescale at time t and depth p

Parameters

p: np.ndarray

The depth at which the gas is realised

r: np.ndarray

The distance from the central star at which the gas is realised

t: np.ndarray

The time at which the gas is realised

consts

All the necessary constants

Returns

np.ndarray

The time needed for the gas to go at the surface

diffenix.solve_asteroid_belt.temp_belt(r: ndarray | float64, t: float64 | ndarray, consts: dict) ndarray | float64[source]

Calculate and return the temperature at radius r and time t

Parameters

rnp.ndarray | np.float64

radius

tnp.ndarray | np.float64

the current time

constsdict

the constantes

Returns

np.ndarray | np.float64

diffenix.solve_asteroid_belt.thermal_diff(d: float64, consts: dict, It_d: int = 300, t: ndarray | None = None) tuple[ndarray, ndarray, ndarray][source]

Compute the thermal diffusion equation into a bodi of radius d as a function of time assuming the bodi to be at the distance a_0 from the central star. To get the temperatures at others location r, one must multiplie the result by (r / a0) ** (-1/2)

Parameters

dnp.float64

The size of the bodi

constsdict

The dictionary of constant parameters

It_dint

The number of spatials steps

tnp.ndarray

the times at which evaluate the solution

Returns

np.ndarray

Numerical methods

Some numericals operation that need to be redifined for the numerical integration such as the seconde derivative of an array of the special first derivative of the advection-diffusion equation of a given speed v.

class diffenix.numericals_methods.SolutionED(x, y: list | ndarray, itérations: int = -1)[source]

Bases: object

diffenix.numericals_methods.gradient(y: ndarray[float64], dx: float64 = np.float64(1.0), axis: int = -1, radial_speed: ndarray[float64] | None = None) ndarray[float64][source]
diffenix.numericals_methods.gradient2(y: ndarray[float64], dx: float64 = np.float64(1.0), axis: int = -1) ndarray[float64][source]
diffenix.numericals_methods.gradient_d(y: ndarray[float64], dx: float64 = np.float64(1.0), axis: int = -1) ndarray[float64][source]
diffenix.numericals_methods.gradient_g(y: ndarray[float64], dx: float64 = np.float64(1.0), axis: int = -1) ndarray[float64][source]
diffenix.numericals_methods.gradient_weno5(y: ndarray, dx: float64 = 1.0, axis: int = -1) ndarray[source]

Compute the spatial derivative of y following the WENO discretization scheme, robust to discontinuity, along a specified axis.

Parameters

ynp.ndarray

The array to be derived

dxnp.float64, optional, default: 1.0

The space step, the space domain should be evenly spaced with dx

axisint, optional, default: -1

The axis along which to compute the derivative

Returns

np.ndarray

The order 1 spatial derivative of y at each point along the specified axis

diffenix.numericals_methods.grid_refine_inner_edge(x_orig: ndarray[float64], nlev: int, nspan: int) ndarray[float64][source]

A simple grid refinement function

Parameters

x_orig: np.ndarray[np.float64]

The origi,al grid to be refined

nlev: int nspan: int

Returns

np.ndarray[np.float64]

The refined grid

diffenix.numericals_methods.linear_interpolation(x: ndarray[float64] | float64, y: ndarray[float64] | float64)[source]

Linear interpolation

Parameters

xnp.float64 | np.ndarray[np.float64]

The variable

ynp.float64 | np.ndarray[np.float64]

The datapoints asssociated with the variable x to be interpolated. Both x and y can be multisimensionals vectors

Returns

A function that returns the interpolated value

diffenix.numericals_methods.rk4(f: Callable, x0: float64 | ndarray | None = None, y0: float64 | ndarray | None = None, xf: float64 = np.float64(-1.0), dx_max: float64 | None = None, args: list | tuple | None = None, IT_s_max: int = 1000, f_dx: Callable | None = None) SolutionED[source]

Global constants and functions

diffenix.Constantes.AB_Mbelt: np.float64 = np.float64(0.12)

Total initial mass

diffenix.Constantes.AB_a0: np.float64 = np.float64(2.6499999999999995)

Central radius

diffenix.Constantes.AB_delta_r: np.float64 = np.float64(0.7999999999999999)

Radial extention above and below central redius (half of belt’s size)

diffenix.Constantes.C_E: np.float64 = np.float64(7.451140745450589e-21)

j -> Mearth au**2 / Myr**2 : energy

diffenix.Constantes.C_F: np.float64 = np.float64(1.1146747898054189e-09)

N -> Mearth au**2 / Myr : force

diffenix.Constantes.C_L: np.float64 = np.float64(6.684587122268445e-12)

1/6371009 # m -> au: length

diffenix.Constantes.C_Lum: np.float64 = np.float64(2.351401191886315e-07)

W = j / s -> Mearth au**2 / Myr**3: Luminosity

diffenix.Constantes.C_M: np.float64 = np.float64(1.6744248350691536e-25)

1/5.9722*1e24 # kg -> Mearth : mass

diffenix.Constantes.C_rho: np.float64 = np.float64(560585542.3145154)

kg/m3 -> Mearth / au**2: density

diffenix.Constantes.C_t: np.float64 = np.float64(3.168808781402895e-14)

s-> 1 Myr : time

diffenix.Constantes.G: np.float64 = np.float64(118569165.93179607)

6.67430e-11 N m*2 kg**-2 : Gravitational constant

diffenix.Constantes.Gyr: np.float64 = np.float64(1000.0)

One billion year in code unit

diffenix.Constantes.IT_s: int = 700

Spatials steps

diffenix.Constantes.KB_Mbelt: np.float64 = np.float64(0.01)

Total initial mass

diffenix.Constantes.KB_a0: np.float64 = np.float64(43.99999999999999)

Central radius

diffenix.Constantes.KB_delta_r: np.float64 = np.float64(7.999999999999999)

Radial extention above and below central redius (half of belt’s size)

diffenix.Constantes.Myr: np.float64 = np.float64(1.0)

One million year in code unit

diffenix.Constantes.Na: np.float64 = np.float64(6.0221407599999985e+23)

Avogadro constant

diffenix.Constantes.Pi: np.float64 = np.float64(3.141592653589793)

Pi double precision

diffenix.Constantes.Rgp: np.float64 = np.float64(6.195223119064738e-20)

8.31446261815324 J K−1 mol−1 : perfect gas constant

diffenix.Constantes.T0: np.float64 = np.float64(170.77404247983844)

Reference temperature at a0

diffenix.Constantes.a_in: np.float64 = np.float64(0.049999999999999996)

Inner radius

diffenix.Constantes.a_out: np.float64 = np.float64(499.99999999999994)

outer radius

diffenix.Constantes.alpha: np.float64 = np.float64(0.001)

viscous parameter

diffenix.Constantes.atol: np.float64 = np.float64(1e-250)

Absolute tolerance for temporal integration (by default too small hence to

diffenix.Constantes.c: np.float64 = np.float64(63241077084.26627)

299792458 m/s Speed of light

diffenix.Constantes.chargement_constantes(consts_filename: str) None[source]

Load all the constantes in const_filename

Parameters

consts_filenamestr

path to the .npz file containing all the constantes

Returns

diffenix.Constantes.constantes() dict[str, float64 | str][source]

All the constants

Returns

dict
A dictionary with all the constants :
  • racine : str, The absolute path to the directory where all the results are saved

  • results : str, The relative path to racine of the directory (inside racine) where the simulations are saved

  • C_L : np.float64, 1/6371009 m -> au: length conversion factor

  • C_M : np.float64, 1/(5.9722*1e24) kg -> Mearth : mass conversion factor

  • C_t : np.float64, 1 / (3600 * 24 * 365.25 * 1e6) : s-> 1 Myr : time conversion factor

  • Ts : np.float64, Surface temperature of the central star

  • Ms : np.float64, Mass of the central star

  • Rs : np.float64, Radius of the central star

  • Ls : np.float64, Luminosity of the central star

  • a_in : np.float64, Inner radius of the integration domain

  • a0 : np.float64,

  • a_out : np.float64, Outer radius of the integration domain

  • T0 : np.float64, Temperature at a0

  • pls_temp : np.float64, the radial power slope of the temperature

  • mdot : np.float64, gas mass generation rate (if constant generation rate)

  • AB_Mbelt : np.float64, Asteroid belt’s size

  • AB_Abelt : np.float64, Asteroids albedo

  • AB_a0 : np.float64, Asteroid belt’s central radius

  • AB_delta_r : np.float64, Half of asteroid belt size

  • AB_K : np.float64, Thermal diffusion coefficient in asteroids

  • AB_Phi : np.float64, Porosity

  • AB_rp : np.float64, Asteroid’s pore radius

  • AB_f_ice : np.float64, Ice to total mass ratio

  • AB_rho_refr : np.float64, Refractory’s materials density in asteroids

  • AB_rho_ice : np.float64 Ice density

  • AB_sublimation_model : np.float64 Sublimation model in asteroid belt

  • AB_SD_amax : np.double, Maximum size of asteroids

  • AB_SD_abig : np.double, Intermediate size

  • AB_SD_amed : np.double, Medium size for size distribution

  • AB_SD_amin : np.double, Minimal size

  • AB_SD_qh : np.double, Power slope of the distribution between abig and amax

  • AB_SD_qm : np.double, Power slope of the distribution between amed and abig

  • AB_SD_ql : np.double, Power slope of the distribution between amin and amed

  • AB_s_min: np.float64 = np.double(316) * C_L # Minimum size for collision model

  • AB_sb: np.float64 = np.double(316) * C_L # Intermediate size for collision model

  • AB_s_max: np.float64 = np.double(316) * C_L # Maximum size for collision model

  • AB_e: np.float64 = np.double(0.075) # Eccentricity

  • AB_i: np.float64 = AB_e / np.double(2.) # Inclination

  • AB_As: np.float64 = np.double(5.) * C_E / C_M # Massique energy to disrupt the asteroids

  • AB_bs: np.float64 = np.double(-0.1)

  • AB_bg: np.float64 = np.double(0.5)

  • AB_t0_diss: np.float64 = 10 * Gyr # Belt’s lifetime before dissipation

  • AB_t1_diss: np.float64 = 10 * Gyr # Dissipation timescale

  • KB_Mbelt : np.float64, Kuiper belt’s mass

  • KB_Abelt : np.float64, KBO’s albedo

  • KB_a0 : np.float64, Kuiper belt central radius

  • KB_delta_r : np.float64, Half of Kuiper belt size

  • KB_K : np.float64, Thermal diffusion coefficient in KBO

  • KB_Phi : np.float64, KBO’s porosity

  • KB_rp : np.float64, KBO’s pore’s radius

  • KB_f_ice : np.float64, Initial ice to total mass ratio in KBO

  • KB_rho_refr : np.float64, Refractory’s materials density in KBO

  • KB_rho_ice : np.float64, Ice density

  • KB_sublimation_model : np.float64, Sublimation model in Kuiper belt

  • KB_SD_amax : np.double, Maximum size of KBO

  • KB_SD_abig : np.double, Intermediate size

  • KB_SD_amed : np.double, Medium size

  • KB_SD_amin : np.double, Minimal size

  • KB_SD_qh : np.double, Power slope of the distribution between abig and amax

  • KB_SD_qm : np.double, Power slope of the distribution between amed and abig

  • KB_SD_ql : np.double, Power slope of the distribution between amin and amed

  • KB_s_min: np.float64 = np.double(316) * C_L # Minimum size for collision model

  • KB_sb: np.float64 = np.double(316) * C_L # Intermediate size for collision model

  • KB_s_max: np.float64 = np.double(316) * C_L # Maximum size for collision model

  • KB_e: np.float64 = np.double(0.075) # Eccentricity

  • KB_i: np.float64 = KB_e / np.double(2.) # Inclination

  • KB_As: np.float64 = np.double(5.) * C_E / C_M # Massique energy to disrupt the asteroids

  • KB_bs: np.float64 = np.double(-0.1)

  • KB_bg: np.float64 = np.double(0.5)

  • KB_t0_diss: np.float64 = 10 * Gyr # Belt’s lifetime before dissipation

  • KB_t1_diss: np.float64 = 10 * Gyr # Dissipation timescale

  • a_planet : list[np.double], planet’s semi-major axis

  • m_planet : list[np.double], planet’s masses

  • f_accr : np.float64, Hydrodynamic accretion efficiency

  • t0 : The dissipation time of the protoplanetary disc

  • IT_s : int, number of spatial steps

  • dip : int, half of the number of sink cells for a given planets to model the accretion

  • rtol : np.float64, Relative tolerance for temporal integration

  • atolnp.float64, Absolute tolerance for temporal integration (by default too small hence to

    relative tolerance will always be the limiting factor)

  • method_root : str, ‘LSODA’,’BDF’,’DOP853’,’RK45’ : Temporal integration method_root

diffenix.Constantes.dip: int = 10

half of the number of sink cells for a given planets to model the accretion

diffenix.Constantes.h: np.float64 = np.float64(1.5644973406367687e-67)

6.62607015e-34 J/s Planck constant

diffenix.Constantes.inf: np.float64 = np.float64(inf)

infinite double precision

diffenix.Constantes.kb: np.float64 = np.float64(1.0287410019065611e-43)

1.380649e-23 J/K Boltzmann constant

diffenix.Constantes.kyr: np.float64 = np.float64(0.001)

One thousand year in code unit

diffenix.Constantes.m_dot: np.float64 = np.float64(0.1)

Gas generation rate (if constant generation rate)

diffenix.Constantes.method: str = 'RK45'

‘LSODA’,’BDF’,’DOP853’,’RK45’ : Temporal integration method_root

diffenix.Constantes.pls_temp: np.float64 = -0.5

Temperature distribution power slope

diffenix.Constantes.rtol: np.float64 = np.float64(1e-05)

Relative tolerance for temporal integration

diffenix.Constantes.sigma: np.float64 = np.float64(298393456.15390253)

5.670374419 * 1e-8 W m-2 K-4 : Stefan-Boltzmann’s constant

diffenix.Constantes.t0: np.float64 = np.float64(5.0)

Time at which the disc dissipates

diffenix.Constantes.update_constantes(dic: dict) None[source]

Update all constates from a dictionary

Parameters

dicdict, optional, default=None
A dictionary with all the constants :
  • racine : str, The absolute path to the directory where all the results are saved

  • results : str, The relative path to racine of the directory (inside racine) where the simulations are saved

  • C_L : np.float64, 1/6371009 m -> au: length conversion factor

  • C_M : np.float64, 1/(5.9722*1e24) kg -> Mearth : mass conversion factor

  • C_t : np.float64, 1 / (3600 * 24 * 365.25 * 1e6) : s-> 1 Myr : time conversion factor

  • Ts : np.float64, Surface temperature of the central star

  • Ms : np.float64, Mass of the central star

  • Rs : np.float64, Radius of the central star

  • Ls : np.float64, Luminosity of the central star

  • a_in : np.float64, Inner radius of the integration domain

  • a0 : np.float64,

  • a_out : np.float64, Outer radius of the integration domain

  • T0 : np.float64, Temperature at a0

  • mdot : np.float64, gas mass generation rate (if constant generation rate)

  • AB_Mbelt : np.float64, Asteroid belt’s size

  • AB_Abelt : np.float64, Asteroids albedo

  • AB_a0 : np.float64, Asteroid belt’s central radius

  • AB_delta_r : np.float64, Half of asteroid belt size

  • AB_K : np.float64, Thermal diffusion coefficient in asteroids

  • AB_Phi : np.float64, Porosity

  • AB_rp : np.float64, Asteroid’s pore radius

  • AB_f_ice : np.float64, Ice to total mass ratio

  • AB_rho_refr : np.float64, Refractory’s materials density in asteroids

  • AB_rho_ice : np.float64 Ice density

  • AB_sublimation_model : np.float64 Sublimation model in asteroid belt

  • AB_SD_amax : np.double, Maximum size of asteroids

  • AB_SD_abig : np.double, Intermediate size

  • AB_SD_amed : np.double, Medium size for size distribution

  • AB_SD_amin : np.double, Minimal size

  • AB_SD_qh : np.double, Power slope of the distribution between abig and amax

  • AB_SD_qm : np.double, Power slope of the distribution between amed and abig

  • AB_SD_ql : np.double, Power slope of the distribution between amin and amed

  • AB_s_min: np.float64 = np.double(316) * C_L # Minimum size for collision model

  • AB_sb: np.float64 = np.double(316) * C_L # Intermediate size for collision model

  • AB_s_max: np.float64 = np.double(316) * C_L # Maximum size for collision model

  • AB_e: np.float64 = np.double(0.075) # Eccentricity

  • AB_i: np.float64 = AB_e / np.double(2.) # Inclination

  • AB_As: np.float64 = np.double(5.) * C_E / C_M # Massique energy to disrupt the asteroids

  • AB_bs: np.float64 = np.double(-0.1)

  • AB_bg: np.float64 = np.double(0.5)

  • AB_t0_diss: np.float64 = 10 * Gyr # Belt’s lifetime before dissipation

  • AB_t1_diss: np.float64 = 10 * Gyr # Dissipation timescale

  • KB_Mbelt : np.float64, Kuiper belt’s mass

  • KB_Abelt : np.float64, KBO’s albedo

  • KB_a0 : np.float64, Kuiper belt central radius

  • KB_delta_r : np.float64, Half of Kuiper belt size

  • KB_K : np.float64, Thermal diffusion coefficient in KBO

  • KB_Phi : np.float64, KBO’s porosity

  • KB_rp : np.float64, KBO’s pore’s radius

  • KB_f_ice : np.float64, Initial ice to total mass ratio in KBO

  • KB_rho_refr : np.float64, Refractory’s materials density in KBO

  • KB_rho_ice : np.float64, Ice density

  • KB_sublimation_model : np.float64, Sublimation model in Kuiper belt

  • KB_SD_amax : np.double, Maximum size of KBO

  • KB_SD_abig : np.double, Intermediate size

  • KB_SD_amed : np.double, Medium size

  • KB_SD_amin : np.double, Minimal size

  • KB_SD_qh : np.double, Power slope of the distribution between abig and amax

  • KB_SD_qm : np.double, Power slope of the distribution between amed and abig

  • KB_SD_ql : np.double, Power slope of the distribution between amin and amed

  • KB_s_min: np.float64 = np.double(316) * C_L # Minimum size for collision model

  • KB_sb: np.float64 = np.double(316) * C_L # Intermediate size for collision model

  • KB_s_max: np.float64 = np.double(316) * C_L # Maximum size for collision model

  • KB_e: np.float64 = np.double(0.075) # Eccentricity

  • KB_i: np.float64 = KB_e / np.double(2.) # Inclination

  • KB_As: np.float64 = np.double(5.) * C_E / C_M # Massique energy to disrupt the asteroids

  • KB_bs: np.float64 = np.double(-0.1)

  • KB_bg: np.float64 = np.double(0.5)

  • KB_t0_diss: np.float64 = 10 * Gyr # Belt’s lifetime before dissipation

  • KB_t1_diss: np.float64 = 10 * Gyr # Dissipation timescale

  • a_planet : list[np.double], planet’s semi-major axis

  • m_planet : list[np.double], planet’s masses

  • f_accr : np.float64, Hydrodynamic accretion efficiency

  • t0 : The dissipation time of the protoplanetary disc

  • IT_s : int, number of spatial steps

  • dip : int, half of the number of sink cells for a given planets to model the accretion

  • rtol : np.float64, Relative tolerance for temporal integration

  • atolnp.float64, Absolute tolerance for temporal integration (by default too small hence to

    relative tolerance will always be the limiting factor)

  • method_root : str, ‘LSODA’,’BDF’,’DOP853’,’RK45’ : Temporal integration method_root

Returns

None

diffenix.Constantes.yr: np.float64 = np.float64(1e-06)

One year in code unit

diffenix.Constantes.zero: np.float64 = np.float64(0.0)
  1. double precision