Improving divergence cleaning in cosmological SPMHD simulations
arXiv:2511.19615
Abstract
We implement the constrained hyperbolic/parabolic divergence cleaning algorithm into the cosmological smoothed particle magnetohydrodynamics (SPMHD) code {\sc OpenGadget3}, modifying the governing equations so that the scheme can be applied consistently in an expanding cosmological framework. This ensures that divergence errors in the magnetic field are actively propagated away and damped, rather than advected with the flow and partially controlled by source terms as in the previously employed Powell eight-wave approach. We validate the implementation on a series of standard test problems -- the advection of an artificial divergence pulse, the Orszag--Tang vortex, the Brio--Wu shock tube, and a magnetised Zeldovich pancake -- which confirm that the scheme reduces divergence errors while preserving the correct physical evolution. We then apply the method to a fully cosmological simulation of a massive galaxy cluster with , and compare directly to the Powell-only approach. The overall density structure of the cluster is largely unchanged by the choice of divergence cleaning, and the magnetic field geometry and strength in the cluster core remain similar. In the cluster outskirts (--~Mpc), however, the magnetic field is amplified by a factor of 5--10 compared to the Powell-only run, while the divergence error is reduced by 2--3 orders of magnitude throughout the cluster volume. Our results suggest that accurate divergence control is essential for capturing magnetic field amplification in the low-density, poorly resolved outskirts of galaxy clusters.
15 pages, 13 figures, comments welcome! Accepted by MNRAS