diff --git a/examples/EAGLE_low_z/EAGLE_6/eagle_6.yml b/examples/EAGLE_low_z/EAGLE_6/eagle_6.yml index 7e61b46edb2ab51aeeb3c87bcbed9a4b9f106911..8871aa619ca1ce15c3201a6db3e395c3860fa72b 100644 --- a/examples/EAGLE_low_z/EAGLE_6/eagle_6.yml +++ b/examples/EAGLE_low_z/EAGLE_6/eagle_6.yml @@ -159,4 +159,5 @@ EAGLEAGN: radiative_efficiency: 0.1 # Fraction of the accreted mass that gets radiated. coupling_efficiency: 0.15 # Fraction of the radiated energy that couples to the gas in feedback events. AGN_delta_T_K: 3.16228e8 # Change in temperature to apply to the gas particle in an AGN feedback event in Kelvin. - AGN_num_ngb_to_heat: 1. # Target number of gas neighbours to heat in an AGN feedback event. \ No newline at end of file + AGN_num_ngb_to_heat: 1. # Target number of gas neighbours to heat in an AGN feedback event. + diff --git a/src/black_holes/EAGLE/black_holes.h b/src/black_holes/EAGLE/black_holes.h index cf9acbc6104ba241b4904a0c5cddb76095a86da0..4850f6ebf2e27e55636aa14e3350123f1526c2a8 100644 --- a/src/black_holes/EAGLE/black_holes.h +++ b/src/black_holes/EAGLE/black_holes.h @@ -48,13 +48,13 @@ __attribute__((always_inline)) INLINE static float black_holes_compute_timestep( * read in to do some conversions. * * @param bp The particle to act upon + * @param props The properties of the black holes model. */ __attribute__((always_inline)) INLINE static void black_holes_first_init_bpart( - struct bpart* bp) { + struct bpart* bp, const struct black_holes_props* props) { bp->time_bin = 0; bp->subgrid_mass = bp->mass; - bp->energy_reservoir = 0.f; bp->accretion_rate = 0.f; bp->formation_time = -1.f; } diff --git a/src/black_holes/EAGLE/black_holes_io.h b/src/black_holes/EAGLE/black_holes_io.h index 92bd061f945d2063a2665eb60a5373918b2f195a..d91288e01da8f41acfcc7ecf93311f783c57ccba 100644 --- a/src/black_holes/EAGLE/black_holes_io.h +++ b/src/black_holes/EAGLE/black_holes_io.h @@ -34,7 +34,7 @@ INLINE static void black_holes_read_particles(struct bpart *bparts, int *num_fields) { /* Say how much we want to read */ - *num_fields = 5; + *num_fields = 6; /* List what we want to read */ list[0] = io_make_input_field("Coordinates", DOUBLE, 3, COMPULSORY, @@ -47,6 +47,8 @@ INLINE static void black_holes_read_particles(struct bpart *bparts, UNIT_CONV_NO_UNITS, bparts, id); list[4] = io_make_input_field("SmoothingLength", FLOAT, 1, OPTIONAL, UNIT_CONV_LENGTH, bparts, h); + list[5] = io_make_input_field("EnergyReservoir", FLOAT, 1, OPTIONAL, + UNIT_CONV_ENERGY, bparts, energy_reservoir); } /** diff --git a/src/black_holes/EAGLE/black_holes_properties.h b/src/black_holes/EAGLE/black_holes_properties.h index cf239e9def44f03945dd77a00d804bac6d9a71f9..c7b78d2e6b0eaa06ac8f8d5bf10c289d88bc2750 100644 --- a/src/black_holes/EAGLE/black_holes_properties.h +++ b/src/black_holes/EAGLE/black_holes_properties.h @@ -47,6 +47,8 @@ struct black_holes_props { /*! Maximal change of h over one time-step */ float log_max_h_change; + /* ----- Initialisation properties ------ */ + /* ----- Properties of the accretion model ------ */ /*! Maximal fraction of the Eddington rate allowed. */ diff --git a/src/space.c b/src/space.c index 60ee47d5b989dc91b762bc438579e3a0c5eacb83..e4703ddf842dc88fff0a467cb0607c0d6222ad7b 100644 --- a/src/space.c +++ b/src/space.c @@ -4230,6 +4230,7 @@ void space_first_init_bparts_mapper(void *restrict map_data, int count, struct bpart *restrict bp = (struct bpart *)map_data; const struct space *restrict s = (struct space *)extra_data; const struct engine *e = s->e; + const struct black_holes_props *props = e->black_holes_properties; #ifdef SWIFT_DEBUG_CHECKS const ptrdiff_t delta = bp - s->bparts; @@ -4273,7 +4274,7 @@ void space_first_init_bparts_mapper(void *restrict map_data, int count, /* Initialise the rest */ for (int k = 0; k < count; k++) { - black_holes_first_init_bpart(&bp[k]); + black_holes_first_init_bpart(&bp[k], props); #ifdef SWIFT_DEBUG_CHECKS if (bp[k].gpart && bp[k].gpart->id_or_neg_offset != -(k + delta))