Skip to content

Analytical Models

Built-in geometries with no external data — useful for benchmarks, parameter studies, and testing.

Spherical Shell

A spherical shell of gas centered in the unit cube, from inner_radius to outer_radius (fractions of the box size in [0, 0.5]). inner_radius: 0.0 fills the sphere entirely.

Density can be set as a number density (density, cm⁻³) or as an integrated column density (column_density, cm⁻²); the latter is often more convenient for comparison with observations.

max_step is the maximum step size per scattering, in box units; 1.0 (the full box) is fine for static shells. For MCRT 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

A 1-D slab along z, infinite in x and y. Useful for the analytic Neufeld (1990) test.

Specify by density or directly by line-center optical depth (tau); with tau, density is derived from the line set by linename.

max_step can be effectively unlimited — there is no spatial structure to resolve and velocity gradients are not currently supported for slabs.

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