Commit 61111a27 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'gizmo_hllc_solver_fix' into 'master'

Fixed bug in HLLC Riemann solver flux calculation.

This fixes #216 (again, but now all cases).

I basically overlooked a tiny detail in the real GIZMO and changed the order of some operations that cannot be interchanged. Square test is now verified to work with all 3 possible Riemann solvers.

See merge request !257
parents d58bef3c af1f075e
......@@ -145,11 +145,13 @@ __attribute__((always_inline)) INLINE static void riemann_solve_for_flux(
we add the extra velocity flux due to the absolute motion of the fluid
similarly, we need to add the energy fluxes due to the absolute motion */
v2 = vij[0] * vij[0] + vij[1] * vij[1] + vij[2] * vij[2];
// order is important: we first use the momentum fluxes to update the energy
// flux and then de-boost the momentum fluxes!
totflux[4] += vij[0] * totflux[1] + vij[1] * totflux[2] +
vij[2] * totflux[3] + 0.5 * v2 * totflux[0];
totflux[1] += vij[0] * totflux[0];
totflux[2] += vij[1] * totflux[0];
totflux[3] += vij[2] * totflux[0];
totflux[4] += vij[0] * totflux[1] + vij[1] * totflux[2] +
vij[2] * totflux[3] + 0.5 * v2 * totflux[0];
}
#endif /* SWIFT_RIEMANN_HLLC_H */
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