Skip to content
Snippets Groups Projects
Commit cbaaaa6d authored by Filip Husko's avatar Filip Husko Committed by Bert Vandenbroucke
Browse files

Extra AGN spin jet debugging

parent 22024301
No related branches found
No related tags found
12 merge requests!1715Update planetary strength after planetary plus's master rebase,!1693More threapool plotting tweaks,!1668before Mag.Egy in all the flavors,!1663Initial sync to work again,!1662Initial sync from previous months,!1642When searching for more particles in a ghost task we walk up the cell tree,...,!1633When searching for more particles in a ghost task we walk up the cell tree,...,!1631Solving issues with different Hydro Schemes,!1620Mhd canvas,!1619Mhd canvas,!1617Update to from main branch to Canvas to MHD_FS,!1612Extra AGN spin jet debugging
......@@ -55,6 +55,7 @@ Below we give an example of parameter choices applicable for e.g. a 50 Mpc box.
v_jet_cs_ratio: 10. # This sets the jet velocity to v_jet_cs_ratio times the sound speed of the hot gas of the parent halo the black hole is in. This is used if 'AGN_jet_velocity_model' is 'BlackHoleMass'.
v_jet_BH_mass_scaling_reference_mass_Msun: 3.4e3 # The reference mass used in the relation between halo mass and BH mass used to calculate jet velocities. Only used if 'AGN_jet_velocity_model' is 'BlackHoleMass'.
v_jet_BH_mass_scaling_slope: 0.65 # The slope of the relation between halo mass and BH mass used to calculate jet velocities. Only used if 'AGN_jet_velocity_model' is 'BlackHoleMass'.
v_jet_min_km_p_s: 500 # The minimal jet velocity. Only used if 'AGN_jet_velocity_model' is 'BlackHoleMass'.
opening_angle_in_degrees: 7.5 # The half-opening angle of the jet in degrees. Should use values < 15 unless for tests.
N_jet: 2 # Target number of particles to kick as part of a single jet feedback event. Should be a multiple of 2 to ensure approximate momentum conservation (we always kick particles in pairs, one from each 'side' of the BH, relative to the spin vector).
AGN_jet_feedback_model: SpinAxis # Which particles to kick from the black hole smoothing kernels. Should be 'SpinAxis', 'MinimumDistance', 'MaximumDistance' or 'MinimumDensity'
......
......@@ -705,6 +705,7 @@ SPINJETAGN:
v_jet_cs_ratio: 10. # This sets the jet velocity to v_jet_cs_ratio times the sound speed of the hot gas of the parent halo the black hole is in. This is used if 'AGN_jet_velocity_model' is 'BlackHoleMass'.
v_jet_BH_mass_scaling_reference_mass_Msun: 3.4e3 # The reference mass used in the relation between halo mass and BH mass used to calculate jet velocities. Only used if 'AGN_jet_velocity_model' is 'BlackHoleMass'.
v_jet_BH_mass_scaling_slope: 0.65 # The slope of the relation between halo mass and BH mass used to calculate jet velocities. Only used if 'AGN_jet_velocity_model' is 'BlackHoleMass'.
v_jet_min_km_p_s: 500 # The minimal jet velocity. Only used if 'AGN_jet_velocity_model' is 'BlackHoleMass'.
opening_angle_in_degrees: 7.5 # The half-opening angle of the jet in degrees. Should use values < 15 unless for tests.
N_jet: 2 # Target number of particles to kick as part of a single jet feedback event. Should be a multiple of 2 to ensure approximate momentum conservation (we always kick particles in pairs, one from each 'side' of the BH, relative to the spin vector).
AGN_jet_feedback_model: SpinAxis # Which particles to kick from the black hole smoothing kernels. Should be 'SpinAxis', 'MinimumDistance', 'MaximumDistance' or 'MinimumDensity'
......
......@@ -943,10 +943,11 @@ __attribute__((always_inline)) INLINE static void black_holes_prepare_feedback(
bp->total_accreted_mass = bp->total_accreted_mass + delta_m_real;
if (bp->subgrid_mass < 0.) {
error(
warning(
"Black hole %lld has reached a negative mass (%f) due"
" to jet spindown.",
bp->id, bp->subgrid_mass);
bp->subgrid_mass = props->subgrid_seed_mass;
}
/* Update other quantities. */
......
......@@ -345,6 +345,7 @@ struct black_holes_props {
/*! Parameters of the scaling between AGN jet velocity and BH mass */
float v_jet_BH_mass_scaling_reference_mass;
float v_jet_BH_mass_scaling_slope;
float v_jet_min;
/*! Sets the launching velocity of the jet to v_jet_cs_ratio times the
sound speed of the hot gas in the halo, assuming it is at virial
......@@ -824,6 +825,9 @@ INLINE static void black_holes_props_init(struct black_holes_props *bp,
bp->v_jet_BH_mass_scaling_slope = parser_get_param_float(
params, "SPINJETAGN:v_jet_BH_mass_scaling_slope");
bp->v_jet_min =
parser_get_param_float(params, "SPINJETAGN:v_jet_min_km_p_s");
bp->v_jet_cs_ratio =
parser_get_param_float(params, "SPINJETAGN:v_jet_cs_ratio");
......
......@@ -809,7 +809,7 @@ __attribute__((always_inline)) INLINE static float da_dln_mbh_0(
const struct black_holes_props* props) {
const float a = bp->spin;
if ((a == 0.) || (a < -0.998) || (a > 0.998)) {
if ((a == 0.) || (a < -0.9981) || (a > 0.9981)) {
error(
"The da_dln_mbh_0 function was called and spin is %f. Spin should "
" not be a = 0, a < -0.998 or a > 0.998.",
......@@ -877,7 +877,8 @@ __attribute__((always_inline)) INLINE static float black_hole_feedback_dv_jet(
const float sound_speed = sqrtf(5. / 3. * 0.5) * virial_velocity;
/* Return the jet velocity as some factor times the sound speed */
v_jet = props->v_jet_cs_ratio * sound_speed;
v_jet = fmaxf(props->v_jet_min, props->v_jet_cs_ratio * sound_speed);
} else if (props->AGN_jet_velocity_model == AGN_jet_velocity_constant) {
v_jet = props->v_jet;
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment