Skip to content
Snippets Groups Projects
Commit 8d48e6aa authored by Bert Vandenbroucke's avatar Bert Vandenbroucke
Browse files

Implemented correct drifted velocity getter for gizmo.

parent 1cefa9b3
Branches
Tags
1 merge request!474Make the hydro schemes compute the dirfted velocities themselves when collecting statistics.
...@@ -764,7 +764,17 @@ __attribute__((always_inline)) INLINE static float hydro_get_mass( ...@@ -764,7 +764,17 @@ __attribute__((always_inline)) INLINE static float hydro_get_mass(
*/ */
__attribute__((always_inline)) INLINE static void hydro_get_drifted_velocities( __attribute__((always_inline)) INLINE static void hydro_get_drifted_velocities(
const struct part* restrict p, const struct xpart* xp, float dt, const struct part* restrict p, const struct xpart* xp, float dt,
float v[3]) {} float v[3]) {
if (p->conserved.mass > 0.) {
v[0] = p->primitives.v[0] +
p->conserved.flux.momentum[0] * dt / p->conserved.mass;
v[1] = p->primitives.v[1] +
p->conserved.flux.momentum[1] * dt / p->conserved.mass;
v[2] = p->primitives.v[2] +
p->conserved.flux.momentum[2] * dt / p->conserved.mass;
}
}
/** /**
* @brief Returns the density of a particle * @brief Returns the density of a particle
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment