Solver-in-the-Loop Applications in Astrophysical (Magneto)hydrodynamics
Leonard Storcks, Tobias Buck
TL;DR
This work investigates embedding ML components inside differentiable astrophysical simulators to model unresolved dynamics and stabilize low-resolution simulations. It presents two applications: a neural network–parameterized cooling function that recovers high-resolution wind-blown bubble dynamics on coarse grids, and a divergence-free CNN corrector for a 2D MHD blast, with the updated state given by $U_{corr} = U + dt \cdot C(U)$. Training inside the differentiable framework using time-averaged losses demonstrates fidelity gains and feasible compute costs, highlighting the potential for neural operators to generalize subgrid physics in astrophysical contexts. The results motivate broader adoption of solver-in-the-loop ML in astrophysical simulations and pave the way for integrating ML-based physics terms inside existing solvers and non-differentiable codes.
Abstract
We present two promising applications of training machine learning models inside a differentiable astrophysical (magneto)hydrodynamics simulator. First, we address the problem of slow convergence in hydrodynamical simulations of wind-blown bubbles with radiative cooling. We demonstrate that a learned cooling function can recover high-resolution dynamics in low-resolution simulations. Secondly, we train a convolutional neural network to correct 2D magnetohydrodynamics simulations of a specific blast wave problem. These case studies pave the way for the principled application of more general machine learning models inside astrophysical simulators. The code is available open source under https://github.com/leo1200/eurips25corr.
