Skip to content

Analytical Models

Built-in geometries that require no external data. Useful for benchmarks, parameter studies, and testing.

Spherical Shell

A spherically symmetric shell of gas centered in the unit cube. The shell extends from inner_radius to outer_radius, both given as fractions of the box size (range 0 to 0.5). Setting inner_radius: 0.0 fills the sphere entirely.

The gas density can be specified as a number density (density, in cm^-3) or as an integrated column density (column_density, in cm^-2). The latter is often more convenient for comparison with observations.

max_step limits the maximum physical step size per scattering event, in box units. For a static shell, 1.0 (the full box) is fine. For MCRT-specific options like xcrit and acc_scheme, see the Configuration Reference.

max_step for outflowing shells

When an outflow velocity is set, both shellmodel and powerlaw_shellmodel automatically limit the step size so that the velocity change per step stays below ~1% of the thermal velocity. The auto-computed limit is:

\[ \mathtt{max\_step} \approx 0.01 \times \frac{v_\mathrm{th}}{v_\mathrm{out}} \times \Delta r \]

where \(\Delta r\) = outer_radius \(-\) inner_radius (in box units), \(v_\mathrm{out}\) is the outflow velocity, and the thermal velocity is \(v_\mathrm{th} = \sqrt{2 k_B T / m_\mathrm{H}}\). For Lya (\(m_\mathrm{H}\) = hydrogen mass) at \(T = 10^4\,\mathrm{K}\), \(v_\mathrm{th} \approx 12.85\,\mathrm{km/s}\).

The effective step size is min(max_step, auto_limit), so you can always override with a smaller value if needed.

Full configuration
shell_lya.yaml
dataset_type: 'shellmodel'
driver_type: 'mcrtsimulation'
device: "cpu"

shellmodel:
  boxsize: 3.086e21       # cm (1 kpc)
  inner_radius: 0.0       # fraction of box size [0, 0.5]
  outer_radius: 0.1       # fraction of box size [0, 0.5]
  temperature: 20000.0    # K
  density: 0.078098       # cm^-3 (tau ~ 1e6)
  outflow_velocity: 0.0   # cm/s (static shell)

mcrtsimulation:
  outputpath: output
  overwrite: true
  linename: Lya
  nphotons_max: 100000
  nphotons_step_max: 100000
  nsteps_per_photon_max: 10000000
  xcrit: 0.0
  acc_scheme: Smith15
  max_step: 1.0
  emissionmodel:
    mode: "singlesource"
    singlesource:
      nphotons: 10000
      lum_total: 1e42
      position: [0.5, 0.5, 0.5]
  outputprocessors:
    - type: "photon"
      active: true

Variants

Outflowing shell — add to shellmodel::

  outflow_velocity: 2e7   # cm/s (200 km/s) at r = outer_radius

Specify column density instead of number density — replace density: with:

  column_density: 2e20    # cm^-2

Dust absorption — not yet supported for shellmodel (see infiniteslab for dust support).

Infinite Slab

One-dimensional slab along the z-axis, infinite in x and y. Photons scatter until they escape through the top or bottom face. This geometry is useful for testing against the analytic Neufeld (1990) solution.

The slab can be specified by number density (density) or directly by line-center optical depth (tau). When using tau, the density is computed from the line properties set by linename.

max_step should be large (effectively unlimited) for this geometry, since the slab has no spatial structure — there is no benefit to limiting step size.

Full configuration
slab_lya.yaml
dataset_type: 'infiniteslab'
driver_type: 'mcrtsimulation'
device: "cpu"

infiniteslab:
  boxsize: 3.086e21       # cm (1 kpc)
  temperature: 20000.0    # K
  density: 0.0156196      # cm^-3

mcrtsimulation:
  outputpath: output
  overwrite: true
  linename: Lya
  nphotons_max: 100000
  nphotons_step_max: 100000
  nsteps_per_photon_max: 100000000
  xcrit: 0.0
  acc_scheme: Smith15
  max_step: 1000000.0
  emissionmodel:
    mode: "singlesource"
    singlesource:
      nphotons: 1000
      lum_total: 1e42
      position: [0.5, 0.5, 0.5]
  outputprocessors:
    - type: "photon"
      active: true

Variants

Specify optical depth instead of density — replace density: with (requires linename in driver):

  tau: 1e6

Add dust — add to infiniteslab: and set the interactor in mcrtsimulation::

# in infiniteslab:
  tau_dust: 0.1           # dust optical depth across half the slab

# in mcrtsimulation:
  interactor: ResonantWithDustInteractor

Power-Law Shell

Extends the spherical shell with radial power-law profiles for density and velocity: v(r) ~ r^powerlaw_index_velocity and rho(r) ~ r^powerlaw_index_density.

When conserve_column_density is enabled, the density profile is rescaled so that the total column density matches that of a uniform shell with the same mean density. This lets you compare power-law and uniform shells at the same optical depth.

Full configuration
powerlaw_shell.yaml
dataset_type: 'powerlaw_shellmodel'
driver_type: 'mcrtsimulation'
device: "cpu"

powerlaw_shellmodel:
  boxsize: 3.086e21
  inner_radius: 0.01
  outer_radius: 0.1
  temperature: 20000.0
  density: 0.078098                # interpreted as mean density
  outflow_velocity: 200e5          # cm/s at outer_radius
  powerlaw_index_velocity: 1.0     # v(r) ~ r^1
  powerlaw_index_density: -2.0     # rho(r) ~ r^-2
  conserve_column_density: true    # rescale to match uniform shell column

mcrtsimulation:
  outputpath: output
  overwrite: true
  linename: Lya
  nphotons_max: 100000
  nphotons_step_max: 100000
  nsteps_per_photon_max: 10000000
  xcrit: 0.0
  acc_scheme: Smith15
  max_step: 0.0001
  emissionmodel:
    mode: "singlesource"
    singlesource:
      nphotons: 10000
      lum_total: 1e42
      position: [0.5, 0.5, 0.5]
  outputprocessors:
    - type: "photon"
      active: true