Skip to content
Snippets Groups Projects

Test 125

Merged Matthieu Schaller requested to merge test_125 into master
+ 988
45
Compare changes
  • Side-by-side
  • Inline
Files
+ 38
0
@@ -20,6 +20,8 @@
#include "adiabatic_index.h"
#include "approx_math.h"
#include <float.h>
/**
* @brief Computes the hydro time-step of a given particle
*
@@ -263,3 +265,39 @@ __attribute__((always_inline)) INLINE static float hydro_get_internal_energy(
return p->u;
}
/**
* @brief Returns the pressure of a particle
*
* @param p The particle of interest
* @param dt Time since the last kick
*/
__attribute__((always_inline)) INLINE static float hydro_get_pressure(
const struct part *restrict p, float dt) {
return p->force.P_over_rho2 * p->rho * p->rho / p->rho_dh;
}
/**
* @brief Returns the entropy of a particle
*
* @param p The particle of interest
* @param dt Time since the last kick
*/
__attribute__((always_inline)) INLINE static float hydro_get_entropy(
const struct part *restrict p, float dt) {
return hydro_gamma_minus_one * p->u * pow_minus_gamma_minus_one(p->rho);
}
/**
* @brief Returns the sound speed of a particle
*
* @param p The particle of interest
* @param dt Time since the last kick
*/
__attribute__((always_inline)) INLINE static float hydro_get_soundspeed(
const struct part *restrict p, float dt) {
return p->force.soundspeed;
}
Loading