From cacd066b1623a1ed6367bba0052fd21f409c415e Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Sun, 15 Dec 2019 19:00:03 +0100
Subject: [PATCH] When black holes merge, accumulate the swallowed angular
 momentum from the small one onto the larger one.

---
 src/black_holes/EAGLE/black_holes.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/black_holes/EAGLE/black_holes.h b/src/black_holes/EAGLE/black_holes.h
index 4f44f11a22..541e0e94c3 100644
--- a/src/black_holes/EAGLE/black_holes.h
+++ b/src/black_holes/EAGLE/black_holes.h
@@ -337,6 +337,11 @@ __attribute__((always_inline)) INLINE static void black_holes_swallow_bpart(
   bpi->gpart->mass += bpj->mass;
   bpi->subgrid_mass += bpj->subgrid_mass;
 
+  /* Collect the swallowed angular momentum */
+  bpi->swallowed_angular_momentum[0] += bpj->swallowed_angular_momentum[0];
+  bpi->swallowed_angular_momentum[1] += bpj->swallowed_angular_momentum[1];
+  bpi->swallowed_angular_momentum[2] += bpj->swallowed_angular_momentum[2];
+
   /* Update the BH momentum */
   const float BH_mom[3] = {bpi_dyn_mass * bpi->v[0] + bpj_dyn_mass * bpj->v[0],
                            bpi_dyn_mass * bpi->v[1] + bpj_dyn_mass * bpj->v[1],
-- 
GitLab