Commit 54ad80a0 authored by Yannick Bahé's avatar Yannick Bahé

Changed adaptive NHeat calculation to use accretion rate rather than Eddington fraction

parent 76aadcba
......@@ -574,11 +574,10 @@ black_hole_feedback_delta_T(const struct bpart* bp,
*/
__attribute__((always_inline)) INLINE static double
black_hole_energy_reservoir_threshold(struct bpart* bp,
const struct black_holes_props* props,
const double Eddington_max) {
const struct black_holes_props* props) {
const double f_Edd = min(bp->eddington_fraction, Eddington_max);
double num_to_heat = props->nheat_alpha * (f_Edd / props->nheat_fEdd_normalisation);
double num_to_heat = props->nheat_alpha *
(bp->accretion_rate / props->nheat_maccr_normalisation);
/* Impose smooth truncation of num_to_heat towards props->nheat_limit */
if (num_to_heat > props->nheat_alpha) {
......@@ -857,7 +856,7 @@ __attribute__((always_inline)) INLINE static void black_holes_prepare_feedback(
const double num_ngbs_to_heat =
props->use_adaptive_energy_reservoir_threshold ?
black_hole_energy_reservoir_threshold(bp, props, f_Edd * Eddington_rate) :
black_hole_energy_reservoir_threshold(bp, props) :
props->num_ngbs_to_heat;
const double mean_ngb_mass = bp->ngb_mass / ((double)bp->num_ngbs);
......
......@@ -160,8 +160,8 @@ struct black_holes_props {
/*! Normalisation for energy reservoir threshold, at upper end */
float nheat_alpha;
/*! Reference max Eddington ratio for energy reservoir variation */
float nheat_fEdd_normalisation;
/*! Reference max accretion rate for energy reservoir variation */
float nheat_maccr_normalisation;
/*! Hard limit to the energy reservoir threshold */
float nheat_limit;
......@@ -404,8 +404,10 @@ INLINE static void black_holes_props_init(struct black_holes_props *bp,
if (bp->use_adaptive_energy_reservoir_threshold) {
bp->nheat_alpha =
parser_get_param_float(params, "EAGLEAGN:AGN_nheat_alpha");
bp->nheat_fEdd_normalisation =
parser_get_param_float(params, "EAGLEAGN:AGN_nheat_fEdd_normalisation");
bp->nheat_maccr_normalisation =
parser_get_param_float(
params, "EAGLEAGN:AGN_nheat_maccr_normalisation")
* phys_const->const_solar_mass / phys_const->const_year;
bp->nheat_limit =
parser_get_param_float(params, "EAGLEAGN:AGN_nheat_limit");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment