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
......@@ -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,
......
Supports Markdown
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