Using a custom density profile

Overview

TARDIS also has the capability to work with arbitrary density profiles. This is particularly useful if the results of detailed explosion simulations should be mapped into TARDIS. The density profile is supplied in the form of a simple ASCII file that should look something like this:

1 day
# index velocity (km/s) density (g/cm^3)
0       9000.0000   5.4869692e-10
1       10500.000   2.1759646e-10
2       12000.000   9.7656229e-11
3       13500.000   4.8170911e-11
4       15000.000   2.5600000e-11
5       16500.000   1.4450533e-11
6       18000.000   8.5733893e-12
7       19500.000   5.3037103e-12
8       21000.000   3.3999447e-12
9       22500.000   2.2474623e-12

In this file:

  • the first line gives the reference time (see below)

  • (the second line in our example is a comment)

  • the remaining lines (ten in our example) give an indexed table of points that specify mass density (g / cm^3) as a function of velocity (km / s).

TARDIS will use this table of density versus velocity to specify the density distribution in the ejecta. For the calculation, TARDIS will use the reference time given in the file to scale the mass densities to whatever epoch is requested by assuming homologous expansion:

\[\rho (t_{exp}) = \rho (t_{ref}) (t_{ref} / t_{exp})^{3}\]

The values in the example here define a density profile that is dropping off with

\[\rho \propto v^{-5}\]

Note

The grid of points specified in the input file is interpreted by TARDIS as defining a grid in which the tabulated velocities are taken as the outer boundaries of grid cells and the density is assumed to be uniform within each cell. See Edge-Defined and Cell-Defined Values.

Inner Boundary

The first velocity-density pair in a custom density file (given by index 0) specifies the velocity of the inner boundary approximation. The density associated with this velocity is the density within the inner boundary, which does not affect TARDIS spectra. Therefore, the first density (5.4869692e-10 in the example above) can be replaced by a placeholder value. The user can choose to both specify a custom density file AND specify v_inner_boundary or v_outer_boundary in the configuration YAML file for a TARDIS run. The YAML-specified boundary velocity then replaces the corresponding edge of the computational domain:

  • If the boundary velocity falls inside a cell of the custom density file, TARDIS truncates that cell at the boundary and discards the part of the cell outside the domain, along with any cells beyond it. The truncated cell keeps the density of the full cell, so its mass decreases.

  • If the boundary velocity lies outside the velocity range of the custom density file, TARDIS issues a warning and extends the innermost or outermost cell to the boundary. The extended cell keeps its density, so its mass increases.

  • v_inner_boundary must be smaller than v_outer_boundary; otherwise TARDIS raises an error.

See Edge-Defined and Cell-Defined Values for details.

It is always a good idea to check the model velocities and abundances used in a TARDIS simulation after it has been successfully run.

Warning

The example given here is to show the format only. It is not a realistic model. In any real calculation, better resolution (i.e. more grid points) should be used.

TARDIS input file

If you create a correctly formatted density profile file (called “density.dat” in this example), you can use it in TARDIS by putting the following lines in the model section of the YAML file:

model:
    structure:
        type: file
        filename: density.dat
        filetype: simple_ascii
        v_inner_boundary: 11000 km/s
        v_outer_boundary: 20000 km/s

Note

The specifications for the velocities of the inner and outer boundary values can be neglected (in which case TARDIS will default to using the full velocity range specified in the density.txt file). Boundary velocities that lie outside the range covered by density.txt are accepted with a warning, and TARDIS extends the innermost or outermost cell to reach them (see Inner Boundary).