Skip to content

Runtime Parameters: Units

Hsi-Yu Schive edited this page Jun 10, 2024 · 5 revisions

Compilation Options

Related options: COMOVING  

Runtime Parameters

Parameters described on this page: OPT__UNIT,   UNIT_L,   UNIT_M,   UNIT_T,   UNIT_V,   UNIT_D  

Other related parameters: NEWTON_G,   ELBDM_MASS,   ELBDM_PLANCK_CONST  

Parameters below are shown in the format:   Name   (Valid Values)   [Default Value]

  • UNIT_L   (>0.0; ≤0.0 → set by other units)   [none]

  • UNIT_M   (>0.0; ≤0.0 → set by other units)   [none]

  • UNIT_T   (>0.0; ≤0.0 → set by other units)   [none]

  • UNIT_V   (>0.0; ≤0.0 → set by other units)   [none]

  • UNIT_D   (>0.0; ≤0.0 → set by other units)   [none]

Remarks

Unit Consistency

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).

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;.

Units in Cosmological Simulations

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 = 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.

Links

Clone this wiki locally