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

Merge branch 'bh-new-mergers' into 'master'

New BH merger scheme

See merge request !1027
parents cb75314c dfa8d99c
No related branches found
No related tags found
1 merge request!1027New BH merger scheme
...@@ -262,7 +262,7 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx, ...@@ -262,7 +262,7 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx,
const_max_repositioning_distance_ratio * grav_props->epsilon_baryon_cur * const_max_repositioning_distance_ratio * grav_props->epsilon_baryon_cur *
grav_props->epsilon_baryon_cur; grav_props->epsilon_baryon_cur;
/* This gas neighbour is close enough that we can consider it's potential /* This BH neighbour is close enough that we can consider it's potential
for repositioning */ for repositioning */
if (r2 < max_dist_repos2) { if (r2 < max_dist_repos2) {
...@@ -285,13 +285,11 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx, ...@@ -285,13 +285,11 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx,
/* Find the most massive of the two BHs */ /* Find the most massive of the two BHs */
float M = bi->subgrid_mass; float M = bi->subgrid_mass;
float h = hi;
if (bj->subgrid_mass > M) { if (bj->subgrid_mass > M) {
M = bj->subgrid_mass; M = bj->subgrid_mass;
h = hj;
} }
/* (Square of) Max swallowing distance allowed based on the softening */ /* (Square of) max swallowing distance allowed based on the softening */
const float max_dist_merge2 = const float max_dist_merge2 =
kernel_gravity_softening_plummer_equivalent_inv * kernel_gravity_softening_plummer_equivalent_inv *
kernel_gravity_softening_plummer_equivalent_inv * kernel_gravity_softening_plummer_equivalent_inv *
...@@ -307,10 +305,11 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx, ...@@ -307,10 +305,11 @@ runner_iact_nonsym_bh_bh_swallow(const float r2, const float *dx,
if ((bj->subgrid_mass < bi->subgrid_mass) || if ((bj->subgrid_mass < bi->subgrid_mass) ||
(bj->subgrid_mass == bi->subgrid_mass && bj->id < bi->id)) { (bj->subgrid_mass == bi->subgrid_mass && bj->id < bi->id)) {
/* Merge if gravitationally bound AND if within max distance /* Maximum velocity difference between BHs allowed to merge */
* Note that we use the kernel support here as the size and not just the const float v2_threshold = 2.f * G_Newton * M / sqrt(r2);
* smoothing length */
if (v2_pec < G_Newton * M / (kernel_gamma * h) && (r2 < max_dist_merge2)) { /* Merge if gravitationally bound AND if within max distance */
if ((v2_pec < v2_threshold) && (r2 < max_dist_merge2)) {
/* This particle is swallowed by the BH with the largest ID of all the /* This particle is swallowed by the BH with the largest ID of all the
* candidates wanting to swallow it */ * candidates wanting to swallow it */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment