Commit b7e3a516 authored by Matthieu Schaller's avatar Matthieu Schaller

Impose an ordering on the BH that are merging in a chain.

parent 52ac51a4
......@@ -21,8 +21,8 @@ import h5py
from numpy import *
# Some constants
solar_mass_cgs = 1.988480e33
kpc_in_cm = 3.085678e21
solar_mass_cgs = 1.988410e33
kpc_in_cm = 3.08567758149e21
mp_cgs = 1.67e-24
boltzmann_k_cgs = 1.38e-16
......@@ -34,8 +34,8 @@ P_cgs = rho_cgs*u0_cgs*(gamma - 1.) # Background pressure
fileName = "bh_swallowing.hdf5"
# Units
unit_l_cgs = 3.085678e24 # kpc
unit_m_cgs = 1.988480e43 # 10^10 Msun
unit_l_cgs = 3.08567758149e24 # kpc
unit_m_cgs = 1.988410e43 # 10^10 Msun
unit_v_cgs = 1e5 # km / s
unit_A_cgs = 1.
unit_T_cgs = 1.
......
# Define the system of units to use internally.
InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun in grams
UnitLength_in_cgs: 3.08567758e24 # Mpc in centimeters
UnitMass_in_cgs: 1.98841e43 # 10^10 M_sun in grams
UnitLength_in_cgs: 3.08567758149e24 # Mpc in centimeters
UnitVelocity_in_cgs: 1e5 # km/s in centimeters per second
UnitCurrent_in_cgs: 1. # Amperes
UnitTemp_in_cgs: 1. # Kelvin
......@@ -34,6 +34,17 @@ Statistics:
time_first: 0.
delta_time: 1.e-5 # non cosmology time between statistics output
# Parameters for the self-gravity scheme
Gravity:
eta: 0.025 # Constant dimensionless multiplier for time integration.
theta: 0.7 # Opening angle (Multipole acceptance criterion)
mesh_side_length: 128
comoving_DM_softening: 0.003320 # Comoving softening for DM (3.32 ckpc)
max_physical_DM_softening: 0.001300 # Physical softening for DM (1.30 pkpc)
comoving_baryon_softening: 0.001790 # Comoving softening for baryons (1.79 ckpc)
max_physical_baryon_softening: 0.000700 # Physical softening for baryons (0.70 pkpc)
dithering: 0
# Parameters for the hydrodynamics scheme
SPH:
resolution_eta: 1.2348 # Target smoothing length in units of the mean inter-particle separation
......@@ -47,7 +58,6 @@ InitialConditions:
Scheduler:
max_top_level_cells: 8
tasks_per_cell: 500
# Parameters for the EAGLE "equation of state"
EAGLEEntropyFloor:
......
......@@ -347,23 +347,20 @@ void runner_do_bh_swallow(struct runner *r, struct cell *c, int timer) {
if (bp->id == BH_id) {
/* Lock the space as we are going to work directly on the bpart list
*/
lock_lock(&s->lock);
/* If bpart is inhibited, it cannot do any swallowing */
if (bpart_is_inhibited(bp, e)) {
message("BH %lld inhibited -- DOES NOT swallow BH %lld", bp->id,
cell_bp->id);
/* Is the swallowing BH itself flagged for swallowing by
another BH? */
if (black_holes_get_bpart_swallow_id(&bp->merger_data) != -1) {
/* Pretend it was found */
/* Pretend it was found and abort */
black_holes_mark_bpart_as_not_swallowed(&cell_bp->merger_data);
found = 1;
if (lock_unlock(&s->lock) != 0)
error("Failed to unlock the space.");
break;
}
/* Lock the space as we are going to work directly on the
* space's bpart list */
lock_lock(&s->lock);
/* Swallow the BH particle (i.e. update the swallowing BH
* properties with the properties of cell_bp) */
black_holes_swallow_bpart(bp, cell_bp, e->cosmology, e->time,
......@@ -410,6 +407,16 @@ void runner_do_bh_swallow(struct runner *r, struct cell *c, int timer) {
if (bp->id == BH_id) {
/* Is the swallowing BH itself flagged for swallowing by
another BH? */
if (black_holes_get_bpart_swallow_id(&bp->merger_data) != -1) {
/* Pretend it was found and abort */
black_holes_mark_bpart_as_not_swallowed(&cell_bp->merger_data);
found = 1;
break;
}
message("BH %lld removing BH particle %lld (foreign BH case)",
bp->id, cell_bp->id);
......
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