UoB-HPC / stdpar-nbody

https://research-information.bris.ac.uk/en/publications/efficient-tree-based-parallel-algorithms-for-n-body-simulations-u
MIT License
2 stars 0 forks source link

Consider adding gravitational softening #42

Open illuhad opened 3 months ago

illuhad commented 3 months ago

In nbody simulations, often gravitational softening is included. This is a small value added to the distance in the denominator of the force computation: F = G*m_j*m_2 normalize(r_j - r) * 1/(|r_j -r|^2+epsilon)

This rounds off the singularity at |r_j - r| = 0, and is in fact also physically meaningful since in practice bodies are not point-like particles anyway, so in the real world there is never a singularity.

Numerically, this has two advantages: