Skip to content
Snippets Groups Projects
Commit 4517ef2b authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

When converting internal energy to entropy at startup, apply the correct cosmology factor.

parent 1873154b
No related branches found
No related tags found
1 merge request!516More cosmology work
......@@ -545,13 +545,18 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
*
* Requires the density to be known
*
* @param p The particle to act upon
* @param p The particle to act upon.
* @param xp The extended data.
* @param cosmo The cosmological model.
*/
__attribute__((always_inline)) INLINE static void hydro_convert_quantities(
struct part *restrict p, struct xpart *restrict xp) {
struct part *restrict p, struct xpart *restrict xp,
const struct cosmology *cosmo) {
/* We read u in the entropy field. We now get S from u */
xp->entropy_full = gas_entropy_from_internal_energy(p->rho, p->entropy);
/* We read u in the entropy field. We now get (comoving) S from (physical) u
* and (physical) rho. Note that comoving S == physical S */
xp->entropy_full =
gas_entropy_from_internal_energy(p->rho * cosmo->a3_inv, p->entropy);
p->entropy = xp->entropy_full;
/* Compute the pressure */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment