Normalization#
Struphy models are implemented in normalized variables. In general, any dependent or independent variable \(X\) is expressed as
where \(\hat X\) is the unit and \(X'\) is the numerical value appearing in the code. For example, the same length \(a\) could be either expressed as \(a = 2 \cdot 1\, \textrm{meter}\) or as \(a = 4 \cdot 0.5\, \textrm{meter}\), where in the second case the unit of length was chosen to be 0.5 meter.
The units \(\hat X\) for a Struphy model
can be influenced by the user through BaseUnits in the launch file,
where the user can set
the unit of length \(\hat x\), expressed in Meter,
the unit of the magnetic field strength \(\hat B\), expressed in Tesla,
the unit of number density \(\hat n\), expressed in \(\mathbf{10^{20}\,m^{-3}}\).
optional: the unit of thermal energy \(k_\textnormal{B} \hat T\), expressed in keV.
This immediately gives meaning to the numerical values of these quantities appearing in the parameter file. Additionally,
the unit of velocity \(\hat v\), expressed in Meters/Second,
is hard coded for each model
under the attribute velocity_scale.
There are four possibilities:
speed of
light, \(\hat v = c\).alfvénspeed of the bulk species,
cyclotronspeed of the bulk species,
thermalvelocity of the bulk species,
Several additional units are derived internally from the above basic units,
in the class Units. In particular,
the time unit in Seconds:
the pressure unit in Pascal:
which is equal to \(\hat B^2/\mu_0\) if the velocity scale is Alfvén,
the mass density unit in \(\mathbf{kg/m^3}\):
the current density unit in Ampere\(\boldsymbol{/m^2}\):
We refer to Example: Vlasov-Maxwell-Poisson discretization for an example of how to derive a normalization for a physics model.
Units class#
- class struphy.io.options.Units(base: BaseUnits | None = None)[source]#
Colllects base units and derives other units from these. See Normalization.
- property x#
- property B#
- property n#
Unit of particle number density in 1/m^3.
- property kBT#
- property v#
Unit of velocity in m/s.
- property t#
Unit of time in s.
- property p#
Unit of pressure in Pa, equal to B^2/mu0 if velocity_scale=’alfvén’.
- property rho#
Unit of mass density in kg/m^3.
- property j#
Unit of current density in A/m^2.
Equation parameters#
In Struphy models, the following equation parameters appear:
featuring the plasma- and cyclotron frequency of species \(\textrm{s}\), respectively,
where \(Z_\textrm{s}\) and \(A_\textrm{s}\) stand for the species’ charge and mass number, respectively.
These equation parameters are defined in EquationParameters and can be overridden
in the launch file via set_phys_params().