Table of Contents
Fetching ...

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.

Solver-in-the-Loop Applications in Astrophysical (Magneto)hydrodynamics

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 . 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.

Paper Structure

This paper contains 9 sections, 3 equations, 8 figures.

Figures (8)

  • Figure 1: Radial profiles of density, pressure, velocity, and temperature (top row) comparing the high-resolution reference simulation ($N = 10000$ cells), the uncorrected low-resolution simulation ($N = 500$ cells), and the corrected low-resolution simulation using the learned effective cooling function. The shaded region is ignored for reasons discussed in Sec. \ref{['app:injection']}. The bottom panel shows the mean squared error between the low-resolution and high-resolution solutions over time.
  • Figure 2: Comparison between the radiative cooling function from schure2009 and the learned effective cooling functions for simulations at different resolutions. The learned functions compensate for under-resolved high-resolution details.
  • Figure 3: In the top row from left to right the final density field for an MHD blast setup is shown for a low-resolution simulation with $64^2$ cells, a low-resolution with $64^2$ cells but a corrective convolutional neural network applied to the state after each time step, and a high-resolution simulation down-averaged from $512^2$ to $64^2$ cells. In the bottom panel, the mean squared error (MSE) over time of the uncorrected and corrected low-resolution simulations with respect to the down-averaged high-resolution simulation is shown.
  • Figure 4: Density profiles for stellar wind simulations following the setup of vanMarle2011 at $t = 1.25 \cdot 10^{12} \, \text{s}$ without (left panel) and with cooling (right panel) for different resolutions of $N = \{ 500, 1000, 2000, 10000 \}$ cells. The position of the shock and the profile of the swept-up gas are largely independent of the resolution in the case without cooling but only converge slowly if radiative cooling is introduced vanMarle2011.
  • Figure 5: Radial profiles of density, pressure, velocity, and temperature (top row) comparing the high-resolution reference simulation ($N = 10000$ cells), the uncorrected low-resolution simulation ($N = 1000$ cells), and the corrected low-resolution simulation using the learned effective cooling function. The bottom panel shows the mean squared error between the low-resolution and high-resolution solutions over time.
  • ...and 3 more figures