{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# The Standard Model\n", "\n", "In this chapter we'll go through all fields in the standard model, explain their meaning and the default functions that calculates them." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from dustpy import Simulation" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "sim = Simulation()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "sim.initialize()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default the frame object of `DustPy` consists of four groups for **dust**, **gas**, **grid**, and **stellar** parameters, a field for the **time**, which is the integration variable, an **integrator** object, and a **writer** object." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "DustPy\n", "------\n", " dust : Group (Dust quantities)\n", " gas : Group (Gas quantities)\n", " grid : Group (Grid quantities)\n", " star : Group (Stellar quantities)\n", " -----\n", " t : Field (Time [s]), \u001b[95mIntegration variable\u001b[0m\n", " -----\n", " Integrator : Integrator (Default integrator)\n", " Writer : Writer (HDF5 file format using h5py)" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Dust" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Group (Dust quantities)\n", "-----------------------\n", " backreaction : Group (Backreaction coefficients)\n", " boundary : Group (Boundary conditions)\n", " coagulation : Group (Coagulation quantities)\n", " delta : Group (Mixing parameters)\n", " Fi : Group (Fluxes)\n", " p : Group (Probabilities)\n", " S : Group (Sources)\n", " v : Group (Velocities)\n", " -----\n", " a : Field (Particle size [cm)\n", " D : Field (Diffusivity [cm²/s])\n", " eps : Field (Dust-to-gas ratio)\n", " fill : Field (Filling factor)\n", " H : Field (Scale heights [cm])\n", " kernel : Field (Collision kernel [cm²/s])\n", " rho : Field (Midplane mass density per mass bin [g/cm³])\n", " rhos : Field (Solid state density [g/cm³])\n", " Sigma : Field (Surface density per mass bin [g/cm²])\n", " SigmaFloor : Field (Floor value of surface density [g/cm²])\n", " St : Field (Stokes number)\n", " -----" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### `Simulation.dust.backreaction`" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Group (Backreaction coefficients)\n", "---------------------------------\n", " A : Field (Pull factor)\n", " B : Field (Push factor)\n", " -----" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.backreaction" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The backreaction describes the hydrodynamic influence the dust has on the gas. Numerically it consists of two fields `A` and `B` of shape `(Simulation.grid.Nr,)` that describe the pull respectively the push the dust excerts on the gas.\n", "\n", "The details of this mechanism are described in [Gárate et al. (2019)](https://doi.org/10.3847/1538-4357/aaf4fc).\n", "\n", "Backreaction modifies the radial gas velocity as follows\n", "\n", "$v_\\mathrm{g} = Av_\\mathrm{visc} + 2B\\eta v_\\mathrm{K}$.\n", "\n", "In the standard model we have `A=1` and `B=0` everywhere, i.e., backreactions is not active." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.\n", " 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.\n", " 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.\n", " 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.\n", " 1. 1. 1. 1.]" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.backreaction.A" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.\n", " 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.\n", " 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.\n", " 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.\n", " 0. 0. 0. 0.]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.backreaction.B" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Depending on the type of backreaction that you want to model, you have to provide functions for `A` and `B`. Have a look at Appendix A of [Gárate et al. (2019)](https://doi.org/10.3847/1538-4357/aaf4fc) for examples." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### `Simulation.dust.boundary`" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Group (Boundary conditions)\n", "---------------------------\n", " inner : Boundary\n", " outer : Boundary\n", " -----" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.boundary" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "By default there are no dust boundary conditions set for the inner and outer grid cells of the dust." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "No boundary condition set" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.boundary.inner" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "No boundary condition set" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.boundary.outer" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The boundary is indirectly defined by the dust fluxes through the inner and outer grid interfaces, which are by default calculated by assuming constant dust velocities at the boundaries.\n", "\n", "The boundary conditions can be changed via `setcondition()`." ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on method setcondition in module dustpy.utils.boundary:\n", "\n", "setcondition(condition, value=None) method of dustpy.utils.boundary.Boundary instance\n", " Function to set boundary condition.\n", " \n", " Parameters\n", " ----------\n", " condition : string\n", " Type of boundary conditon:\n", " - \"const_grad\" : constant gradient\n", " - \"const_pow\" : constant power law\n", " - \"const_val\" : constant value\n", " - \"val\" : custom value\n", " - \"grad\" : custom gradient\n", " - \"pow\" : custom power law with set exponent\n", " - None : Don't impose boundary condition (default)\n", " value : float or array, optional, default : None\n", " Value if needed for boundary condition\n", "\n" ] } ], "source": [ "help(sim.dust.boundary.outer.setcondition)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### `Simulation.dust.coagulation`\n", "\n", "The fields in this group define the behavior of dust growth and are discussed in a separate chapter." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### `Simulation.dust.delta`" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Group (Mixing parameters)\n", "-------------------------\n", " rad : Field (Radial mixing parameter)\n", " turb : Field (Turbulent mixing parameter)\n", " vert : Field (Vertical mixing parameter)\n", " -----" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.delta" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The $\\delta$ parameters control the mixing of dust particles along vertical and radial directions and turbulent mixing. You can see them similar to the turbulent $\\alpha$ parameter. And by default they will have the same value as $\\alpha$ as given by `Simulation.ini.gas.alpha`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### `Simulation.dust.delta.rad`" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001]" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.delta.rad" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$\\delta_\\mathrm{rad}$ will be used to calculate the radial, turbulent RMS velocity of the dust." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### `Simulation.dust.delta.turb`" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001]" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.delta.turb" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$\\delta_\\mathrm{turb}$ will be used to calculate the turbulent collision velocities of the dust particles." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### `Simulation.dust.delta.vert`" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001\n", " 0.001 0.001 0.001 0.001]" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.delta.vert" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$\\delta_\\mathrm{vert}$ will be used to calculate the vertical dust scale heights." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### `Simulation.dust.Fi`" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Group (Fluxes)\n", "--------------\n", " adv : Field (Advective flux [g/cm/s)\n", " diff : Field (Diffusive flux [g/cm/s)\n", " tot : Field (Total flux [g/cm/s)\n", " -----" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.Fi" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This is a group of fluxes through the radial grid interfaces for every particle mass of shape `(Simulation.grid.Nr+1,, Simulation.grid.Nm)`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### `Simulation.dust.Fi.adv`\n", "\n", "This is the advective flux calculated by $F_\\mathrm{adv} = v_\\mathrm{d}\\Sigma_\\mathrm{d}$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### `Simulation.dust.Fi.diff`\n", "\n", "This is the diffusive flux calculated by $F_\\mathrm{diff} = -D\\Sigma_\\mathrm{g}\\nabla\\frac{\\Sigma_\\mathrm{d}}{\\Sigma_\\mathrm{gas}}$ for every particle species separately. The diffusive fluxes at the grid boundaries are set to zero to avoid instabilities." ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[[ 0.00000000e+00 0.00000000e+00 0.00000000e+00 ... 0.00000000e+00\n", " 0.00000000e+00 0.00000000e+00]\n", " [-1.50642471e-14 1.50642471e-14 -1.50642471e-14 ... 1.91213354e-21\n", " 2.57703517e-21 3.42138925e-21]\n", " [-0.00000000e+00 -0.00000000e+00 -0.00000000e+00 ... 1.67822354e-21\n", " 2.27209437e-21 3.03640156e-21]\n", " ...\n", " [-3.57009189e-47 -3.98385408e-47 -4.44555995e-47 ... -1.33086273e-41\n", " -1.48508841e-41 -1.65718639e-41]\n", " [-3.89114355e-48 -4.34207055e-48 -4.84525217e-48 ... -1.45046997e-42\n", " -1.61855623e-42 -1.80612098e-42]\n", " [ 0.00000000e+00 0.00000000e+00 0.00000000e+00 ... 0.00000000e+00\n", " 0.00000000e+00 0.00000000e+00]]" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.Fi.diff" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### `Simulation.dust.Fi.tot`\n", "\n", "This is the total flux through the radial grid interfaces $F_\\mathrm{tot} = F_\\mathrm{adv} + F_\\mathrm{diff}$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### `Simulation.dust.p`" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Group (Probabilities)\n", "---------------------\n", " frag : Field (Fragmentation probability)\n", " stick : Field (Sticking probability)\n", " -----" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sim.dust.p" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "These are the fragmentation and sticking probability of certain particle collisions. \n", "Their shape is `(Simulation.grid.Nr, Simulation.grid.Nm, Simulation.grid.Nm)`.\n", "\n", "The fragmentation probability of particle `i=80`, with particle `j=3` at radial grid cell `ir=30` is given by" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1.0" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ir = 30\n", "i = 80\n", "j = 3\n", "sim.dust.p.frag[ir, j, i]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### `Simulation.dust.p.frag`\n", "\n", "The fragmentation probability has a smooth transition between no fragmentation and fragmentation at the fragmentation velocity.\n", "\n", "$p_\\mathrm{f} = \n", "\\begin{cases}\n", " 1, & \\text{if } v_\\mathrm{rel}>v_\\mathrm{frag}\\\\\n", " 0, & \\text{if } v_\\mathrm{rel}