From d591aeee5f81caba330ce745afed35504b31ed77 Mon Sep 17 00:00:00 2001 From: Josh Borrow Date: Wed, 14 Aug 2019 14:56:43 +0100 Subject: [PATCH] Adds v_sig calculation to force loop in ANARCHY-DU --- src/hydro/AnarchyDU/hydro_iact.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/hydro/AnarchyDU/hydro_iact.h b/src/hydro/AnarchyDU/hydro_iact.h index 19489f746..09ecde01d 100644 --- a/src/hydro/AnarchyDU/hydro_iact.h +++ b/src/hydro/AnarchyDU/hydro_iact.h @@ -428,6 +428,12 @@ __attribute__((always_inline)) INLINE static void runner_iact_force( /* Get the time derivative for h. */ pi->force.h_dt -= mj * dvdr * r_inv / rhoj * wi_dr; pj->force.h_dt -= mi * dvdr * r_inv / rhoi * wj_dr; + + /* Update if we need to; this should be guaranteed by the gradient loop but + * due to some possible synchronisation problems this is here as a _quick + * fix_. Added: 14th August 2019. To be removed by 1st Jan 2020. (JB) */ + pi->viscosity.v_sig = max(pi->viscosity.v_sig, v_sig); + pj->viscosity.v_sig = max(pj->viscosity.v_sig, v_sig); } /** @@ -547,6 +553,11 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force( /* Get the time derivative for h. */ pi->force.h_dt -= mj * dvdr * r_inv / rhoj * wi_dr; + + /* Update if we need to; this should be guaranteed by the gradient loop but + * due to some possible synchronisation problems this is here as a _quick + * fix_. Added: 14th August 2019. To be removed by 1st Jan 2020. (JB) */ + pi->viscosity.v_sig = max(pi->viscosity.v_sig, v_sig); } /** -- GitLab