Units - hyschive/gamer-fork GitHub Wiki
This page describes the unit system.
Related options: --comoving
When enabling units (i.e., OPT__UNIT=1), all input values (e.g., runtime parameters, refinement thresholds, and initial conditions) must be set consistently with the adopted unit system unless otherwise specified. All input physical constants (e.g., NEWTON_G, ELBDM_MASS, and ELBDM_PLANCK_CONST) will be reset automatically to conform to the adopted unit system.
The code does not distinguish external and internal units; In other words, all internal variables in the code should also conform to the same unit system (except for the predefined physical constants).
Some physical constants in CGS units are predefined in the header
include/PhysicalConstant.h with the prefix Const_. They can be
useful for unit conversion.
For example, to convert particle velocity vel_code from code units
to km/s, one can use vel_kms = vel_code*UNIT_V*Const_s/Const_km;.
When enabling --comoving, the unit system is currently fixed as follows.
- UNIT_L = h-1 Mpc, where h=HUBBLE0 is the dimensionless Hubble constant.
- UNIT_T = H0-1, where H0 = 100 h km s-1 Mpc-1 is the Hubble constant.
- UNIT_D = ρm0 = 3Ωm0H02 / 8πG, where ρm0 is the present matter density, Ωm0=OMEGA_M0 is the present matter density parameter, and G is the gravitational constant.