# Units and Conventions¶

Nyx uses a cosmological system of units based on Mpc, M\(_\odot\), and km/s for length, mass, and velocity, respectively. Temperature is given in degrees Kelvin. The unit of time is derived from velocity and length units. All inputs and problem initialization should be specified consistently with these units, and the outputs should be interpreted with these units in mind. In the equation of state calls, there is an internal conversion between cosmological and CGS units.

Table 2 shows some of the common symbols / names used throughout the code documentation and papers.

name | units | description |
---|---|---|

\(t\) | (Mpc/km) s | time |

\(\rho\) | M\(_\odot\) / Mpc\(^3\) | mass density |

\(\ub\) | km/s | velocity vector |

\(p\) | M\(_\odot\) (km/s)\(^2\) / Mpc\(^3\) | pressure |

\(\gb\) | (km/s)2 / Mpc | gravitational acceleration |

\(E\) | (km/s)\(^2\) | specific total energy |

\(e\) | (km/s)\(^2\) | specific internal energy |

\(T\) | \(K\) | temperature |

In Table 3 we list the values used for physical constants in cosmological units. Note that \(\Omega_m\), \(\Omega_b\), \(\Omega_r\) and \(h\) are set in the inputs file Comoving: List of Parameters. Full list of constants and conversion factors is set in Source/Driver/constants_cosmo.H.

Constant | Cosmological units |
---|---|

Gravitational constant (\(G\)) | 4.3019425e-9 Mpc (km/s)\(^2\) M\(_\odot^{-1}\) |

Avogadro’s number (\(n_A\)) | 1.1977558e57 M\(_\odot^{-1}\) |

Boltzmann’s constant (\(k_B\)) | 0.6941701e-59 M\(_\odot\) (km/s)\(^2\) / K |

Hubble constant (\(H\)) | 100 (km/s) / Mpc |

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
We set one *large* number which needs to be consistent with the data specified.
Each of these can be specified in the inputs file.

- small_dens – small value for density
- small_press – small value for pressure
- small_temp – small value for temperature
- large_temp – large value for temperature

These are the places that each is used in the code:

**small_dens****enforce_minimum_density**(called after subroutine consup) – there are two choices for this. In the flooring routine,**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,**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.**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 modifies the primitive density and pressure inside the tracing, not the underlying state variables**riemannus**– we setwsmall = 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

**small_temp**:**compute_new_temp**: if \(\rho e < 0\), thencall nyx_eos_given_RT (e,…,small_temp,…) in order to compute a new energy, \(e\).This energy is then used to define a new \(E = e + ke\)Coming out of this the temperature is equal to small_temp and the energy \(e\) has been reset.**reset_internal_energy**: if \(e < 0\) and \(E - ke < 0\) thencall nyx_eos_given_RT (e,…,small_temp,…) in order to compute a new energy, \(e\). This energy is also used to define a new \(E = e + ke\)

**large_temp**:**compute_new_temp**: if \(T > \mathrm{large\_temp}\), and the input flag`nyx.local_max_temp_dt=1`

thenset \(T = \mathrm{large\_temp}\) and call nyx_eos_given_RT (e,…,large_temp,…) in order to compute a new energy, \(e\).This energy is then used to define a new \(E = e + ke\)Coming out of this the temperature is equal to large_temp and the energy \(e\) has been reset.

**small_pres**:**tracexy / tracez / tracexy_ppm / tracez_ppm**:qpres = max(qpres,small_pres)for qxp/qyp, qyp/qym and qzp/qzm. This modifies the primitive density and pressure inside the tracing, not the underlying state variables**riemannus**– we setpstar = max(small_pres,pstar)pgdnv = max(small_pres,pgdnv). Note that pgdnv is the pressure explicitly used in the fluxes.**uflatten**– small_pres is used to keep the denominator away from zeroEverywhere we define values of pressure on a face, we set that value to be at least small_pres.