Skip to content

Fix a drift integration mistake in the coupling of hydro and gravity

Matthieu Schaller requested to merge corrected_drift_operation into master

Store a_grav back in the xpart to avoid an incorrect drift operation where the gpart->a_grav was sometimes accessed after the next step had already started accumulating accelerations. That was a bad mistake introduced by my change to the gravity mesh integration, which primarily affected the Planetary calculations due to their choice of system of units.

In the cosmology system of units, the access to an incorrect value was mitigated by the fact that (in this system) G>1, making the incorrect accelerations (a/G) much smaller than the correct values but not leading to a crash, just to a slightly too small drift (which is a small effect as the hydro forces are usually larger for all interesting regimes).

However, in "planetary units", G<<1, making the incorrect accelerations much too large and leading to a very wrong drift. Then to planet evaporation.

Merge request reports