Skip to content
Snippets Groups Projects

Sphenix pressure floor

Merged Loic Hausammann requested to merge sphenix_pressure_floor into master

In this merge request, I am implementing the pressure floor for SPHENIX. As it is a density scheme, the solution is straight forward and simply requires to use the pressure with the floor in both the momentum and internal equations.

This was tested with the new example PressureFloor. It is simply the cooling box with self gravity. The setup is done in order to collapse quickly (about 1min of simulation) without pressure floor. With the SPHENIX pressure floor, I am able to avoid this collapse.

@jborrow, I am touching a bit SPHENIX, therefore I guess that you may want to take a quick look.

Edited by Loic Hausammann

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
407 408
408 409 /* Compute the sound speed */
409 410 const float pressure = gas_pressure_from_internal_energy(p->rho, p->u);
411 const float pressure_floor =
412 pressure_floor_get_comoving_pressure(p, pressure, cosmo);
410 413 const float soundspeed = gas_soundspeed_from_pressure(p->rho, pressure);
  • Are you sure this is what you want to do? Have a sound-speed that is not consistent with the pressure?

  • Sincerely, I do not think there is a good answer to that question. It depends a bit on how you interpret the pressure floor. Either you can see it as a change in the equation of state and c^2 = \frac{dP}{d\rho} = 0 as the pressure does not depend on the density anymore or you can simply see it as a modification of the equation of motion + energy and then the definition of the sound speed stays the same.

    I decided to take a more pragmatic approach and simply keep everything as simple as possible otherwise I will spend 6 months on it and will not have time to finish properly my thesis. Anyway the sound speed is only used in the artificial terms, therefore it will not have a huge impact and it is only for the particles that are badly resolved and will be transformed into stars.

  • I agree. (And have already argued in the past that a pressure floor like that causes a lot of philosophical troubles.)

    However, the problem with the sound-speed is that you may end up with time-step lengths that are long compare to what they should be if the particle had this pressure. So you may not be able to correctly capture shocks. If this is OK, then that's fine by me but I think this is worth thinking about.

    Also, in any case, we should update the online documentation to specify exactly which variables are affected by the floor.

    Edited by Matthieu Schaller
  • Right now, I prefer to be safe and have a small time step. I will see later (with cosmological simulations) if we can increase it.

    I have updated the doc.

  • You actually have a large time-step now. dt = h / c = h / sqrt(gamma * P/rho)

    If you increase P at fixed rho and h, dt should go down. But only if you recompute it with your new P. If you don't, then you have a dt that is too large.

    Edited by Matthieu Schaller
  • Right, i read your previous message a bit too fast. I will update the code this afternoon.

  • changed this line in version 6 of the diff

  • I have updated the sound speed. In order to do so, I had to change a bit the code in order to compute the sound speed directly from the pressure and not the internal energy. There is a comment about looking at theory just above one of the changes, but from my understanding this comment should not be here and only matters for the pressure-* schemes.

  • Please register or sign in to reply
  • added 1 commit

    Compare with previous version

  • Loic Hausammann added 2 commits

    added 2 commits

    • cda47e0d - Pressurefloor: use pressure floor in sound speed (SPHENIX)
    • d1188c2d - PressureFloor: update doc

    Compare with previous version

  • Loic Hausammann changed the description

    changed the description

  • @jborrow happy with the latest changes to src/hydro/SPHENIX/hydro.h ?

  • By the way josh, in configure.ac, the scheme is still called anarchy-du. Should I update the name?

  • No anarchy-du is just an alias so we don’t break peoples scripts

  • added 1 commit

    • 4d524132 - Pressurefloor: review from josh

    Compare with previous version

  • All the suggestions are implemented. Thanks for the review :)

  • Ok looks good to me now!

  • Thanks everyone!

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