Commit 882305fe authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Use eos.isothermal_internal_energy instead of the old constant everywhere in gizmo as well.

parent b35e7191
......@@ -131,7 +131,7 @@ __attribute__((always_inline)) INLINE static void hydro_first_init_part(
energy (as in Gadget) */
#if defined(EOS_ISOTHERMAL_GAS)
/* this overwrites the internal energy from the initial condition file */
p->conserved.energy = mass * const_isothermal_internal_energy;
p->conserved.energy = mass * eos.isothermal_internal_energy;
#else
p->conserved.energy *= mass;
#endif
......@@ -608,7 +608,7 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
p->conserved.momentum[1] += p->conserved.flux.momentum[1];
p->conserved.momentum[2] += p->conserved.flux.momentum[2];
#if defined(EOS_ISOTHERMAL_GAS)
p->conserved.energy = p->conserved.mass * const_isothermal_internal_energy;
p->conserved.energy = p->conserved.mass * eos.isothermal_internal_energy;
#else
p->conserved.energy += p->conserved.flux.energy;
#endif
......@@ -709,9 +709,9 @@ __attribute__((always_inline)) INLINE static float hydro_get_internal_energy(
if (p->primitives.rho > 0.) {
#ifdef EOS_ISOTHERMAL_GAS
return p->primitives.P / hydro_gamma_minus_one / p->primitives.rho;
return eos.isothermal_internal_energy;
#else
return const_isothermal_internal_energy;
return p->primitives.P / hydro_gamma_minus_one / p->primitives.rho;
#endif
} else {
return 0.;
......@@ -743,7 +743,7 @@ __attribute__((always_inline)) INLINE static float hydro_get_soundspeed(
if (p->primitives.rho > 0.) {
#ifdef EOS_ISOTHERMAL_GAS
return sqrtf(const_isothermal_internal_energy * hydro_gamma *
return sqrtf(eos.isothermal_internal_energy * hydro_gamma *
hydro_gamma_minus_one);
#else
return sqrtf(hydro_gamma * p->primitives.P / p->primitives.rho);
......
......@@ -18,6 +18,7 @@
******************************************************************************/
#include "adiabatic_index.h"
#include "equation_of_state.h"
#include "hydro_flux_limiters.h"
#include "hydro_gradients.h"
#include "hydro_slope_limiters.h"
......@@ -73,7 +74,7 @@ void hydro_read_particles(struct part* parts, struct io_props* list,
float convert_u(struct engine* e, struct part* p) {
if (p->primitives.rho > 0.) {
#ifdef EOS_ISOTHERMAL_GAS
return const_isothermal_internal_energy;
return eos.isothermal_internal_energy;
#else
return p->primitives.P / hydro_gamma_minus_one / p->primitives.rho;
#endif
......
......@@ -78,7 +78,7 @@ int main() {
engine.nr_threads = 1;
engine.nodeID = 0;
engine_rank = 0;
struct runner runner;
runner.e = &engine;
......
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