From c7378f2cfdb15fbcfa791f654e1d23de7feec710 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <matthieu.schaller@durham.ac.uk>
Date: Wed, 13 Jul 2016 18:57:49 +0100
Subject: [PATCH] Time integration mistake ?

---
 src/hydro/Gadget2/hydro.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/hydro/Gadget2/hydro.h b/src/hydro/Gadget2/hydro.h
index 0973acb0fb..8593e75aec 100644
--- a/src/hydro/Gadget2/hydro.h
+++ b/src/hydro/Gadget2/hydro.h
@@ -218,8 +218,8 @@ __attribute__((always_inline)) INLINE static void hydro_kick_extra(
     p->entropy *= 0.5f;
 
   /* Do not 'overcool' when timestep increases */
-  if (p->entropy + 0.5f * p->entropy_dt * dt < 0.5f * p->entropy)
-    p->entropy_dt = -0.5f * p->entropy / dt;
+  if (p->entropy + p->entropy_dt * half_dt < 0.5f * p->entropy)
+    p->entropy_dt = -0.5f * p->entropy / half_dt;
 }
 
 /**
-- 
GitLab