-
Notifications
You must be signed in to change notification settings - Fork 29
Units
AthenaK
code units are dimensionless. The <units>
infrastructure is designed to convert physical variables to an equivalent dimensionless quantity in code by a scaling factor, and vice versa. For any variable
For a unit system, the basic units include:
- length unit,
$l_0$ - time unit,
$t_0$ - mass unit,
$m_0$
Then, other units can be derived from these three units, e.g., velocity unit
The units system is initialized by the <units>
block in the input file, including length, length_cgs
, mass, mass_cgs
, and time, time_cgs
. As an option, mean molecular weight can also be initialized by mu
. Default units are cgs units with <units>
block is added.
As an example, for simulations of the interstellar medium, a useful unit system is
<units>
length_cgs = 3.0856775809623245e+18 # length is 1 pc
mass_cgs = 6.195900228622575e+31 # number density is 1 cm^-3
time_cgs = 3.15576e+13 # time is 1 Myr
mu = 1.27 # mean molecular weight
In General Relativistic (Magneto)hydrodynamics, the system of equations are scale invariant. In this way, there exists freedom in manipulating, in any one simulation, (1) the density scale
In General Relativistic Radiation (Magneto)hydrodynamics (see Radiation), however, the system of equations are no longer scale invariant. Thus, one must specify the relevant physical scales in the problem. Rather than specifying a length unit
<units>
density_cgs = 1.0e-2 # density unit in g/cm3
bhmass_msun = 10.0 # black hole mass in solar masses
mu = 0.5 # mean molecular weight (in amu)
**Note: In the above, note that the black hole mass must be specified in solar masses. The conversion of the black hole mass to cgs units is handled by the Units
API.
In the codebase, one will notice that no Units
member enters in the case of General Relativistic (Magneto)hydrodynamics (which makes sense given the scale invariance). However, in the case of General Relativistic Radiation (Magneto)hydrodynamics, if the <units>
block is specified, units are heavily used in the radiation source term (see the Coupling section of Radiation).
Getting Started
Running
User Guide
Physics Modules