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

Fixed bug in HLLC Riemann solver flux calculation.

parent c10ad9db
No related branches found
No related tags found
1 merge request!257Fixed bug in HLLC Riemann solver flux calculation.
...@@ -145,11 +145,13 @@ __attribute__((always_inline)) INLINE static void riemann_solve_for_flux( ...@@ -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 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 */ 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]; 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[1] += vij[0] * totflux[0];
totflux[2] += vij[1] * totflux[0]; totflux[2] += vij[1] * totflux[0];
totflux[3] += vij[2] * 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 */ #endif /* SWIFT_RIEMANN_HLLC_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment