Source-linked AI summary
Magnetohydrodynamics on an unstructured moving grid
Ruediger Pakmor, Andreas Bauer, Volker Springel
TL;DR
Astrophysical MHD requires controlling magnetic-field divergence on flexible numerical meshes. The paper implements ideal MHD in AREPO’s moving Voronoi mesh using Dedner cleaning and finds accurate, robust performance across standard tests, turbulence, and magnetized-cloud collapse.
Problem
Numerical ideal-MHD discretizations can generate growing ∇·B errors, while constrained transport is difficult to adapt to unstructured moving meshes.
Method
The paper implements ideal MHD in AREPO using an adaptive moving Voronoi mesh and Dedner divergence cleaning to keep magnetic-field divergence sufficiently small.
Results
The implementation agrees satisfactorily with published fixed-mesh results, reproduces magnetized-cloud collapse results, and robustly handles driven supersonic magnetic turbulence.
Takeaways & Limitations
The moving-mesh MHD code can be applied to a wide range of astrophysical problems, including star formation, galaxies, galaxy clusters, and accretion disks.
Takeaways & Limitations
Choosing the Dedner cleaning parameters, especially ch, is more challenging for turbulent motions and can affect stability and divergence-error transport.
Abstract
from arXiv · showhide
Magnetic fields play an important role in astrophysics on a wide variety of scales, ranging from the Sun and compact objects to galaxies and galaxy clusters. Here we discuss a novel implementation of ideal magnetohydrodynamics (MHD) in the moving mesh code AREPO which combines many of the advantages of Eulerian and Lagrangian methods in a single computational technique. The employed grid is defined as the Voronoi tessellation of a set of mesh-generating points which can move along with the flow, yielding an automatic adaptivity of the mesh and a substantial reduction of advection errors. Our scheme solves the MHD Riemann problem in the rest frame of the Voronoi interfaces using the HLLD Riemann solver. To satisfy the divergence constraint of the magnetic field in multiple dimensions, the Dedner divergence cleaning method is applied. In a set of standard test problems we show that the new code produces accurate results, and that the divergence of the magnetic field is kept sufficiently small to closely preserve the correct physical solution. We also apply the code to two first application problems, namely supersonic MHD turbulence and the spherical collapse of a magnetized cloud. We verify that the code is able to handle both problems well, demonstrating the applicability of this MHD version of AREPO to a wide range of problems in astrophysics.
1 INTRODUCTION
Astrophysical magnetic fields motivate ideal-MHD simulations, but discretization can generate growing divergence errors that make solutions unphysical. The paper introduces an AREPO MHD implementation using a moving unstructured mesh and Dedner cleaning to address this challenge.
- Magnetic fields influence star formation, accretion-disk angular momentum, and relativistic outflows across astrophysical systems.
- Discrete ideal-MHD equations can generate nonzero ∇·B errors that grow rapidly and render computed solutions unphysical.
- Existing approaches either enforce zero divergence through discretization or modify the equations to keep divergence errors small.
- Constrained transport is difficult to adapt to dynamic unstructured meshes, motivating the use of Dedner cleaning in this implementation.
- The study presents ideal-MHD implementation details in the massively parallel AREPO code and evaluates them with standard tests and astrophysical applications.
2 IMPLEMENTATION
The implementation combines finite-volume MHD on an unstructured moving Voronoi mesh with robust Riemann-solver fallback and Dedner divergence cleaning. Fluxes are formulated in the moving-interface frame to preserve stable upwind evolution while controlling multidimensional magnetic-field divergence.
- 2.1 The equations of magnetohydrodynamics: Ideal MHD is formulated as conservation laws for conserved variables and fluxes, with density, velocity, magnetic field, and total energy defined locally.For zero magnetic field, the equations reduce to the ideal-hydrodynamics treatment already implemented in AREPO.
- 2.2 Solving the Riemann problem: Interface fluxes are computed by reconstructing left and right primitive states at the interface midpoint and advancing them half a timestep.Spatial reconstruction uses a refined gradient-based extrapolation with a slope limiter; the van-Leer limiter is the usual choice and recovers the Cartesian formulation as a special case.
- 2.2 Solving the Riemann problem: The MHD Riemann problem uses HLLD first, then HLL, and finally Rusanov when the preceding solution gives a non-positive interface pressure.This fallback sequence is intended to provide a compromise between accuracy and robustness, with Rusanov guaranteeing a valid solution.
- 2.3 The divergence constraint: Because discretization errors can generate magnetic divergence in multiple dimensions, the implementation uses Dedner cleaning rather than constrained transport on the unstructured moving mesh.The GLM-MHD formulation adds a conserved scalar ψ related to magnetic divergence and an exponentially decaying source term; the cleaning parameters must be chosen for stability without altering the physical solution.
- 2.3 The divergence constraint: The cleaning speed ch must be global and synchronized across cells, while its value balances insufficient divergence transport against disturbance of the physical solution.Local timestepping requires changing ch only when all cells are synchronized, and the additional timestep restriction accounts for its propagation speed.
- 2.4 MHD on a moving grid: Moving-interface fluxes combine static-interface fluxes with interface advection, using a moving-frame formulation that retains upwind character and yields stable evolution on a dynamic Voronoi mesh.A straightforward rest-frame solve followed by advection is unstable when interface and fluid velocities are nearly equal, so additional frame-transformation terms are required.
3 TEST PROBLEMS
The MHD implementation is validated on standard one- and two-dimensional tests, including shock tubes, magnetic-loop advection, blast waves, and the Orszag–Tang vortex. Results show accurate shock and interface resolution, low divergence errors, strong advection performance, and good agreement with ATHENA, while moving-mesh calculations incur higher computational costs.
- Shocktube: Standard shock-tube tests show good agreement across static and moving grids, with HLLD less diffusive than Lax-Friedrich and moving grids resolving slow shocks and contact discontinuities better.The test includes all seven MHD waves and compares both grid types with two Riemann solvers.
- Magnetic-loop advection: The advected magnetic loop is preserved extremely well, with relative divergence errors below ∼10^-3 across nearly the entire loop.The exception is the outer edge, where the magnetic field approaches zero; central errors arise from insufficient angular resolution.
- Magnetic-loop advection: Moving-mesh advection conserves magnetic energy significantly better than a same-resolution static grid and slightly better than a static grid with twice the spatial resolution.This provides a quantitative check of the moving mesh’s advection properties.
- Magnetic blast wave: The magnetic blast wave becomes anisotropic along the magnetic-field direction, while the code captures complex shock dynamics and sharp interfaces.Small post-shock corrugations arise from grid distortions and can be reduced by splitting elongated cells.
- Orszag-Tang vortex: In the Orszag–Tang vortex, AREPO agrees very well with ATHENA at matched resolution across early shock formation and later fully turbulent evolution.The comparison uses identical 600 × 600 resolution elements and examines density and magnetic energy.
- Orszag-Tang vortex: AREPO uses more computational resources than ATHENA: about three times the memory, timesteps smaller by about three, and individual timesteps twice as long on average.The dominant costs include Voronoi-grid construction, which takes about 40% of CPU time, and slower gradient and flux calculations.
4 DRIVEN SUPERSONIC MHD TURBULENCE
The driven supersonic turbulence tests establish stationary turbulence after roughly three dynamical times and show that the moving-mesh MHD implementation produces consistent spectra while keeping divergence errors small.
- Setup: The simulations use a periodic, isothermal, constant-density box with an initially uniform magnetic field and externally driven turbulence.The driving is configured to reach an rms sonic Mach number of about 5.5 after stationary turbulence develops.
- Turbulence evolution: The sonic Mach numbers agree well between 64^3 and 128^3 resolutions, while the higher-resolution run has a slightly smaller average Alfvénic Mach number.After about three dynamical times, the turbulence is fully established; subsequent analysis uses outputs after t = 4 t_d.
- Power spectra: The velocity spectra show driving-dominated low wavenumbers, a kinetic-energy power law at smaller scales, and dissipation near the Nyquist frequency.The spectra are averaged over 70 snapshots from t = 4.4 t_d to 22.0 t_d.
- Power spectra: The magnetic, divergence, and velocity power spectra are compared across 64^3 and 128^3 runs, with the divergence contribution explicitly isolated.The spectra distinguish total magnetic power, divergence power, and velocity power for the two resolutions.
- Divergence control: The divergence error in the 128^3 run is roughly an order of magnitude smaller than in the 64^3 run and remains very small relative to the magnetic-field strength.The spectral shapes are similar to results from a systematic comparison of MHD codes, despite the use of a fully dynamic mesh.
5 COLLAPSE OF A MAGNETIZED CLOUD
The magnetized-cloud collapse test follows a refined, rotating one-solar-mass sphere and forms a protostar, accretion disk, and magnetically driven outflows while adapting to strong central density contrasts.
- Initial conditions: The initial condition is a rigidly rotating homogeneous sphere of radius 0.015 pc and mass one solar mass embedded in a lower-density atmosphere.The simulation uses a 0.06 pc box with inflow/outflow boundaries and an initial resolution of 128^3 cells.
- Adaptive refinement: Refinement is triggered when a cell’s free-fall time becomes shorter than ten sound-crossing times, with a minimum cell volume corresponding to an effective 16384^3 resolution.The minimum cell volume is 5 × 10^-17 pc.
- Collapse outcome: After 1.13 t_ff, a protostar is surrounded by an accretion disk of radius about 0.03 R0, and magnetically powered outflows reach 2 km s^-1 along the z-axis.The central magnetic field is amplified beyond 10^4 μG, while an azimuthal field reaches up to 10^5 μG at the protostar.
- Adaptive mesh: The adaptive mesh follows the cloud’s internal structure and handles its large density contrasts, concentrating most cells near the mass-dominated center.The cell count increases only from approximately 2.1 million to 2.2 million by 1.13 t_ff.
6 CONCLUSIONS
The paper presents ideal MHD in AREPO using a moving adaptive Voronoi mesh and Dedner cleaning, then validates the implementation on standard tests and astrophysical applications. The authors conclude that the method is accurate across a broad range of problems and especially useful where bulk motion and adaptivity matter.
- Numerical method: The implementation combines a freely moving adaptive Voronoi mesh with a second-order finite-volume Godunov scheme based on approximate Riemann solutions.Spatial reconstruction and flux calculation are performed at mesh interfaces.
- Divergence control: Dedner divergence cleaning keeps magnetic-field divergence sufficiently small and is readily applicable to the unstructured dynamic mesh.This is used instead of constrained transport, which is difficult to adapt to such meshes.
- Novelty: The method is presented as the first three-dimensional Lagrangian mesh code capable of following magnetic fields.The authors report retention of high accuracy for shocks and smooth flows, with reduced advection errors during large bulk motions.
- Validation and applications: Standard tests show satisfactory agreement with fixed-mesh MHD results, while magnetized-cloud collapse reproduces results obtained with RAMSES.The code is also applied to driven, highly supersonic isothermal magnetic turbulence.
- Scope: The authors conclude that the MHD version of AREPO can be applied to a wide range of astrophysical problems, including star formation, galaxies, clusters, and accretion disks.Its gravity and collisionless-dynamics modules also support cosmic-structure simulations.