English

An Adjoint Projection Formulation for Enforcing the divergence-free Constraint in Smoothed Particle Magnetohydrodynamics

Solar and Stellar Astrophysics 2026-06-26 v1 Earth and Planetary Astrophysics Instrumentation and Methods for Astrophysics

Abstract

We present a projection method for controlling numerical \B\nabla\cdot\B errors in smoothed particle magnetohydrodynamics (SPMHD). The method corrects the magnetic field after an MHD update by solving an elliptic projection problem constructed from the same discrete divergence operator used to measure the error. A key ingredient is to use the adjoint gradient associated with a volume-weighted metric. With this choice, the projection gives an energy-minimizing correction, does not increase the discrete magnetic energy, and leads to a symmetric positive semidefinite linear system that can be solved by the conjugate-gradient method without explicitly assembling the matrix. We test the method using two-dimensional Dedner-type divergence tests and three-dimensional magnetized collapse calculations. With sufficiently many iterations, the projection reduces the divergence error to the floating-point roundoff level in both test problems. In realistic collapse runs, practical stopping criteria designed to reduce the divergence error generated by the underlying SPMHD update suppress the normalized divergence error well below that obtained in the divergence-cleaning run, with a projection cost of only about 11--10%10\% of the SPMHD update cost. The density and plasma-β\beta structures remain consistent when the projection interval is varied, whereas the divergence-cleaning run shows quantitative differences. These results indicate that the projection method is a robust and attractive alternative to divergence cleaning for controlling \B\nabla\cdot\B errors in SPMHD and related particle or meshless MHD schemes.

Keywords

Cite

@article{arxiv.2606.28197,
  title  = {An Adjoint Projection Formulation for Enforcing the divergence-free Constraint in Smoothed Particle Magnetohydrodynamics},
  author = {Yusuke Tsukamoto},
  journal= {arXiv preprint arXiv:2606.28197},
  year   = {2026}
}

Comments

21 pages, 9 figures, submitted to JCP