Units and Conventions¶
Nyx supports both CGS and Cosmological units. In the equation of state calls, conversions must be made between CGS units and code units. Table [table:units] shows some of the common symbols / names used throughout the code documentation and papers.
name | units | description |
---|---|---|
\(t\) | s | time |
\(\rho\) | \(\gcc\) | mass density |
\(\ub\) | \(\cms\) | velocity vector |
\(p\) | \(\presunit\) | pressure |
\(\gb\) | \(\accelunit\) | gravitational acceleration |
\(\Sb\) | varies | source term |
\(S_{\Lambda}\) | varies | source term |
\(E\) | \(\ergg\) | specific total energy |
\(e\) | \(\ergg\) | specific internal energy |
\(T\) | \(K\) | temperature |
words
We support two different systems of units in : CGS and Cosmological. All inputs and problem initialization should be specified consistently with one of these sets of units. No internal conversions of units occur within the code, so the output must be interpreted appropriately. The default is cosmological units. If you want to use CGS units instead, then set USE_CGS = TRUE in your GNUmakefile. This will select the file constants_cgs.f90 instead of constants_cosmo.f90 from the Nyx/constants directory.
Location | Variable | CGS | Cosmologica l | Conversion Data |
inputs file | geometry. prob_lo | cm | Mpc | 1Mpc = 3.08568025e 24 cm |
geometry. prob_hi | cm | Mpc | 1Mpc = 3.08568025e 24 cm | |
Hydro Initializat ion | density | g / cm:math:` ^3` | M\(_ \odot\) / Mpc:math: ^3 | 1 (M:math:_odot / Mpc:math: ^3) = .06769624e- 39 (g/cm:math: ^3) |
Hydro Initializat ion | velocities | cm/s | km/s | 1km = 1.e5 cm |
Hydro Initializat ion | momenta | (g/cm:math: ^3) (cm/s) | (M:math:_odot/Mpc:m ath:^3) (km/s) | 1km = 1.e5 cm |
1 (M:math:_odot / Mpc:math: ^3) = .06769624e- 39 g/cm:math :^3 | ||||
Hydro Initializat ion | temperature | K | K | 1 |
Hydro Initializat ion | specific energy (\(e\) or \(E\)) | erg/g= (cm/s):math :^2 | (km/s):math :^2 | 1 (km/s):math :^2 = 1.e10 (cm/s):math :^2 |
Hydro Initializat ion | energy (\(\rh o e\) or :math:`rho
|
erg / cm:math:` ^3 =` | (M:math:_odot/Mpc:m ath:^3) (km/s):math :^2 | 1 (km/s):math :^2 = 1.e10 (cm/s):math :^2 |
(g/cm:math: ^3) (cm/s):math :^2 | 1 (M:math:_odot / Mpc:math: ^3) = .06769624e- 39 g/cm:math :^3 | |||
Particle Initializat ion | particle mass | g | M\(_ \odot\) | 1 M\(_ \odot\) = 1.98892e33 g |
Particle Initializat ion | particle locations | cm | Mpc | 1 Mpc = 3.08568025e 24 cm |
Particle Initializat ion | particle velocities | cm/s | km/s | 1 km = 1e5 cm |
Output | Pressure | g (cm/s):math :^2 / cm:math:` ^3` | M\(_ \odot\) (km/s):math :^2 / Mpc:math: ^3 | 1 M\(_ \odot\) (km/s):math :^2 / Mpc:math: ^3 = |
.06769624e- 29 g (cm/s):math :^2 / cm:math:` ^3` | ||||
Output | Gravity | (cm/s) / s | (km/s):math :^2 / Mpc | 1 M\(_ \odot\) (km/s):math :^2 / Mpc:math: ^3 = |
Output | Time | s | (Mpc/km) s | 1 Mpc = 3.08568025e 19 km |
[Table:Inputs]
The only other place that dimensional numbers are used in the code is in the tracing and Riemann solve. We set three small numbers which need to be consistent with the data specified. Each of these can be specified in the inputs file.
- small_dens – small value for density
- small_p – small value for pressure
- small_T – small value for temperature
These are the places that each is used in the code:
small_dens
- subroutine enforce_minimum_density (called after subroutine consup) – there are two choices for this. In the flooring routine,subroutine enforce_minimum_density_floor – density is set to small_dens, (rho e) and (rho E) are computed from small_temp,and momenta are set to zero. In the conservative routine, subroutine enforce_minimum_density_cons, an iterative procedureis used to create diffusive fluxes that adjusts all the variables conservatively until density is greater than small_dens.
- subroutine tracexy / tracez / tracexy_ppm / tracez_ppm:qxp = max(qxp,small_dens)qxm = max(qxm,small_dens)and analogously for qyp/qym and qzp/qzm. This only modifies density inside the tracing, not the other variables
subroutine riemannus – we set
wsmall = small_dens * csmall
and then
wl = max(wsmall, sqrt(gaml * pl * rl))wr = max(wsmall, sqrt(gamr * pr * rr))Also, we set
ro = max(small_dens,ro)
where ro = 0.5 * (rl + rr) – this state is only chosen when ustar = 0, and
rstar = max(small_dens,rstar)
where rstar = ro + (pstar-po)/co:math:^2
subroutine react_state – only compute reaction if \(\rho >\) small_dens
small_temp:
- subroutine ctoprim: if \(\rho e < 0\), thencall subroutine nyx_eos_given_RTX (e,…,small_temp,…) in order to compute a new energy, \(e\).This energy is then used tocall subroutine nyx_eos_given_ReX in order to compute the sound speed, \(c.\)Coming out of this the temperature is equal to small_temp and the energy \(e\) has been reset.
- subroutine react_state: if \(\rho e < 0\), thencall subroutine nyx_eos_given_RTX (e,…,small_temp,…) in order to compute a new energy, \(e\).This energy is then used to proceed with the burner routine.
- subroutine reset_internal_energy: if \(e < 0\) and \(E - ke < 0\) thencall subroutine nyx_eos_given_RTX (e,…,small_temp,…) in order to compute a new energy, \(e\). This energy is also used todefine a new \(E = e + ke\)
small_pres:
subroutine riemannus – we set
pstar = max(small_pres,pstar)pgdnv = max(small_pres,pgdnv). Note that pgdnv is the pressure explicitly used in the fluxes.subroutine uflaten – small_pres is used to keep the denominator away from zero
Everywhere we define values of pressure on a face, we set that value to be at least small_pres.