From 8d48e6aa2fc1fbf19c8085b1d65d34dfcf3a9473 Mon Sep 17 00:00:00 2001 From: Bert Vandenbroucke <bert.vandenbroucke@ugent.be> Date: Tue, 19 Dec 2017 17:52:28 +0100 Subject: [PATCH] Implemented correct drifted velocity getter for gizmo. --- src/hydro/Gizmo/hydro.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/hydro/Gizmo/hydro.h b/src/hydro/Gizmo/hydro.h index 920556114a..a30cc1c5a1 100644 --- a/src/hydro/Gizmo/hydro.h +++ b/src/hydro/Gizmo/hydro.h @@ -764,7 +764,17 @@ __attribute__((always_inline)) INLINE static float hydro_get_mass( */ __attribute__((always_inline)) INLINE static void hydro_get_drifted_velocities( 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 -- GitLab