GradientMedium

A metatype for describing a medium with a density gradient.

Attributes

Name Type Description
axis double [3] or string Cartesian coordinates of the gradient axis in the simulation frame or 'vertical' if the gradient axis is defined by the Earth local vertical.
lambda number Gradient \lambda parameter, in m (see below).
magnet double [3] Magnetic field Cartesian components in the simulation frame, in T.
material string Name of the filling material.
rhoØ number Gradient \rho_0 parameter, in kg/m3 (see below).
type string Gradient type, i.e. 'linear' or 'exponential'.
number Gradient z_0 parameter, in m (see below).

Constructor

The GradientMedium allows to apply a unidimensional density gradient to a TabulatedMaterial. Two types of gradient are available: linear or exponential. The parameters \rho_0, z_0 and \lambda of the gradient are defined as:

\begin{aligned} \rho(z) &= \rho_0 \left( 1 + \frac{z - z_0}{\lambda} \right) \\ \rho(z) &= \rho_0 \exp\left(\frac{z - z_0}{\lambda}\right) \end{aligned}

where the first equation stands for a linear gradient and the second for an exponential one. The gradient axis is defined by a unit vector \vec{u}_g. The z coordinate corresponds to the location along this axis as z = \vec{r} \cdot \vec{u}_g. The gradient axis can be set to an absolute direction in the simulation frame or to the Earth local vertical. Optionaly one can also specify an extra local magnetic field.

Warning

The ionization loss of charged particles depends on the target material atomic spacing, i.e. on its density (see e.g. Sternheimer et al., 1984). Therefore, it is a priori not correct to arbitrarly change the medium density without re-computing the energy loss. However, this is a next to leading order effect compared to the density variation itself. Therefore, in some cases e.g. when modelling the atmosphere whose density (energy loss) is small w.r.t. to rocks, this can be a convenient approximation.

Synopsis

pumas.GradientMedium(
    material, {lambda=, (axis)=, (magnet)=, (rho0)=}, (type)=, (z0)=})

Arguments

Name Type Description
material string Name of the filling material.
lambda number Gradient \lambda parameter, in m (see above).
(axis) Coordinates, table or string Coordinates of the gradient axis in the simulation frame or 'vertical' if the gradient axis is defined by the Earth local vertical. Defaults to 'vertical'.
(magnet) Coordinates or table Magnetic field coordinates in the simulation frame, in T. Defaults to {0, 0, 0} T.
(rhoØ) number Gradient \rho_0 parameter, in kg/m3 (see above). Defaults to the material's density.
(type) string Gradient type, i.e. 'linear' or 'exponential'. Defaults to 'exponential'.
() number Gradient z_0 parameter, in m (see above). Defaults to zero.

Note

The filling material must reference a TabulatedMaterial of the Physics used for the simulation.

Note

The local magnetic field is superimposed over (added to) any magnetic field defined by the geometry.


See also

transparent_medium, UniformMedium.

GradientMedium.density

Get the medium density, in \text{kg} / \text{m}^3, at a given location. The location can be provided as a Coordinates object or as a simulation State object. In the latter case the state.position is considered for the location.

Synopsis

GradientMedium:density(state)

GradientMedium:density(coordinates)

Arguments

Name Type Description
state State Simulation state. The state.position is considered for the computation of the density value.
coordinates Coordinates Point coordinates, in m.

Returns

Type Description
number Medium density at the requested location, in \text{kg} / \text{m}^3.