Units

Aether.Units.CodeUnitsType
struct CodeUnits{FT}
CodeUnits(FT = Float64; length, mean_molecular_weight,
          mass = nothing, density = nothing,
          time = nothing, velocity = nothing)

The code's unit system: what one code unit of length, mass, and time is in cgs, plus the gas mean molecular weight $\mu$ that closes the map to temperature and particle number. Multiplying a code value by the matching *_unit accessor gives cgs; everything beyond the three base scales is derived, e.g. $T =$ temperature_unit $\cdot (\gamma-1)e/\rho$ with temperature_unit $= \mu m_u\,v^2 / k_B$.

Give length and one of each pair — mass or density ($M = \rho L^3$), time or velocity ($t = L/v$) — in cgs; astrophysical inputs compose from the module constants, e.g. length = 100 * Units.pc. mean_molecular_weight has no default: choose it for the gas being modeled (≈ 0.62 ionized, ≈ 1.27 neutral atomic ISM).

using Aether

CodeUnits(length = Units.pc, velocity = 1e5, density = 1.27 * Units.mᵤ,
          mean_molecular_weight = 1.27)

# output
CodeUnits{Float64}(length = 3.0856775814913674e18 cm, mass = 6.195900783662613e31 g, time = 3.0856775814913676e13 s, μ = 1.27)
source
Aether.Units.temperature_unitFunction
temperature_unit(units::CodeUnits{FT}) -> Any

Kelvin per code temperature $p/\rho$: $T = \mu m_u v^2/k_B \cdot (p/\rho)$. The physical constants enter in Float64 and the result rounds to the unit system's float type.

using Aether

units = CodeUnits(length = Units.pc, velocity = 1e5, density = 1.27 * Units.mᵤ,
                  mean_molecular_weight = 1.27)
temperature_unit(units)

# output
152.74589106304356
source