Alternative definition of the number of neighbours
Better way to implement the alternative definition of the neighbour number.
Merge request reports
Activity
@jborrow Could you test this on the hydro tests?
(Sorry about the confusing MR close/reopen)
This seems to work for tests that use the same mass for all particles. All plots below use the 2D version of the code with Anarchy-DU and the cubic spline. Here, I show the examples/SodShock_2D test:
Without mass weighting:
With mass weighting:
Now, something more interesting would be e.g. the SquareTest_2D, where we actually do use different masses for the particles.
Without mass weighting:
With mass weighting:
Note that this is also a problem with the Pressure-Energy scheme, albeit a smaller one. The edges of the square get feathered and we develop random instabilities.
My reaction:
Edited by Josh Borrowadded 1 commit
- 4ad9d40e - Fixed incorrect variable name in PressureEnergyMorrisMonaghanAV
FWIW, the ANARCHY-DU scheme now converges well on the Square Test with equal particle masses :).
Why would that have changed with this branch?
Btw, this MR breaks the PressureEnergy scheme because of l1055 in runner_ghost.c;
Thanks, I'll fix this.
Now, something more interesting would be e.g. the SquareTest_2D, where we actually do use different masses for the particles.
Can you make a map of
h
andrho
after the 0th step here to see the differences?Edited by Matthieu Schaller@lhausammann you recently removed
rho_dh
from the Pressure-Energy hydro scheme.If we merge this, we would like to add it back. Do you see this as a fundamental problem?
The idea is to offer an alternative definition of N_ngb, which can make a difference in cases where particles have different masses.
added 1 commit
- f5acadad - Re-introduced rho_dh in the Pressure-Energy SPH hydro case to allow for the…
@jborrow the PU scheme should now work.
@lhausammann @jborrow any last-minute comments?
318 of particles to use. By default, we use 319 320 .. math:: 321 n_i = \sum_j W(\|\mathbf{r}_i - \mathbf{r}_j\|, h_i) 322 323 but switching on the ``use_mass_weighted_num_ngb`` flag changes the 324 defintion to: 325 326 .. math:: 327 n_i = \frac{\rho_i}{m_i} 328 329 where the density has been computed in the traditional SPH way 330 (i.e. :math:`\rho_i = \sum_j m_j W(\|\mathbf{r}_i - \mathbf{r}_j\|, 331 h_i)`). Note that in the case where all the particles in the simulation 332 have the same mass, the two definitions lead to the same number density 333 value. added 1 commit
- 2639e8ec - Add a message of caution about the alternative neighbour number definition.
mentioned in commit be03ddca