From 06cd503964a474c02111025d537879a5329bdab3 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Thu, 15 Oct 2020 14:36:36 +0200
Subject: [PATCH] In the EAGLE BH model: multi_phase_bondi -->
 use_multi_phase_bondi && subgrid_bondi --> use_subgrid_bondi

---
 examples/EAGLE_ICs/EAGLE_100/eagle_100.yml       |  4 ++--
 examples/EAGLE_ICs/EAGLE_12/eagle_12.yml         |  4 ++--
 examples/EAGLE_ICs/EAGLE_25/eagle_25.yml         |  4 ++--
 examples/EAGLE_ICs/EAGLE_50/eagle_50.yml         |  4 ++--
 examples/EAGLE_ICs/EAGLE_50_low_res/eagle_50.yml |  4 ++--
 examples/EAGLE_ICs/EAGLE_6/eagle_6.yml           |  4 ++--
 examples/parameter_example.yml                   |  4 ++--
 src/black_holes/EAGLE/black_holes.h              |  4 ++--
 src/black_holes/EAGLE/black_holes_iact.h         |  2 +-
 src/black_holes/EAGLE/black_holes_properties.h   | 13 +++++++------
 10 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/examples/EAGLE_ICs/EAGLE_100/eagle_100.yml b/examples/EAGLE_ICs/EAGLE_100/eagle_100.yml
index 6349f90ac8..407e17d17c 100644
--- a/examples/EAGLE_ICs/EAGLE_100/eagle_100.yml
+++ b/examples/EAGLE_ICs/EAGLE_100/eagle_100.yml
@@ -208,8 +208,8 @@ EAGLEFeedback:
 # EAGLE AGN model
 EAGLEAGN:
   subgrid_seed_mass_Msun:             1.0e4      # Black hole subgrid mass at creation time in solar masses.
-  multi_phase_bondi:                  0          # Compute Bondi rates per neighbour particle?
-  subgrid_bondi:                      0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
+  use_multi_phase_bondi:              0          # Compute Bondi rates per neighbour particle?
+  use_subgrid_bondi:                  0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
   with_angmom_limiter:                0          # Are we applying the Rosas-Guevara et al. (2015) viscous time-scale reduction term?
   viscous_alpha:                      1e6        # Normalisation constant of the viscous time-scale in the accretion reduction term
   with_boost_factor:                  0          # Are we using the model from Booth & Schaye (2009)?
diff --git a/examples/EAGLE_ICs/EAGLE_12/eagle_12.yml b/examples/EAGLE_ICs/EAGLE_12/eagle_12.yml
index 8c706d9c1b..313423e643 100644
--- a/examples/EAGLE_ICs/EAGLE_12/eagle_12.yml
+++ b/examples/EAGLE_ICs/EAGLE_12/eagle_12.yml
@@ -207,8 +207,8 @@ EAGLEFeedback:
 # EAGLE AGN model
 EAGLEAGN:
   subgrid_seed_mass_Msun:             1.0e4      # Black hole subgrid mass at creation time in solar masses.
-  multi_phase_bondi:                  0          # Compute Bondi rates per neighbour particle?
-  subgrid_bondi:                      0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
+  use_multi_phase_bondi:              0          # Compute Bondi rates per neighbour particle?
+  use_subgrid_bondi:                  0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
   with_angmom_limiter:                0          # Are we applying the Rosas-Guevara et al. (2015) viscous time-scale reduction term?
   viscous_alpha:                      1e6        # Normalisation constant of the viscous time-scale in the accretion reduction term
   with_boost_factor:                  0          # Are we using the model from Booth & Schaye (2009)?
diff --git a/examples/EAGLE_ICs/EAGLE_25/eagle_25.yml b/examples/EAGLE_ICs/EAGLE_25/eagle_25.yml
index 55f0d5b040..bcb86b07c6 100644
--- a/examples/EAGLE_ICs/EAGLE_25/eagle_25.yml
+++ b/examples/EAGLE_ICs/EAGLE_25/eagle_25.yml
@@ -207,8 +207,8 @@ EAGLEFeedback:
 # EAGLE AGN model
 EAGLEAGN:
   subgrid_seed_mass_Msun:             1.0e4      # Black hole subgrid mass at creation time in solar masses.
-  multi_phase_bondi:                  0          # Compute Bondi rates per neighbour particle?
-  subgrid_bondi:                      0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
+  use_multi_phase_bondi:              0          # Compute Bondi rates per neighbour particle?
+  use_subgrid_bondi:                  0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
   with_angmom_limiter:                0          # Are we applying the Rosas-Guevara et al. (2015) viscous time-scale reduction term?
   viscous_alpha:                      1e6        # Normalisation constant of the viscous time-scale in the accretion reduction term
   with_boost_factor:                  0          # Are we using the model from Booth & Schaye (2009)?
diff --git a/examples/EAGLE_ICs/EAGLE_50/eagle_50.yml b/examples/EAGLE_ICs/EAGLE_50/eagle_50.yml
index 902fe26a15..81f61af9b5 100644
--- a/examples/EAGLE_ICs/EAGLE_50/eagle_50.yml
+++ b/examples/EAGLE_ICs/EAGLE_50/eagle_50.yml
@@ -205,8 +205,8 @@ EAGLEFeedback:
 # EAGLE AGN model
 EAGLEAGN:
   subgrid_seed_mass_Msun:             1.0e4      # Black hole subgrid mass at creation time in solar masses.
-  multi_phase_bondi:                  0          # Compute Bondi rates per neighbour particle?
-  subgrid_bondi:                      0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
+  use_multi_phase_bondi:              0          # Compute Bondi rates per neighbour particle?
+  use_subgrid_bondi:                  0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
   with_angmom_limiter:                0          # Are we applying the Rosas-Guevara et al. (2015) viscous time-scale reduction term?
   viscous_alpha:                      1e6        # Normalisation constant of the viscous time-scale in the accretion reduction term
   with_boost_factor:                  0          # Are we using the model from Booth & Schaye (2009)?
diff --git a/examples/EAGLE_ICs/EAGLE_50_low_res/eagle_50.yml b/examples/EAGLE_ICs/EAGLE_50_low_res/eagle_50.yml
index 0c5425562e..dc11c21cb2 100644
--- a/examples/EAGLE_ICs/EAGLE_50_low_res/eagle_50.yml
+++ b/examples/EAGLE_ICs/EAGLE_50_low_res/eagle_50.yml
@@ -204,8 +204,8 @@ EAGLEFeedback:
 # EAGLE AGN model
 EAGLEAGN:
   subgrid_seed_mass_Msun:             1.0e4      # Black hole subgrid mass at creation time in solar masses.
-  multi_phase_bondi:                  0          # Compute Bondi rates per neighbour particle?
-  subgrid_bondi:                      0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
+  use_multi_phase_bondi:              0          # Compute Bondi rates per neighbour particle?
+  use_subgrid_bondi:                  0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
   with_angmom_limiter:                0          # Are we applying the Rosas-Guevara et al. (2015) viscous time-scale reduction term?
   viscous_alpha:                      1e6        # Normalisation constant of the viscous time-scale in the accretion reduction term
   with_boost_factor:                  0          # Are we using the model from Booth & Schaye (2009)?
diff --git a/examples/EAGLE_ICs/EAGLE_6/eagle_6.yml b/examples/EAGLE_ICs/EAGLE_6/eagle_6.yml
index f999e27fc5..2da932903b 100644
--- a/examples/EAGLE_ICs/EAGLE_6/eagle_6.yml
+++ b/examples/EAGLE_ICs/EAGLE_6/eagle_6.yml
@@ -207,8 +207,8 @@ EAGLEFeedback:
 # EAGLE AGN model
 EAGLEAGN:
   subgrid_seed_mass_Msun:             1.0e4      # Black hole subgrid mass at creation time in solar masses.
-  multi_phase_bondi:                  0          # Compute Bondi rates per neighbour particle?
-  subgrid_bondi:                      0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
+  use_multi_phase_bondi:              0          # Compute Bondi rates per neighbour particle?
+  use_subgrid_bondi:                  0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
   with_angmom_limiter:                0          # Are we applying the Rosas-Guevara et al. (2015) viscous time-scale reduction term?
   viscous_alpha:                      1e6        # Normalisation constant of the viscous time-scale in the accretion reduction term
   with_boost_factor:                  0          # Are we using the model from Booth & Schaye (2009)?
diff --git a/examples/parameter_example.yml b/examples/parameter_example.yml
index 4fc2e9af04..bda62f76a0 100644
--- a/examples/parameter_example.yml
+++ b/examples/parameter_example.yml
@@ -550,8 +550,8 @@ EAGLEAGN:
   subgrid_seed_mass_Msun:             1.5e5      # Black hole subgrid mass at creation time in solar masses.
   use_subgrid_mass_from_ics:          1          # (Optional) Use subgrid masses specified in ICs [1, default], or initialise them to particle masses [0]?
   with_subgrid_mass_check:            1          # (Optional) Verify that initial black hole subgrid masses are positive [1, default]. Only used if use_subgrid_mass_from_ics is 1.
-  multi_phase_bondi:                  0          # Compute Bondi rates per neighbour particle?
-  subgrid_bondi:                      0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
+  use_multi_phase_bondi:              0          # Compute Bondi rates per neighbour particle?
+  use_subgrid_bondi:                  0          # Compute Bondi rates using the subgrid extrapolation of the gas properties around the BH?
   with_angmom_limiter:                1          # Are we applying the Rosas-Guevara et al. (2015) viscous time-scale reduction term?
   viscous_alpha:                      1e6        # Normalisation constant of the viscous time-scale in the accretion reduction term
   with_boost_factor:                  0          # Are we using the model from Booth & Schaye (2009)?
diff --git a/src/black_holes/EAGLE/black_holes.h b/src/black_holes/EAGLE/black_holes.h
index 2e8e0e1dd1..749c9731cd 100644
--- a/src/black_holes/EAGLE/black_holes.h
+++ b/src/black_holes/EAGLE/black_holes.h
@@ -641,7 +641,7 @@ __attribute__((always_inline)) INLINE static void black_holes_prepare_feedback(
   /* We can now compute the Bondi accretion rate (internal units) */
   double Bondi_rate;
 
-  if (props->multi_phase_bondi) {
+  if (props->use_multi_phase_bondi) {
 
     /* In this case, we are in 'multi-phase-Bondi' mode -- otherwise,
      * the accretion_rate is still zero (was initialised to this) */
@@ -664,7 +664,7 @@ __attribute__((always_inline)) INLINE static void black_holes_prepare_feedback(
                                gas_v_phys[1] * gas_v_phys[1] +
                                gas_v_phys[2] * gas_v_phys[2];
 
-    if (props->subgrid_bondi) {
+    if (props->use_subgrid_bondi) {
 
       /* Use subgrid rho and c for Bondi model */
 
diff --git a/src/black_holes/EAGLE/black_holes_iact.h b/src/black_holes/EAGLE/black_holes_iact.h
index 4f060428ae..dd96d2c9a5 100644
--- a/src/black_holes/EAGLE/black_holes_iact.h
+++ b/src/black_holes/EAGLE/black_holes_iact.h
@@ -108,7 +108,7 @@ runner_iact_nonsym_bh_gas_density(
   bi->circular_velocity_gas[1] += mj * wi * (dx[2] * dv[0] - dx[0] * dv[2]);
   bi->circular_velocity_gas[2] += mj * wi * (dx[0] * dv[1] - dx[1] * dv[0]);
 
-  if (bh_props->multi_phase_bondi) {
+  if (bh_props->use_multi_phase_bondi) {
     /* Contribution to BH accretion rate
      *
      * i) Calculate denominator in Bondi formula */
diff --git a/src/black_holes/EAGLE/black_holes_properties.h b/src/black_holes/EAGLE/black_holes_properties.h
index db2dc3bbc3..afb2ca00bc 100644
--- a/src/black_holes/EAGLE/black_holes_properties.h
+++ b/src/black_holes/EAGLE/black_holes_properties.h
@@ -61,10 +61,10 @@ struct black_holes_props {
   /* ----- Properties of the accretion model ------ */
 
   /*! Calculate Bondi accretion rate for individual neighbours? */
-  int multi_phase_bondi;
+  int use_multi_phase_bondi;
 
   /*! Are we using the subgrid gas properties in the Bondi model? */
-  int subgrid_bondi;
+  int use_subgrid_bondi;
 
   /*! Are we applying the angular-momentum-based multiplicative term from
    * Rosas-Guevara et al. (2015)? */
@@ -294,12 +294,13 @@ INLINE static void black_holes_props_init(struct black_holes_props *bp,
 
   /* Accretion parameters ---------------------------------- */
 
-  bp->multi_phase_bondi =
-      parser_get_param_int(params, "EAGLEAGN:multi_phase_bondi");
+  bp->use_multi_phase_bondi =
+      parser_get_param_int(params, "EAGLEAGN:use_multi_phase_bondi");
 
-  bp->subgrid_bondi = parser_get_param_int(params, "EAGLEAGN:subgrid_bondi");
+  bp->use_subgrid_bondi =
+      parser_get_param_int(params, "EAGLEAGN:use_subgrid_bondi");
 
-  if (bp->multi_phase_bondi && bp->subgrid_bondi)
+  if (bp->use_multi_phase_bondi && bp->use_subgrid_bondi)
     error(
         "Cannot run with both the multi-phase Bondi and subgrid Bondi models "
         "at the same time!");
-- 
GitLab