Skip to content
Snippets Groups Projects
Commit 61ce63bc authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'bh_chain_merger_fix' into 'master'

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

See merge request !1039
parents 52ac51a4 b7e3a516
No related branches found
No related tags found
1 merge request!1039Impose an ordering on the BH that are merging in a chain.
...@@ -21,8 +21,8 @@ import h5py ...@@ -21,8 +21,8 @@ import h5py
from numpy import * from numpy import *
# Some constants # Some constants
solar_mass_cgs = 1.988480e33 solar_mass_cgs = 1.988410e33
kpc_in_cm = 3.085678e21 kpc_in_cm = 3.08567758149e21
mp_cgs = 1.67e-24 mp_cgs = 1.67e-24
boltzmann_k_cgs = 1.38e-16 boltzmann_k_cgs = 1.38e-16
...@@ -34,8 +34,8 @@ P_cgs = rho_cgs*u0_cgs*(gamma - 1.) # Background pressure ...@@ -34,8 +34,8 @@ P_cgs = rho_cgs*u0_cgs*(gamma - 1.) # Background pressure
fileName = "bh_swallowing.hdf5" fileName = "bh_swallowing.hdf5"
# Units # Units
unit_l_cgs = 3.085678e24 # kpc unit_l_cgs = 3.08567758149e24 # kpc
unit_m_cgs = 1.988480e43 # 10^10 Msun unit_m_cgs = 1.988410e43 # 10^10 Msun
unit_v_cgs = 1e5 # km / s unit_v_cgs = 1e5 # km / s
unit_A_cgs = 1. unit_A_cgs = 1.
unit_T_cgs = 1. unit_T_cgs = 1.
......
# Define the system of units to use internally. # Define the system of units to use internally.
InternalUnitSystem: InternalUnitSystem:
UnitMass_in_cgs: 1.98848e43 # 10^10 M_sun in grams UnitMass_in_cgs: 1.98841e43 # 10^10 M_sun in grams
UnitLength_in_cgs: 3.08567758e24 # Mpc in centimeters UnitLength_in_cgs: 3.08567758149e24 # Mpc in centimeters
UnitVelocity_in_cgs: 1e5 # km/s in centimeters per second UnitVelocity_in_cgs: 1e5 # km/s in centimeters per second
UnitCurrent_in_cgs: 1. # Amperes UnitCurrent_in_cgs: 1. # Amperes
UnitTemp_in_cgs: 1. # Kelvin UnitTemp_in_cgs: 1. # Kelvin
...@@ -34,6 +34,17 @@ Statistics: ...@@ -34,6 +34,17 @@ Statistics:
time_first: 0. time_first: 0.
delta_time: 1.e-5 # non cosmology time between statistics output 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 # Parameters for the hydrodynamics scheme
SPH: SPH:
resolution_eta: 1.2348 # Target smoothing length in units of the mean inter-particle separation resolution_eta: 1.2348 # Target smoothing length in units of the mean inter-particle separation
...@@ -47,7 +58,6 @@ InitialConditions: ...@@ -47,7 +58,6 @@ InitialConditions:
Scheduler: Scheduler:
max_top_level_cells: 8 max_top_level_cells: 8
tasks_per_cell: 500
# Parameters for the EAGLE "equation of state" # Parameters for the EAGLE "equation of state"
EAGLEEntropyFloor: EAGLEEntropyFloor:
......
...@@ -347,23 +347,20 @@ void runner_do_bh_swallow(struct runner *r, struct cell *c, int timer) { ...@@ -347,23 +347,20 @@ void runner_do_bh_swallow(struct runner *r, struct cell *c, int timer) {
if (bp->id == BH_id) { if (bp->id == BH_id) {
/* Lock the space as we are going to work directly on the bpart list /* Is the swallowing BH itself flagged for swallowing by
*/ another BH? */
lock_lock(&s->lock); if (black_holes_get_bpart_swallow_id(&bp->merger_data) != -1) {
/* If bpart is inhibited, it cannot do any swallowing */ /* Pretend it was found and abort */
if (bpart_is_inhibited(bp, e)) { black_holes_mark_bpart_as_not_swallowed(&cell_bp->merger_data);
message("BH %lld inhibited -- DOES NOT swallow BH %lld", bp->id,
cell_bp->id);
/* Pretend it was found */
found = 1; found = 1;
if (lock_unlock(&s->lock) != 0)
error("Failed to unlock the space.");
break; 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 /* Swallow the BH particle (i.e. update the swallowing BH
* properties with the properties of cell_bp) */ * properties with the properties of cell_bp) */
black_holes_swallow_bpart(bp, cell_bp, e->cosmology, e->time, 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) { ...@@ -410,6 +407,16 @@ void runner_do_bh_swallow(struct runner *r, struct cell *c, int timer) {
if (bp->id == BH_id) { 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)", message("BH %lld removing BH particle %lld (foreign BH case)",
bp->id, cell_bp->id); bp->id, cell_bp->id);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment