Commit c69268c3 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'gizmo_set_internal_energy' into 'master'

Gizmo set internal energy

This updates both the conserved and the primitive variables in `hydro_set_internal_energy()` and `hydro_set_entropy()`, and closes #221.

See merge request !265
parents 91adabde 1299396b
......@@ -524,6 +524,7 @@ __attribute__((always_inline)) INLINE static void hydro_set_internal_energy(
/* conserved.energy is NOT the specific energy (u), but the total thermal
energy (u*m) */
p->conserved.energy = u * p->conserved.mass;
p->primitives.P = hydro_gamma_minus_one * p->primitives.rho * u;
}
/**
......@@ -540,4 +541,5 @@ __attribute__((always_inline)) INLINE static void hydro_set_entropy(
p->conserved.energy = gas_internal_energy_from_entropy(p->primitives.rho, S) *
p->conserved.mass;
p->primitives.P = gas_pressure_from_entropy(p->primitives.rho, S);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment