---
title: 'MPI-AMRVAC: Adaptive Mesh Simulation'
url: https://www.emergentmind.com/topics/mpi-amrvac
type: topic
---

# MPI-AMRVAC: Adaptive Mesh Simulation

MPI-AMRVAC, the Adaptive Mesh Refinement Versatile Advection Code, is an open-source, parallel, grid-adaptive simulation framework for hydrodynamics, magnetohydrodynamics, and broader nonlinear PDE systems. Across its major descriptions, it is characterized as a general toolkit for especially hyperbolic/parabolic partial differential equations, built on block-structured adaptive meshes, MPI domain decomposition, and modular physics interfaces that allow applications in 1D, 1.5D, 2D, 2.5D, and 3D, in Cartesian, cylindrical, or spherical geometries [2004.03275][1407.2052][2303.03026]. Although it emerged from solar and astrophysical magneto-fluid dynamics, later work explicitly demonstrated shallow-water, Korteweg–de Vries, reaction–diffusion, radiation-hydrodynamics, radiation-magnetohydrodynamics, frozen-field hydrodynamics, and plasma–neutral two-fluid formulations within the same framework [2004.03275][2104.03968][2205.05049][2503.02764].

## 1. Architecture, scope, and code organization

MPI-AMRVAC is organized around physics “modules,” each written in conservative form,
$$
\partial_t \mathbf{U} + \nabla\!\cdot\mathbf{F}(\mathbf{U}) = \mathbf{S}(\mathbf{U}) ,
$$
with module-specific state vectors, fluxes, wave speeds, and source terms [1407.2052][2004.03275][2303.03026]. The code architecture separates the PDE system from mesh management, parallelization, and high-resolution update routines, so that new equation sets can be introduced by providing flux, source, primitive-to-conserved, conserved-to-primitive, and timestep-related callbacks [2004.03275].

A recurring theme in the code lineage is expansion rather than replacement. MPI-AMRVAC 2.0 emphasized radial grid stretching, generic splitting of any background magnetic field, anisotropic thermal conduction in multi-dimensional MHD, modernization into a library, automatic regression tests, inline/online Doxygen documentation, and a future-proof restart format [1710.06140]. MPI-AMRVAC 3.0 then added equation sets and analysis tools that include magnetofrictional evolution, the Regularized-Biot-Savart-Law approach for flux-rope insertion, synthetic observations, particle modules, and generic fieldline tracing compatible with hierarchical meshes [2303.03026].

A concise view of representative capabilities is given below.

| Capability | Description | Representative source |
|---|---|---|
| `hd`, `mhd`, `rhd`, `mf`, `twofl`, `rd`, `ard`, `nonlinear` | Equation modules in MPI-AMRVAC 3.0 | [2303.03026] |
| Frozen-field HD | Field-aligned HD on a prescribed static magnetic field | [2404.17056] |
| Two-fluid plasma–neutral model | Charged and neutral fluids coupled by collisions with IMEX stepping | [2205.05049] |
| FLD radiation modules | Radiation-hydrodynamics and radiation-magnetohydrodynamics | [2104.03968][2503.02764] |

A common misconception is that MPI-AMRVAC is restricted to Newtonian MHD. The 2020 toolkit paper explicitly presents applications “covering any-dimensional scalar to system PDEs,” including Korteweg–de Vries, shallow water, and reaction–diffusion systems, while later papers add radiation transport, frozen-field HD, and plasma–neutral two-fluid dynamics [2004.03275][2104.03968][2205.05049].

## 2. Adaptive mesh refinement, discretization, and parallel execution

MPI-AMRVAC uses a purely block-based quadtree (in 2D) or octree (in 3D) hierarchy, with each block a small uniform grid plus ghost layers, and with refinement by a factor two into 4 children in 2D or 8 children in 3D [2004.03275][1710.06140]. Blocks are assigned to MPI ranks via a space-filling ordering, specifically a Morton/Z-curve in the 2020 description, to preserve locality, and ghost-cell exchanges between neighbor blocks use nonblocking MPI communication [2004.03275]. The framework therefore combines local mesh adaptivity with distributed-memory parallelism as a native rather than auxiliary feature.

Refinement control is based on user-selectable criteria. The 2017 release highlights a Löhner-type error estimator with separate refinement and coarsening thresholds, while later papers describe refinement on gradients or on problem-specific indicators such as neutral-density perturbations, drift velocities, temperature gradients, radiation energy, or wave-energy gradients [1710.06140][2205.05049][2503.02764][2510.27553]. The 2014 paper additionally introduced a distinction between active and passive blocks, allowing regions controlled analytically or remaining stationary to be excluded from the fluid update while maintaining a safety belt of active patches around them [1407.2052].

Spatial discretization is predominantly finite-volume and cell-centered, using approximate Riemann solvers such as TVDLF, HLL, HLLC, HLLD, and Roe, combined with reconstructions ranging from second-order TVD limiters to MP5, WENO3, WENO5, WENO7, and TENO-type options [2004.03275][2303.03026]. Time integration includes strong-stability-preserving Runge–Kutta schemes up to fourth order, source splitting, Super-Time-Stepping for selected parabolic terms, and multiple IMEX Runge–Kutta schemes for stiff source couplings [1407.2052][2303.03026].

Parallel performance is a persistent design target. The 2014 “magnetic island” weak-scaling study on IBM BG/Q reported \(>99\%\) weak-scaling efficiency from 1,024 to 31,250 cores [1407.2052]. MPI-AMRVAC 2.0 reported satisfactory strong scaling up to 2000 cores for 3D AMR simulations of solar coronal rain [1710.06140]. The geometric multigrid library coupled to MPI-AMRVAC presented strong-scaling results up to 1792 cores [1901.11370]. Later module papers give additional pointwise performance figures, such as \(>75\%\) efficiency on 512 cores for \(1\times10^6\) cells in the 1D UAWSoM study [2510.27553].

## 3. Divergence control, multigrid, and stiff operators

For MHD, MPI-AMRVAC supports multiple strategies for controlling \(\nabla\!\cdot\mathbf{B}\), including Powell-source, Janhunen, Dedner-GLM, parabolic diffusion, multigrid-based elliptic projection, and constrained transport [2303.03026][1901.11370]. This multiplicity is technically important because later benchmark papers emphasize that different flavors of spatio-temporal schemes and magnetic monopole control can produce consistent MHD results in combination with adaptive meshes [2303.03026].

The multigrid component became a major architectural extension. The library described in “A geometric multigrid library for quadtree/octree AMR grids coupled to MPI-AMRVAC” supports 2D quadtree and 3D octree grids, Cartesian 2D/3D and cylindrical 2D geometries, standard second-order 5-point or 7-point discretizations, periodic/Dirichlet/Neumann boundaries, and free-space boundary conditions for 3D Poisson problems via an FFT-based coarse-grid solver [1901.11370]. It is coupled to the AMR hierarchy through mirrored block indexing and pointer-based data attachment, and it was demonstrated in elliptic projection for magnetic divergence cleaning [1901.11370].

The same infrastructure underlies later radiation modules. The FLD radiation-hydrodynamics implementation advances gas variables with explicit HD solvers plus explicit radiation sources, while the radiation energy equation is solved in an IMEX split between advection-plus-explicit terms and an implicit diffusion/heat–cool step, with the diffusion solve performed by a geometric multigrid solver [2104.03968]. The radiation-magnetohydrodynamics extension adopts the same FLD closure and similarly treats \(\nabla\!\cdot(D\nabla E)\) implicitly with octree-mg, while hyperbolic MHD terms remain explicit [2503.02764].

Stiff source handling also appears in non-radiative modules. The two-fluid implementation uses a third-order ARS3 IMEX scheme for collisional coupling between charged and neutral fluids, because an explicit timestep would otherwise scale as the inverse collision frequency in the strongly collisional lower chromosphere [2205.05049]. MPI-AMRVAC 3.0 also documents STS strategies for ambipolar diffusion and other parabolic terms, with example speed-ups relative to purely explicit stepping [2303.03026]. This suggests that MPI-AMRVAC’s numerical identity is not only shock-capturing AMR, but also the systematic accommodation of elliptic and stiff subsystems within the same block-adaptive framework.

## 4. Major physics modules and specialized formulations

The “classical” MPI-AMRVAC physics base comprises hydrodynamics and Newtonian MHD in ideal, resistive, Hall, isothermal, and full-energy formulations, with additional support for dust-fluid coupling, gravity, radiative cooling, viscosity, and thermal conduction [1407.2052][2303.03026]. The 2017 release added generic magnetic field splitting,
$$
\mathbf{B}=\mathbf{B}_0+\mathbf{B}_1,\qquad \partial_t\mathbf{B}_0=0,\quad \nabla\cdot\mathbf{B}_0=0,
$$
to improve robustness in extremely low-\(\beta\) plasmas by evolving only the perturbation field and incorporating the background field through source terms [1710.06140]. The same release also generalized slope-limited symmetric anisotropic thermal conduction from 2D to 3D [1710.06140].

Later versions substantially broadened the module set. MPI-AMRVAC 3.0 lists `mf` for magnetofrictional evolution, `twofl` for plasma–neutral two-fluid systems, and `rhd` for radiation hydrodynamics via FLD, while also documenting gas–dust coupling, synthetic thermal emission, particle tracing, and magnetic field-line tracing [2303.03026]. The magnetofrictional module solves
$$
\mathbf{v}=\nu^{-1}\,\mathbf{J}\times\mathbf{B},
$$
with a staggered constrained-transport implementation for force-free relaxation and data-driven evolution [2303.03026]. The Regularized-Biot-Savart-Law approach computes embedded flux-rope fields through line-integral vector potentials, providing a practical bridge between analytic insertion and full MHD evolution [2303.03026].

The frozen-field hydrodynamic module constitutes a different type of extension. In this formulation, \(\partial_t \mathbf{B}=0\) and \( \mathbf{v}=v_\parallel \hat{\mathbf b}\), so that the induction equation is dropped and mass, momentum, and energy are projected along a prescribed static field [2404.17056]. The governing conservative equations are
$$
\partial_t \rho + \nabla\cdot(\rho\,v_\parallel\,\hat{\mathbf b})=0,
$$
$$
\partial_t(\rho v_\parallel)+\nabla\cdot[(\rho v_\parallel^2+p)\hat{\mathbf b}]=\rho g_\parallel + p(\nabla\cdot\hat{\mathbf b}),
$$
with the non-adiabatic energy equation including Spitzer conduction, optically thin cooling, and heating [2404.17056]. The follow-up optimization paper adds hyperbolic thermal conduction and block-based TRAC to the ffHD model for 3D prominence formation [2411.16415].

The most recent solar-coronal extension in the provided corpus is UAWSoM, the “Uniturbulence and Alfvén Wave Solar Model,” which extends the existing MHD physics module by adding four new scalar fields, \(W_A^\pm\) and \(W_k^\pm\), representing outward/inward Alfvén and kink wave energy densities, together with wave pressures, dissipation and reflection source terms, radiative cooling, and field-aligned thermal conduction [2510.27553]. In that formulation the total energy includes \(\sum_s(W_s^+ + W_s^-)\), and the module modifies both source terms and fluxes in the MHD update [2510.27553].

## 5. Solar and astrophysical applications

MPI-AMRVAC has been used for a wide range of solar and non-solar applications. The 2014 and 2017 overview papers discuss Bondi accretion, Bondi–Hoyle–Lyttleton flow, clumpy wind accretion in supergiant X-ray binaries, global spherical PFSS extrapolations, magneto-convection, Hall-MHD reconnection, current-sheet diffusion, and ideal-MHD solar wind calculations [1407.2052][1710.06140]. The 2021 FLD paper demonstrates a preliminary scientific application to spherically symmetric, radiation-driven, optically thick supersonic outflows from massive Wolf–Rayet stars [2104.03968]. The 2025 RMHD paper then adds benchmark cases for steady radiative MHD shocks, radiation-damped linear MHD waves, radiation-modified Riemann problems, and 2D radiative magnetoconvection [2503.02764].

Solar applications form a particularly dense branch of MPI-AMRVAC development. The self-consistent 2.5D flare setup solves resistive MHD with gravity, anisotropic heat conduction, optically thin radiation, background coronal heating, and beam-electron source and sink terms, while tracing field lines to map non-local thick-target beam heating back onto the AMR grid [2310.09939]. The prominence and coronal-rain review describes how MPI-AMRVAC is used for thermal-instability-driven condensations in 1D loops, 2.5D arcades, and full 3D flux ropes, together with synthetic EUV and spectral diagnostics [2510.04222].

The frozen-field HD studies are positioned between full MHD and 1D field-line hydrodynamics. In the 2D evaporation–condensation benchmark, “Overall, the performance of 2D ffHD is close to that of 2D MHD and pseudo-2D HD,” while full MHD lags slightly because of field deformation in the transition region [2404.17056]. The 3D optimization paper then reports a prominence embedded in a magnetic flux rope that develops into a stable slab-like filament, with synthetic SDO/AIA and H\(\alpha\) observables generated from the simulation output [2411.16415].

The UAWSoM study exemplifies MPI-AMRVAC’s use as a platform for new coronal-heating closures. It compares kink-wave-driven and Alfvén-wave-driven heating in a solar-atmosphere model and reports that kink-wave-driven models “are able to sustain a stable atmosphere without requiring any artificial background heating terms,” whereas pure Alfvén-only runs in the parameter study collapse through radiative losses without a background heater [2510.27553]. The same study validates MPI-AMRVAC against a FiPy-based Python implementation, with temperature profiles agreeing to within \(5\)–\(10\%\) and wave-dissipation lengths differing by less than \(1\) Mm [2510.27553].

## 6. Limitations, assumptions, and interpretive context

Several MPI-AMRVAC modules are defined by deliberate asymptotic or closure assumptions rather than by an attempt at universal completeness. The frozen-field HD model assumes \( \mathbf{B}\) static and strong everywhere; the paper states that it fails near nulls or \(\beta\gtrsim1\) regions and cannot capture Alfvén or fast-mode waves, magnetic reconnection, or field-line deformation [2404.17056]. The ffHD optimization paper further treats heat transport through hyperbolic thermal conduction and TRAC as performance-oriented approximations to classical parabolic conduction and transition-region resolution [2411.16415].

The radiation modules adopt flux-limited diffusion. In the 2021 radiation-hydrodynamics paper, the new module is presented as a convenient and versatile tool for optically thick environments, while the 2025 RMHD paper formulates shocks and waves explicitly in the diffusion limit and adds a radiative diffusion mode to the classical MHD wave structure [2104.03968][2503.02764]. A plausible implication is that FLD in MPI-AMRVAC is best understood as a controlled approximation with a well-defined validity envelope, not as a substitute for multi-frequency angle-dependent radiative transfer. This interpretation is consistent with the prominence-and-rain review, which notes that radiation is “only approximate or post-processed” and identifies future coupling to external NLTE radiative-transfer tools as an extension path [2510.04222].

The two-fluid plasma–neutral implementation also exposes the distinction between infrastructure and physical model choice. The paper states that a temperature- and density-dependent collisional parameter is implemented, but all tests use a constant, uniform \(\alpha\) “for easier comparison to analytic results” [2205.05049]. Likewise, the UAWSoM study sets \(\mathcal{R}_k=0\) in the present investigation and focuses on parameter scans in the Alfvén reflection coefficient \(\sigma\) and in the partition of injected Alfvén and kink energy, with the additional finding that high \(\sigma\) leads to wave-pressure overloading and catastrophic cooling [2510.27553].

Taken together, these studies present MPI-AMRVAC less as a single fixed solver than as a block-adaptive research framework in which physically distinct reduced models, full MHD systems, and operator-split stiff couplings can be implemented, compared, and validated under a common AMR/MPI infrastructure [2004.03275][2303.03026].

Source: https://www.emergentmind.com/topics/mpi-amrvac