Skip to content
Snippets Groups Projects

Fix jet initial velocities

Merged Filip Husko requested to merge fix_jet_initial_velocities into master

Fixes #866 (closed).

Edited by Matthieu Schaller

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • @dc-husk1 @matthieu The code looks fine, but in order to be sure that everything works as expected I suggest doing two unit tests:

    1. Record the change in gas particles' actual kinetic energies immediately before and after the kick, and verify that these numbers agree with how much kinetic energy the particles are expected to receive.

    2. Check that the velocity with which the gas particle is kicked in fact (which can be different from v_jet) becomes equal to the target jet velocity, v_jet, when the relative velocity between the BH and gas particles approaches zero. For this test, I'd record the actual velocity with which the gas particles are kicked and the relative velocity between them and the BH. Then I'd plot one against the other.

  • By the way, the plot I recommended in point 2 would also be useful to see how different v_jet is (at a fixed relative velocity) before and after the bug fix.

  • Author Developer

    Here are the results of the test you recommended, @chaikin. I recorded the final and initial velocities (in the frame of the BH) for each kicking event, as well as the kinetic energies calculated using those same velocities. Below I show the plots of v_final vs. v_init and E_fin vs. E_init. The two plots are closely related since they are showing almost the same thing (because I use the velocities to calculate the energies).

    We can see that in the buggy version, the final energy is not what is expected from energy conservation, but it is in the fixed version. From the velocity plot we can see that in some cases, the relative velocity (w.r.t. the BH) can be less than the target kick velocity (3160 km/s), probably in cases when the particles were moving towards the BH.

    Edit: these are from a 25 Mpc low-res snapshot at z=0. energies.png velocities

    Edited by Filip Husko
  • Matthieu Schaller changed the description

    changed the description

  • Could you repeat that test for the velocities used in the FLAMINGO jet model?

  • Author Developer

    Yes, I can do two runs (1000 km/s and 2000 km/s for the fiducial and strong jet runs, respectively). Of course, the dynamics of the gas will be a bit different to FLAMINGO, but it should still be roughly representative.

    We want this test to be done with the bug included, right? To see the spread in all the red dots?

  • Yes, exactly. To see what the true scatter is. As the fiducial velocity is low, the scatter may be quite dominant there.

  • I presume that since the scatter is more or less symmetric around the true values, it explains why the difference in galaxy properties before and after the fix is so small (because the errors average out to ~zero).

  • Author Developer

    Here are the results for v_jet = 2000 km/s and v_jet = 1000 km/s (at z=2 already since there are plenty of kicks by then with these lower velocities): velocities_2000 velocities_1000

  • Thanks. Could you post this also in the colibre black holes slack please?

  • Filip Husko added 1 commit

    added 1 commit

    • a36012e1 - Improve description for initial velocity

    Compare with previous version

  • Matthieu Schaller resolved all threads

    resolved all threads

  • Excellent, thanks. I'll propagate to COLIBRE.

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading