From 1a8c39aa96e35a15a4b96d7d53431c6fb335c1b3 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Sat, 8 Jun 2019 14:45:55 +0200
Subject: [PATCH] Make the minimal smoothing length used by SWIFT to match the
 Gadget definition of the kernel support being a fixed fraction of the
 softening kernel support and not use 'h' directly.

---
 src/hydro_properties.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/hydro_properties.c b/src/hydro_properties.c
index 604a61f1a7..0082546ce1 100644
--- a/src/hydro_properties.c
+++ b/src/hydro_properties.c
@@ -332,8 +332,13 @@ void hydro_props_init_no_hydro(struct hydro_props *p) {
 void hydro_props_update(struct hydro_props *p, const struct gravity_props *gp,
                         const struct cosmology *cosmo) {
 
-  /* Update the minimal allowed smoothing length */
-  p->h_min = p->h_min_ratio * gp->epsilon_cur;
+  /* Update the minimal allowed smoothing length
+   *
+   * We follow Gadget here and demand that the kernel support (h * gamma)
+   * is a fixed fraction of the radius at which the softened forces
+   * recover a Newtonian behaviour (i.e. 2.8 * Plummer equivalent softening
+   * in the case of a cubic spline kernel). */
+  p->h_min = p->h_min_ratio * gp->epsilon_cur / kernel_gamma;
 }
 
 /**
-- 
GitLab