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

Fix missing factor of h^3 when computing the BH swallowing probability in...

Fix missing factor of h^3 when computing the BH swallowing probability in EAGLE's runner_iact_nonsym_bh_swallow()
parent 0c86a0ae
No related branches found
No related tags found
No related merge requests found
......@@ -130,14 +130,18 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_bh_swallow(
/* Compute the kernel function */
const float hi_inv = 1.0f / hi;
const float hi_inv_dim = pow_dimension(hi_inv);
const float ui = r * hi_inv;
kernel_eval(ui, &wi);
/* Is the BH hungry? */
if (bi->subgrid_mass > bi->mass) {
/* Probability to swallow this particle */
const float prob = (bi->subgrid_mass - bi->mass) * wi / bi->rho_gas;
/* Probability to swallow this particle
* Recall that in SWIFT the SPH kernel is recovered by computing
* kernel_eval() and muliplying by (1/h^d) */
const float prob =
(bi->subgrid_mass - bi->mass) * hi_inv_dim * wi / bi->rho_gas;
/* Draw a random number (Note mixing both IDs) */
const float rand = random_unit_interval(bi->id + pj->id, ti_current,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment