From 38016ca26c53047233c236f2676a486a6e3cc7d9 Mon Sep 17 00:00:00 2001 From: Filip Husko <filip.husko@durham.ac.uk> Date: Tue, 30 Apr 2024 19:41:38 +0000 Subject: [PATCH] Post merge spin jet fix --- doc/RTD/source/SubgridModels/AGNSpinJets/params.rst | 6 ++---- .../IdealisedCluster_M13/idealised_cluster_M13.yml | 6 ++---- .../idealised_cluster_M135.yml | 6 ++---- .../IdealisedCluster_M14/idealised_cluster_M14.yml | 6 ++---- .../IdealisedCluster_M15/idealised_cluster_M15.yml | 6 ++---- examples/parameter_example.yml | 6 ++---- src/black_holes/SPIN_JET/black_holes.h | 13 +++++++++++-- src/black_holes/SPIN_JET/black_holes_part.h | 3 +++ 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/doc/RTD/source/SubgridModels/AGNSpinJets/params.rst b/doc/RTD/source/SubgridModels/AGNSpinJets/params.rst index 821097f0f4..64c2774a1c 100644 --- a/doc/RTD/source/SubgridModels/AGNSpinJets/params.rst +++ b/doc/RTD/source/SubgridModels/AGNSpinJets/params.rst @@ -65,8 +65,7 @@ Below we give an example of parameter choices applicable for e.g. a 50 Mpc box. fix_jet_efficiency: 0 # Global switch whether to fix jet efficiency to a particular value [1], or use a spin-dependant formula [0]. jet_efficiency: 0.1 # The constant jet efficiency used if 'fix_jet_efficiency' is set to 1. fix_jet_direction: 0 # Global switch whether to fix the jet direction to be along the z-axis, instead of along the spin vector. - accretion_efficiency_mode: Constant # How the accretion efficiencies are calculated for the thick accretion disc. If 'Constant', the value of 'accretion_efficiency_thick' will be used. If 'Vari - able', the accretion efficiency will scale with Eddington ratio. + accretion_efficiency_mode: Constant # How the accretion efficiencies are calculated for the thick accretion disc. If 'Constant', the value of 'accretion_efficiency_thick' will be used. If 'Variable', the accretion efficiency will scale with Eddington ratio. accretion_efficiency_thick: 0.01 # The accretion efficiency (suppression factor of the accretion rate) to use in the thick disc (ADAF), to represent the effects of subgrid ADIOS winds that take away most of the mass flowing through the accretion disc. accretion_efficiency_slim: 1 # The constant accretion efficiency to use in the slim disc, at super-Eddington rates. fix_radiative_efficiency: 0 # Global switch whether to fix the radiative efficiency to a particular value [1], or use a spin-dependant formula [0]. @@ -77,8 +76,7 @@ Below we give an example of parameter choices applicable for e.g. a 50 Mpc box. include_slim_disk: 1 # Global switch whether to include super-Eddington accretion, modeled as the slim disk. If set to 0, disks will be considered thin even at very large accretion rates. use_jets_in_thin_disc: 1 # Whether to use jets alongside radiation in the thin disc at moderate Eddington ratios. use_ADIOS_winds: 1 # Whether to include ADIOS winds in the thick disc as thermal isotropic feedback (same channel as thin disc quasar feedback, but with a different efficiency). - slim_disc_wind_factor: 1 # The relative efficiency of slim disc winds at super-Eddington rates. If '1', full winds will be used, while '0' will lead to no winds. Any value in between - those can also be used. The wind is implemented in the thermal isotropic feedback channel. + slim_disc_wind_factor: 1 # The relative efficiency of slim disc winds at super-Eddington rates. If '1', full winds will be used, while '0' will lead to no winds. Any value in between those can also be used. The wind is implemented in the thermal isotropic feedback channel. Most of these parameters should work well generally, and should not be changed except for tests. We will discuss only some of the more important ones. You can choose whether to have only the thick and thin disk (low and high BH accretion rates, respectively), or you can also include the slim disk at super-Eddington rates with ``include_slim_disk``. You can control what type of feedback you (do not) want with ``include_jets`` and ``turn_off_radiative_feedback``. If you choose to turn off jets, everything will be modeled as a thin disk (regardless of accretion rate), since jets go hand-in-hand with the thick and the slim disk. Similarly, if you turn off radiation, everything will be treated as a thick disk. diff --git a/examples/IdealisedCluster/IdealisedCluster_M13/idealised_cluster_M13.yml b/examples/IdealisedCluster/IdealisedCluster_M13/idealised_cluster_M13.yml index 1f487d9267..6c853b16f3 100644 --- a/examples/IdealisedCluster/IdealisedCluster_M13/idealised_cluster_M13.yml +++ b/examples/IdealisedCluster/IdealisedCluster_M13/idealised_cluster_M13.yml @@ -297,8 +297,7 @@ SPINJETAGN: fix_jet_efficiency: 0 # Global switch whether to fix jet efficiency to a particular value [1], or use a spin-dependant formula [0]. jet_efficiency: 0.1 # The constant jet efficiency used if 'fix_jet_efficiency' is set to 1. fix_jet_direction: 0 # Global switch whether to fix the jet direction to be along the z-axis, instead of along the spin vector. - accretion_efficiency_mode: Constant # How the accretion efficiencies are calculated for the thick accretion disc. If 'Constant', the value of 'accretion_efficiency_thick' will be used. If 'Vari - able', the accretion efficiency will scale with Eddington ratio. + accretion_efficiency_mode: Constant # How the accretion efficiencies are calculated for the thick accretion disc. If 'Constant', the value of 'accretion_efficiency_thick' will be used. If 'Variable', the accretion efficiency will scale with Eddington ratio. accretion_efficiency_thick: 0.01 # The accretion efficiency (suppression factor of the accretion rate) to use in the thick disc (ADAF), to represent the effects of subgrid ADIOS winds that take away most of the mass flowing through the accretion disc. accretion_efficiency_slim: 1 # The constant accretion efficiency to use in the slim disc, at super-Eddington rates. fix_radiative_efficiency: 0 # Global switch whether to fix the radiative efficiency to a particular value [1], or use a spin-dependant formula [0]. @@ -309,5 +308,4 @@ SPINJETAGN: include_slim_disk: 0 # Global switch whether to include super-Eddington accretion, modeled as the slim disk. If set to 0, disks will be considered thin even at very large accretion rates. use_jets_in_thin_disc: 1 # Whether to use jets alongside radiation in the thin disc at moderate Eddington ratios. use_ADIOS_winds: 0 # Whether to include ADIOS winds in the thick disc as thermal isotropic feedback (same channel as thin disc quasar feedback, but with a different efficiency). - slim_disc_wind_factor: 0 # The relative efficiency of slim disc winds at super-Eddington rates. If '1', full winds will be used, while '0' will lead to no winds. Any value in between - those can also be used. The wind is implemented in the thermal isotropic feedback channel. + slim_disc_wind_factor: 0 # The relative efficiency of slim disc winds at super-Eddington rates. If '1', full winds will be used, while '0' will lead to no winds. Any value in between those can also be used. The wind is implemented in the thermal isotropic feedback channel. diff --git a/examples/IdealisedCluster/IdealisedCluster_M135/idealised_cluster_M135.yml b/examples/IdealisedCluster/IdealisedCluster_M135/idealised_cluster_M135.yml index 0fa12db35b..7a0771e0da 100644 --- a/examples/IdealisedCluster/IdealisedCluster_M135/idealised_cluster_M135.yml +++ b/examples/IdealisedCluster/IdealisedCluster_M135/idealised_cluster_M135.yml @@ -297,8 +297,7 @@ SPINJETAGN: fix_jet_efficiency: 0 # Global switch whether to fix jet efficiency to a particular value [1], or use a spin-dependant formula [0]. jet_efficiency: 0.1 # The constant jet efficiency used if 'fix_jet_efficiency' is set to 1. fix_jet_direction: 0 # Global switch whether to fix the jet direction to be along the z-axis, instead of along the spin vector. - accretion_efficiency_mode: Constant # How the accretion efficiencies are calculated for the thick accretion disc. If 'Constant', the value of 'accretion_efficiency_thick' will be used. If 'Vari - able', the accretion efficiency will scale with Eddington ratio. + accretion_efficiency_mode: Constant # How the accretion efficiencies are calculated for the thick accretion disc. If 'Constant', the value of 'accretion_efficiency_thick' will be used. If 'Variable', the accretion efficiency will scale with Eddington ratio. accretion_efficiency_thick: 0.01 # The accretion efficiency (suppression factor of the accretion rate) to use in the thick disc (ADAF), to represent the effects of subgrid ADIOS winds that take away most of the mass flowing through the accretion disc. accretion_efficiency_slim: 1 # The constant accretion efficiency to use in the slim disc, at super-Eddington rates. fix_radiative_efficiency: 0 # Global switch whether to fix the radiative efficiency to a particular value [1], or use a spin-dependant formula [0]. @@ -309,5 +308,4 @@ SPINJETAGN: include_slim_disk: 0 # Global switch whether to include super-Eddington accretion, modeled as the slim disk. If set to 0, disks will be considered thin even at very large accretion rates. use_jets_in_thin_disc: 1 # Whether to use jets alongside radiation in the thin disc at moderate Eddington ratios. use_ADIOS_winds: 0 # Whether to include ADIOS winds in the thick disc as thermal isotropic feedback (same channel as thin disc quasar feedback, but with a different efficiency). - slim_disc_wind_factor: 0 # The relative efficiency of slim disc winds at super-Eddington rates. If '1', full winds will be used, while '0' will lead to no winds. Any value in between - those can also be used. The wind is implemented in the thermal isotropic feedback channel. + slim_disc_wind_factor: 0 # The relative efficiency of slim disc winds at super-Eddington rates. If '1', full winds will be used, while '0' will lead to no winds. Any value in between those can also be used. The wind is implemented in the thermal isotropic feedback channel. diff --git a/examples/IdealisedCluster/IdealisedCluster_M14/idealised_cluster_M14.yml b/examples/IdealisedCluster/IdealisedCluster_M14/idealised_cluster_M14.yml index 3cbd96e9e9..f184bf4577 100644 --- a/examples/IdealisedCluster/IdealisedCluster_M14/idealised_cluster_M14.yml +++ b/examples/IdealisedCluster/IdealisedCluster_M14/idealised_cluster_M14.yml @@ -297,8 +297,7 @@ SPINJETAGN: fix_jet_efficiency: 0 # Global switch whether to fix jet efficiency to a particular value [1], or use a spin-dependant formula [0]. jet_efficiency: 0.1 # The constant jet efficiency used if 'fix_jet_efficiency' is set to 1. fix_jet_direction: 0 # Global switch whether to fix the jet direction to be along the z-axis, instead of along the spin vector. - accretion_efficiency_mode: Constant # How the accretion efficiencies are calculated for the thick accretion disc. If 'Constant', the value of 'accretion_efficiency_thick' will be used. If 'Vari - able', the accretion efficiency will scale with Eddington ratio. + accretion_efficiency_mode: Constant # How the accretion efficiencies are calculated for the thick accretion disc. If 'Constant', the value of 'accretion_efficiency_thick' will be used. If 'Variable', the accretion efficiency will scale with Eddington ratio. accretion_efficiency_thick: 0.01 # The accretion efficiency (suppression factor of the accretion rate) to use in the thick disc (ADAF), to represent the effects of subgrid ADIOS winds that take away most of the mass flowing through the accretion disc. accretion_efficiency_slim: 1 # The constant accretion efficiency to use in the slim disc, at super-Eddington rates. fix_radiative_efficiency: 0 # Global switch whether to fix the radiative efficiency to a particular value [1], or use a spin-dependant formula [0]. @@ -309,5 +308,4 @@ SPINJETAGN: include_slim_disk: 0 # Global switch whether to include super-Eddington accretion, modeled as the slim disk. If set to 0, disks will be considered thin even at very large accretion rates. use_jets_in_thin_disc: 1 # Whether to use jets alongside radiation in the thin disc at moderate Eddington ratios. use_ADIOS_winds: 0 # Whether to include ADIOS winds in the thick disc as thermal isotropic feedback (same channel as thin disc quasar feedback, but with a different efficiency). - slim_disc_wind_factor: 0 # The relative efficiency of slim disc winds at super-Eddington rates. If '1', full winds will be used, while '0' will lead to no winds. Any value in between - those can also be used. The wind is implemented in the thermal isotropic feedback channel. \ No newline at end of file + slim_disc_wind_factor: 0 # The relative efficiency of slim disc winds at super-Eddington rates. If '1', full winds will be used, while '0' will lead to no winds. Any value in between those can also be used. The wind is implemented in the thermal isotropic feedback channel. \ No newline at end of file diff --git a/examples/IdealisedCluster/IdealisedCluster_M15/idealised_cluster_M15.yml b/examples/IdealisedCluster/IdealisedCluster_M15/idealised_cluster_M15.yml index d0367c9cdd..dd55de0861 100644 --- a/examples/IdealisedCluster/IdealisedCluster_M15/idealised_cluster_M15.yml +++ b/examples/IdealisedCluster/IdealisedCluster_M15/idealised_cluster_M15.yml @@ -297,8 +297,7 @@ SPINJETAGN: fix_jet_efficiency: 0 # Global switch whether to fix jet efficiency to a particular value [1], or use a spin-dependant formula [0]. jet_efficiency: 0.1 # The constant jet efficiency used if 'fix_jet_efficiency' is set to 1. fix_jet_direction: 0 # Global switch whether to fix the jet direction to be along the z-axis, instead of along the spin vector. - accretion_efficiency_mode: Constant # How the accretion efficiencies are calculated for the thick accretion disc. If 'Constant', the value of 'accretion_efficiency_thick' will be used. If 'Vari - able', the accretion efficiency will scale with Eddington ratio. + accretion_efficiency_mode: Constant # How the accretion efficiencies are calculated for the thick accretion disc. If 'Constant', the value of 'accretion_efficiency_thick' will be used. If 'Variable', the accretion efficiency will scale with Eddington ratio. accretion_efficiency_thick: 0.01 # The accretion efficiency (suppression factor of the accretion rate) to use in the thick disc (ADAF), to represent the effects of subgrid ADIOS winds that take away most of the mass flowing through the accretion disc. accretion_efficiency_slim: 1 # The constant accretion efficiency to use in the slim disc, at super-Eddington rates. fix_radiative_efficiency: 0 # Global switch whether to fix the radiative efficiency to a particular value [1], or use a spin-dependant formula [0]. @@ -309,5 +308,4 @@ SPINJETAGN: include_slim_disk: 0 # Global switch whether to include super-Eddington accretion, modeled as the slim disk. If set to 0, disks will be considered thin even at very large accretion rates. use_jets_in_thin_disc: 1 # Whether to use jets alongside radiation in the thin disc at moderate Eddington ratios. use_ADIOS_winds: 0 # Whether to include ADIOS winds in the thick disc as thermal isotropic feedback (same channel as thin disc quasar feedback, but with a different efficiency). - slim_disc_wind_factor: 0 # The relative efficiency of slim disc winds at super-Eddington rates. If '1', full winds will be used, while '0' will lead to no winds. Any value in between - those can also be used. The wind is implemented in the thermal isotropic feedback channel. \ No newline at end of file + slim_disc_wind_factor: 0 # The relative efficiency of slim disc winds at super-Eddington rates. If '1', full winds will be used, while '0' will lead to no winds. Any value in between those can also be used. The wind is implemented in the thermal isotropic feedback channel. \ No newline at end of file diff --git a/examples/parameter_example.yml b/examples/parameter_example.yml index 9b5074491c..3347eb8712 100644 --- a/examples/parameter_example.yml +++ b/examples/parameter_example.yml @@ -815,8 +815,7 @@ SPINJETAGN: fix_jet_efficiency: 0 # Global switch whether to fix jet efficiency to a particular value [1], or use a spin-dependant formula [0]. jet_efficiency: 0.1 # The constant jet efficiency used if 'fix_jet_efficiency' is set to 1. fix_jet_direction: 0 # Global switch whether to fix the jet direction to be along the z-axis, instead of along the spin vector. - accretion_efficiency_mode: Constant # How the accretion efficiencies are calculated for the thick accretion disc. If 'Constant', the value of 'accretion_efficiency_thick' will be used. If 'Vari -able', the accretion efficiency will scale with Eddington ratio. + accretion_efficiency_mode: Constant # How the accretion efficiencies are calculated for the thick accretion disc. If 'Constant', the value of 'accretion_efficiency_thick' will be used. If 'Variable', the accretion efficiency will scale with Eddington ratio. accretion_efficiency_thick: 0.01 # The accretion efficiency (suppression factor of the accretion rate) to use in the thick disc (ADAF), to represent the effects of subgrid ADIOS winds that take away most of the mass flowing through the accretion disc. accretion_efficiency_slim: 1 # The constant accretion efficiency to use in the slim disc, at super-Eddington rates. fix_radiative_efficiency: 0 # Global switch whether to fix the radiative efficiency to a particular value [1], or use a spin-dependant formula [0]. @@ -827,8 +826,7 @@ able', the accretion efficiency will scale with Eddington ratio. include_slim_disk: 1 # Global switch whether to include super-Eddington accretion, modeled as the slim disk. If set to 0, disks will be considered thin even at very large accretion rates. use_jets_in_thin_disc: 1 # Whether to use jets alongside radiation in the thin disc at moderate Eddington ratios. use_ADIOS_winds: 1 # Whether to include ADIOS winds in the thick disc as thermal isotropic feedback (same channel as thin disc quasar feedback, but with a different efficiency). - slim_disc_wind_factor: 1 # The relative efficiency of slim disc winds at super-Eddington rates. If '1', full winds will be used, while '0' will lead to no winds. Any value in between - those can also be used. The wind is implemented in the thermal isotropic feedback channel. + slim_disc_wind_factor: 1 # The relative efficiency of slim disc winds at super-Eddington rates. If '1', full winds will be used, while '0' will lead to no winds. Any value in between those can also be used. The wind is implemented in the thermal isotropic feedback channel. # Parameters related to the neutrinos -------------------------------------------- Neutrino: diff --git a/src/black_holes/SPIN_JET/black_holes.h b/src/black_holes/SPIN_JET/black_holes.h index 9ebe99a3de..424fa218de 100644 --- a/src/black_holes/SPIN_JET/black_holes.h +++ b/src/black_holes/SPIN_JET/black_holes.h @@ -801,10 +801,19 @@ __attribute__((always_inline)) INLINE static void black_holes_prepare_feedback( const double gas_rho_phys = bp->rho_gas * cosmo->a3_inv; const double n_H = gas_rho_phys * 0.75 / proton_mass; const double boost_ratio = n_H / props->boost_n_h_star; - const double boost_factor = - max(pow(boost_ratio, props->boost_beta), props->boost_alpha); + double boost_factor; + if (boost_ratio > 1.0) { + boost_factor = props->boost_alpha * pow(boost_ratio, props->boost_beta); + } else { + boost_factor = props->boost_alpha; + } + accr_rate *= boost_factor; + bp->accretion_boost_factor = boost_factor; + } else { + bp->accretion_boost_factor = 1.; } + /* Compute the reduction factor from Rosas-Guevara et al. (2015) */ if (props->with_angmom_limiter) { const double Bondi_radius = G * BH_mass / gas_c_phys2; diff --git a/src/black_holes/SPIN_JET/black_holes_part.h b/src/black_holes/SPIN_JET/black_holes_part.h index f07aa031a5..a31f22503e 100644 --- a/src/black_holes/SPIN_JET/black_holes_part.h +++ b/src/black_holes/SPIN_JET/black_holes_part.h @@ -199,6 +199,9 @@ struct bpart { /*! BH accretion-limited time-step */ float dt_heat; + + /*! Accretion boost factor */ + float accretion_boost_factor; /*! Eddington fraction */ float eddington_fraction; -- GitLab