1 Introduction

Compressible magnetized plasma flows are mathematically modeled by the equations of magnetohydrodynamics (MHD), that constitute a first order hyperbolic system of nonlinear partial differential equations (PDE). Potential practical applications concern astrophysics to describe plasma flows in the magnetosphere of neutron stars, or inertial and magnetic confinement fusion, in order to calibrate or design fusion reactors for civil energy production.

The dynamics of plasma flows can involve different time scales, that correspond to the characteristics of the governing PDE system. The multi-scale nature of the MHD equations can be analyzed by considering the Mach number \({M}_{c}\), which is the ratio between the fluid velocity and the sound speed, and the Alfvén number \({M}_b\), that represents the ratio between the fluid velocity and the speed of the Alfvén wave related to the magnetic field. Different values of \({M}_{c}\) and \({M}_b\) yield different fluid regimes, and, consequently, the nature of the governing equations can change passing for instance from hyperbolic to elliptic. A classical example is given by low Mach number flows, which are dominated by acoustic waves, hence recovering an incompressible fluid regime in the stiff relaxation limit for \({M}_{c}\rightarrow 0\). On the other hand, the material speed is of the same order than the acoustic wave speeds in high Mach number flows, thus leading to compressible fluids with shock waves. Another source of stiffness arises for highly magnetized flows, i.e. for \({M}_b\rightarrow 0\), that are typically encountered in Tokamak scenarios for magnetic confinement fusion applications.

The numerical resolution of the MHD equations is therefore very challenging if the numerical method is required to deal with the entire spectrum of the different time scales. Explicit Godunov-type finite volume schemes [4, 40, 42] exhibit excellent shock-capturing properties that can perfectly handle high Mach number flows. However, if different regimes coexist in the flow, two main problems are generated by the different time scales that can be assumed by the model: (i) the computational time step obeys a stability condition that is constrained by the magnitude of the fastest characteristic speeds, hence leading to very small time steps in the stiff relaxation limits of the model which make the simulation extremely slow, and, ultimately, even impossible to be accomplished; (ii) the numerical viscosity does not have the correct scaling but is of order \(\mathcal {O}(1/{M}_{c})\) which is especially severe for low Mach number flows and therefore the accuracy of the solution is compromised [29, 41].

To tackle these challenges, a first strategy consists in rescaling the dissipation term in the numerical flux so that the numerical viscosity becomes independent of the Mach number [8, 9, 11, 22]. A fully implicit time integration has then to be adopted to circumvent the restrictive time step condition [47, 61], which leads to a highly nonlinear system to be solved with a large number of unknowns, or local time stepping techniques can be foreseen [1, 19]. Another possibility is instead given by the implicit treatment of only one part of the system to be solved while keeping the remaining part explicit [10, 20, 25, 26, 31, 32, 37, 49]. The terms responsible to a possible stiffness of the governing model undergo an implicit discretization in which no numerical diffusion is needed, since stability follows from implicitness, so that the above mentioned problems of explicit solvers can be simultaneously solved. This technique makes often use of the class of IMplicit–EXplicit (IMEX) time integrators forwarded e.g. in [2, 13, 14, 16, 52, 53], that have been developed with the specific purpose of dealing with multiple time scales, typically a slow and a fast time scale. Furthermore, these IMEX schemes are proven to be Asymptotic Preserving (AP) and, some even Asymptotically Accurate (AA) meaning that they recover a consistent discretization of the limit model also with high order accuracy.

Besides the multi-scale character, the MHD equations embed another constraint on the divergence of the magnetic field, which must remain zero at all times because no magnetic monopoles exist in nature. This is an involution that has to be carefully taken into account by the numerical scheme, since in principle it is not satisfied at the discrete level. In the literature, there are three main approaches to satisfy the solenoidal property of magnetic field in a numerical scheme: (i) the use of staggered grids is typically adopted to cancel the divergence errors, which requires the knowledge of the electric field [7, 62]; (ii) divergence cleaning methods [28, 51] add one hyperbolic equation to the MHD system in order to transport away the divergence errors, which require the determination of the cleaning speed as a new parameter; (iii) constrained transport schemes on collocated grids that also make use of the electric field [38, 43, 44].

The aim of this paper is to design a numerical scheme for the ideal MHD equations that can handle fast time scales which might be induced by both the stiff limits \({M}_{c}\rightarrow 0\) and \({M}_b\rightarrow 0\), while retaining shock-capturing properties in the case of high Mach number flows. To face the multi-scale nature of the model, we rely on the implicit–explicit approach, whereas the divergence-free involution is preserved by means of mimetic finite difference operators [45, 48, 50] on collocated meshes. For the low Mach number regime, we follow the schemes forwarded in [20] for compressible viscous flows. This approach has been extended to magnetohydrodynamics in [10, 25], thus devising asymptotic preserving methods for the hydrodynamic sub-system of the MHD model up to third order space-time accuracy. On staggered meshes, semi-implicit finite volume schemes have been developed in [31], and hybrid finite volume/finite element methods are presented in [37]. These schemes are second order accurate in space and first order accurate in time. For the low Alfvén regime, the only semi-implicit scheme currently available in the literature is presented in [36] with first order in time accuracy, where staggered grids are used, and the implicit sub-system results to be non-linearly coupled, hence requiring to resort to a fixed point algorithm to linearize the problem combined with a nested Newton algorithm which is very challenging in practice.

In this work, we propose a novel semi-implicit finite volume scheme that is second order accurate in both space and time. The semi-implicit IMEX strategy of [12] is adopted to devise an overall second-order all Mach and Alfvén number scheme that only involves linear implicit systems for the fast scales. Consequently, neither Newton solvers nor Picard iteration techniques will be needed. A standard explicit TVD finite volume method is employed for the non-linear convective terms. To respect the involution on the magnetic field, simple collocated grids are used onto which we design a structure-preserving div-curl operator that is retrieved as the second order version of the div-curl discontinuous Galerkin operators recently forwarded in [17]. To this end, the MHD model is reformulated in terms of the magnetic potential which generates the magnetic field by its curl.

The paper is structured as follows. In Sect. 2, we briefly recall the model of ideal MHD equations and its non-dimensional formulation in terms of Mach and Alfvén number. Then, the numerical scheme is introduced in Sect. 3 where we first focus on the operator splitting in a one-dimensional framework and subsequently describe the multi-dimensional time semi-discrete scheme based on the magnetic potential instead of evolving the magnetic field. In the multi-dimensional case, we especially focus on the cell-centered operators that are designed to preserve exactly the div-curl involution constraint for the magnetic potential. This finally yields a divergence-free fully discrete multi-dimensional finite volume scheme. In Sect. 4, a series of test problems in up to three space dimensions is presented to numerically verify the performance of the numerical schemes at various Mach and Alfvén numbers. A section providing a summary and an outlook to future developments concludes the paper.

2 Governing Equations

We consider the ideal MHD equations on a three-dimensional domain \(\Omega \subset \mathbb {R}^3\) where \({\textbf {x}}= (x,y,z) \in \Omega \) is the vector of spatial coordinates and \(t \in \mathbb {R}^+_0\) denotes the time coordinate. They write

$$\begin{aligned} \frac{\partial }{\partial t} \left( \begin{array}{c} \displaystyle \rho \\ \displaystyle \rho {\textbf {v}}\\ \displaystyle \rho E \\ \displaystyle {\textbf {B}}\end{array} \right) + \nabla \cdot \left( \begin{array}{c} \displaystyle \rho {\textbf {v}}\\ \displaystyle \rho {\textbf {v}}\otimes {\textbf {v}}+ \left( p + \frac{\Vert {\textbf {B}}\Vert ^2}{8 \pi }\right) \mathbb {I} - \frac{1}{4\pi } {\textbf {B}}\otimes {\textbf {B}}\\ \displaystyle \left( \rho E + p + \frac{\Vert {\textbf {B}}\Vert ^2}{8 \pi }\right) {\textbf {v}}- \frac{1}{4 \pi } {\textbf {B}}({\textbf {v}}\cdot {\textbf {B}}) \\ \displaystyle {{\textbf {B}}\otimes {\textbf {v}}- {\textbf {v}}\otimes {\textbf {B}}} \end{array} \right) = {\textbf {0}}. \end{aligned}$$
(1)

Therein, the density is denoted by \(\rho \), the pressure by p, the velocity field by \({\textbf {v}}= (u,v,w)\) and the magnetic field by \({\textbf {B}}= (B_x, B_y, B_z)\) which obeys

$$\begin{aligned} \nabla \cdot {\textbf {B}}= 0, \end{aligned}$$
(2)

hence imposing that the magnetic field lines are always closed. The identity matrix is denoted by \(\mathbb {I}\). The total energy density is composed of the internal energy \(\rho e\), the kinetic energy \(\rho k\) and the magnetic energy density \( m \):

$$\begin{aligned} \rho E = \rho e + \rho k + {m} \qquad \text {with} \qquad k = \frac{1}{2}\Vert {\textbf {v}}\Vert ^2, \quad m = \frac{\Vert {\textbf {B}}\Vert ^2}{8 \pi }. \end{aligned}$$
(3)

The system is closed by the ideal gas equation of state (EOS)

$$\begin{aligned} \rho e = \frac{p}{\gamma - 1}, \end{aligned}$$
(4)

with \(\gamma \) representing the ratio of specific heats. Thus, the pressure is a linear function of the total energy density \(\rho E\) and can be computed as \(p = (\gamma - 1)(\rho E - \rho k -{m})\). Further, the sound speed, the so-called total and directional Alfvén speeds are defined respectively by

$$\begin{aligned} c = \sqrt{\frac{\gamma p}{\rho }}, \quad b = \sqrt{\frac{\Vert {\textbf {B}}\Vert ^2}{4 \pi \rho }}, \quad b_{n} = \sqrt{\frac{({\textbf {B}}\cdot {\textbf {n}})^2}{4 \pi \rho }}, \end{aligned}$$
(5)

where \({\textbf {n}}\) denotes a unit vector pointing normal to the flow direction. The ideal MHD system (1) exhibits 8 characteristic speeds \(\lambda _{\{1\ldots 8\}}\) in normal direction \({\textbf {n}}\) given by

$$\begin{aligned} \lambda _{1,8} = {\textbf {v}}\cdot {\textbf {n}}\mp c_f, \quad \lambda _{2,7} = {\textbf {v}}\cdot {\textbf {n}}\mp b_n, \quad \lambda _{3,6} = {\textbf {v}}\cdot {\textbf {n}}\mp c_s, \quad \lambda _{4,5} = {\textbf {v}}\cdot {\textbf {n}}, \end{aligned}$$
(6)

where \(c_{s,f}\) denote the slow and fast magneto-sonic wave speeds which read

$$\begin{aligned} c_{s,f} = \sqrt{\frac{1}{2}\left( c^2 + b^2 \mp \sqrt{(c^2 + b^2)^2 - 4 c^2 b_n^2}\right) }. \end{aligned}$$
(7)

For a detailed discussion of the ideal MHD Eq. (1) and its structure see e.g. [55].

2.1 Scaling of the Ideal MHD Equations

The MHD system (1) is characterized by multiple time scales, which depend on the physical phenomena under consideration. A sub-system of the ideal MHD equations is indeed given by the Euler equations of gas dynamics, in which a stiffness might be originated in the momentum equations by the pressure waves. In this case, the sound speed is much faster than the local fluid velocity, thus weakly compressible flows are retrieved. The scaling parameter is the Mach number, defined as \({M}_{c}= \Vert {\textbf {v}}\Vert /c\), and these flows are typically affected by a low Mach regime. Another interesting case is given by large magnetic fields, where the Alfvén speeds \( b \) are significantly faster than the local velocity or even faster than the sound speed c. Analogously to the Mach number, we can define a parameter \({M}_b= \Vert {\textbf {v}}\Vert /b\) associated to the Alfvén speed \( b \), which is referred to as Alfvén Mach number.

To analyze the influence of those parameters on the dynamics of the model, we consider the non-dimensional formulation of the ideal MHD equations (1). To that end, we employ a decomposition of a dimensional variable \( q \) in the associated non-dimensional variable \(\tilde{q}\) and a reference value \(q_\text {ref}\) that contains the units of measurements as well. Thus we can write \(q = \tilde{q} q_\text {ref}\). The convective scale is given by \(v_\text {ref}= x_\text {ref}/t_\text {ref}\), where \(x_\text {ref}\) and \(t_\text {ref}\) denote the reference length and time respectively. Further, we have a reference density \(\rho _\text {ref}\), sound speed \(c_\text {ref}\), pressure \(p_\text {ref}= \rho _\text {ref}c_\text {ref}^2\), specific internal energy \(e_\text {ref}= c_\text {ref}^2\) and a reference Alfvén speed \(b_\text {ref}\) associated to the magnetic field. Inserting this decomposition into the governing equations, the rescaled non-dimensional MHD system writes

$$\begin{aligned} \frac{\partial }{\partial t} \left( \begin{array}{c} \displaystyle \tilde{\rho } \\ \displaystyle \tilde{\rho } \tilde{{\textbf {v}}} \\ \displaystyle \tilde{\rho } \tilde{E} \\ \displaystyle \tilde{{\textbf {B}}} \end{array} \right) + \nabla \cdot \left( \begin{array}{c} \displaystyle \tilde{\rho } \tilde{{\textbf {v}}} \\ \displaystyle \tilde{\rho }\tilde{\textbf {v}}\otimes \tilde{\textbf {v}}+ \left( \frac{{\tilde{p}}}{M_c^2} + \frac{1}{M_b^2}\frac{\Vert \tilde{\textbf {B}}\Vert ^2}{2}\right) \mathbb {I} - \frac{1}{M_b^2} \tilde{\textbf {B}}\otimes \tilde{\textbf {B}}\\ \displaystyle \left( \tilde{\rho }{\tilde{E}} + \frac{{\tilde{p}}}{M_c^2} + \frac{1}{M_b^2}\frac{\Vert \tilde{\textbf {B}}\Vert ^2}{2}\right) \tilde{\textbf {v}}- \frac{1}{M_b^2} \tilde{\textbf {B}}(\tilde{\textbf {v}}\cdot \tilde{\textbf {B}}) \\ \displaystyle {\tilde{\textbf {B}}\otimes \tilde{\textbf {v}}- \tilde{\textbf {v}}\otimes \tilde{\textbf {B}}} \end{array} \right) = {\textbf {0}}, \end{aligned}$$
(8)

where the total energy is given by

$$\begin{aligned} {\tilde{E}} = \frac{1}{M_c^2}{\tilde{e}} + \frac{1}{M_b^2}{\frac{{\tilde{m}}}{\tilde{\rho }}} + \tilde{k}. \end{aligned}$$
(9)

Introducing the plasma-beta parameter \(\beta = \tilde{p}/\tilde{m}\), which is given by ratio between (reference) pressure and (reference) magnetic pressure, the non-dimensional formulation (8) can be rewritten as

$$\begin{aligned} \frac{\partial }{\partial t} \left( \begin{array}{c} \displaystyle \tilde{\rho } \\ \displaystyle \tilde{\rho } \tilde{{\textbf {v}}} \\ \displaystyle \tilde{\rho } \tilde{\tilde{E}}\\ \displaystyle \tilde{{\textbf {B}}} \end{array} \right) + \nabla \cdot \left( \begin{array}{c} \displaystyle \tilde{\rho } \tilde{{\textbf {v}}} \\ \displaystyle \tilde{\rho }\tilde{\textbf {v}}\otimes \tilde{\textbf {v}}+ \left( \frac{{\tilde{p}}}{M_c^2} + \frac{1}{M_c^2\beta }\frac{\Vert \tilde{\textbf {B}}\Vert ^2}{2}\right) \mathbb {I} - \frac{1}{M_c^2\beta }\tilde{\textbf {B}}\otimes \tilde{\textbf {B}}\\ \displaystyle \left( \tilde{\rho }\tilde{{\tilde{E}}} + {\tilde{p}} + \frac{1}{\beta }\frac{\Vert \tilde{\textbf {B}}\Vert ^2}{2}\right) \tilde{\textbf {v}}- \frac{1}{\beta } \tilde{\textbf {B}}(\tilde{\textbf {v}}\cdot \tilde{\textbf {B}}) \\ \displaystyle {\tilde{\textbf {B}}\otimes \tilde{\textbf {v}}- \tilde{\textbf {v}}\otimes \tilde{\textbf {B}}} \end{array} \right) = {\textbf {0}}, \end{aligned}$$
(10)

where the total energy is given by

$$\begin{aligned} \tilde{{\tilde{E}}} = {\tilde{e}} + \frac{1}{\beta }{\frac{{\tilde{m}}}{\tilde{\rho }}} + M_c^2{\tilde{k}}, \end{aligned}$$
(11)

which is closer to the formulation known from the Euler equations with \({M}_{c}\) in front of the kinetic energy contribution [20].

2.2 Novel 3-Split form of the Ideal MHD Equations

Let us consider only one space dimension, so that the MHD system (1) reduces to

$$\begin{aligned} \frac{\partial {\textbf {q}}}{\partial t} + \frac{\partial {\textbf {f}}({\textbf {q}})}{\partial x} = {\textbf {0}}, \end{aligned}$$
(12)

with the definitions

$$\begin{aligned} {\textbf {q}}= \left( \begin{array}{c} \displaystyle \rho \\ \displaystyle \rho u \\ \displaystyle \rho v \\ \displaystyle \rho w \\ \displaystyle \rho E \\ \displaystyle B_x \\ \displaystyle B_y \\ \displaystyle B_z \\ \end{array} \right) , \qquad {\textbf {f}}({\textbf {q}}) = \left( \begin{array}{c} \displaystyle \rho u \\ \displaystyle \rho u^2 + p + \frac{\Vert {\textbf {B}}\Vert ^2}{8 \pi } - \frac{1}{4\pi } B_x^2 \\ \displaystyle \rho u v - \frac{1}{4\pi } B_x B_y \\ \displaystyle \rho u w - \frac{1}{4\pi } B_x B_z \\ \displaystyle \left( \rho E + p + \frac{\Vert {\textbf {B}}\Vert ^2}{8 \pi }\right) u - \frac{1}{4 \pi } B_x ({\textbf {v}}\cdot {\textbf {B}}) \\ \displaystyle 0 \\ \displaystyle u B_y - v B_x \\ \displaystyle u B_z - w B_x \end{array} \right) . \end{aligned}$$
(13)

To handle multiple time scales, we resort to a flux splitting technique that permits to design different time discretizations according to the stiffness of each resulting sub-system. Following [36], the fluxes of the MHD system (1) are split into three contributions: (i) convective fluxes \({\textbf {f}}^c\) related to u; (ii) pressure fluxes \({\textbf {f}}^p\) related to p; (iii) magnetic fluxes \({\textbf {f}}^b\) related to \({\textbf {B}}\). Here, we propose the following definitions

$$\begin{aligned} {\textbf {f}}^c({\textbf {q}})= & {} \left( \begin{array}{c} \displaystyle \rho u \\ \displaystyle \rho u^2 \\ \displaystyle \rho u v \\ \displaystyle \rho u w \\ 0 \\ \displaystyle 0 \\ 0 \\ \displaystyle 0 \end{array} \right) , \qquad {\textbf {f}}^p({\textbf {q}}) = \left( \begin{array}{c} \displaystyle 0 \\ \displaystyle p \\ \displaystyle 0 \\ \displaystyle 0 \\ \displaystyle \left( \rho E + p \right) u \\ \displaystyle 0 \\ 0 \\ 0 \end{array} \right) , \nonumber \\ {\textbf {f}}^b({\textbf {q}})= & {} \left( \begin{array}{c} \displaystyle 0 \\ \displaystyle \frac{\Vert {\textbf {B}}\Vert ^2}{8 \pi } - \frac{1}{4\pi } B_x^2 \\ \displaystyle - \frac{1}{4\pi } B_x B_y \\ \displaystyle - \frac{1}{4\pi } B_x B_z \\ \displaystyle \frac{\Vert {\textbf {B}}\Vert ^2}{8 \pi }\, u - \frac{1}{4 \pi } B_x ({\textbf {v}}\cdot {\textbf {B}}) \\ \displaystyle 0 \\ \displaystyle u B_y - v B_x \\ \displaystyle u B_z - w B_x \end{array} \right) . \end{aligned}$$
(14)

Note that the convective flux \({\textbf {f}}^c\) is convex in the first two components with respect to \((\rho , \rho u)\), and the remaining non-zero components are passive transport with u. We further remark that the above splitting is different from the formulation proposed in [59] for the Euler equations which was applied in [31, 36] on the MHD system. The difference here is that in (14) the hydrodynamic component of the energy flux is not split into a convective and a pressure part, but is entirely assigned to the pressure fluxes \({\textbf {f}}^p\). In particular, the magnetic energy contribution \( m \) will also play a role in the fluxes \({\textbf {f}}^p\). The novel 3-split form of the one-dimensional system (12) is then given in compact notation by

$$\begin{aligned} \frac{\partial {\textbf {q}}}{\partial t} + \frac{\partial {\textbf {f}}^c({\textbf {q}})}{\partial x} + \frac{\partial {\textbf {f}}^p({\textbf {q}})}{\partial x} + \frac{\partial {\textbf {f}}^b({\textbf {q}})}{\partial x}= {\textbf {0}}. \end{aligned}$$
(15)

In the following we detail for each sub-system the associated set of eigenvalues.

  1. 1.

    For the convective sub-system

    $$\begin{aligned} \frac{\partial {\textbf {q}}}{\partial t} + \frac{\partial {\textbf {f}}^c({\textbf {q}})}{\partial x} = {\textbf {0}}, \end{aligned}$$
    (16a)

    we find the following real eigenvalues

    $$\begin{aligned} \lambda ^c_{1,2,3,4} = 0, \quad \lambda ^c_{5,6,7,8} = u . \end{aligned}$$
    (16b)

    Thus sub-system (16a) is weakly hyperbolic since one eigenvector associated to \(\lambda ^c = 0\) is missing. The characteristic speeds depend only on the fluid flow.

  2. 2.

    For the pressure sub-system

    $$\begin{aligned} \frac{\partial {\textbf {q}}}{\partial t} + \frac{\partial {\textbf {f}}^p({\textbf {q}})}{\partial x} = {\textbf {0}}, \end{aligned}$$
    (17a)

    we find the following eigenvalues

    $$\begin{aligned} \lambda ^p_{1,2,3,4,5,6} = 0, \quad \lambda ^p_{7,8} = \frac{1}{2}\left( u \mp \sqrt{u^2 + 4 (c^2 - (\gamma -1)(m+k+u^2))} \right) , \end{aligned}$$
    (17b)

    with a full set of corresponding eigenvectors. Compared to the eigenvalues of the pressure sub-system derived in [31, 36], we notice the additional contribution of the specific magnetic and kinetic energy. We remark that the eigenvalues \(\lambda ^p_{7,8}\) might become complex in the case of highly magnetized fluids, thus the pressure sub-system may result to be elliptic.

  3. 3.

    For the magnetic sub-system

    $$\begin{aligned} \frac{\partial {\textbf {q}}}{\partial t} + \frac{\partial {\textbf {f}}^b({\textbf {q}})}{\partial x} = {\textbf {0}}, \end{aligned}$$
    (18a)

    we find the following real eigenvalues

    $$\begin{aligned} \lambda ^b_{1,2,3,4} = 0, \quad \lambda ^b_{5,6} = \frac{1}{2}\left( u \mp \sqrt{u^2 + 4 \left( \frac{B_x}{\sqrt{4\pi \rho }} \right) ^2} \right) , \quad \nonumber \\ \lambda ^b_{7,8} = \frac{1}{2}\left( u \mp \sqrt{u^2 + 4 \left( \frac{\Vert {\textbf {B}}\Vert ^2}{\sqrt{4\pi \rho }} \right) ^2} \right) . \end{aligned}$$
    (18b)

    Associated with \(\lambda ^b = 0\) there are two eigenvectors missing thus the magnetic sub-system is weakly hyperbolic.

Looking at the eigenvalues of the three sub-systems, it is clear that for low Mach number flows, the acoustic sound speed c in (17b) becomes dominant compared to the material speed u of the flow, hence needing an implicit discretization of the terms related to the pressure. This is also confirmed by analyzing the non-dimensional system (8) for \({M}_{c}\rightarrow 0\). Likewise, if the magnitude of the magnetic field \(\Vert {\textbf {B}}\Vert \) increases, i.e. when \(\beta \rightarrow 0\) in (10), the MHD model is dominated by the magnetic sub-system (18a) with eigenvalues \(\lambda ^b\). As such, an implicit treatment of the terms related to the magnetic field would allow for a larger stability region of the resulting numerical method. The numerical scheme which will be designed in this work starts from these considerations.

3 Numerical Scheme

Our objective is to construct a numerical scheme for the ideal MHD equations (1) which is stable independently of the parameters \({M}_{c}\) and \(\beta \) which are associated to the scaling of the pressure (and internal energy) and the strength of the magnetic field, respectively. To achieve this goal, we rely on the novel 3-split formulation (15), dividing the fluxes into explicitly and implicitly treated terms. In particular, the pressure and magnetic sub-systems with \({\textbf {f}}^p\) and \({\textbf {f}}^b\) are discretized implicitly, while we retain an explicit scheme for the convective sub-system with \({\textbf {f}}^c\).

This approach simultaneously yields two main advantages: (i) no degradation of accuracy occurs which would be caused for explicit schemes by excessive numerical viscosity for low Mach number flows as it scales with the inverse of the Mach number, see e.g. [29, 46]; (ii) improvement of the computational efficiency of the scheme in the low Mach number or low plasma-beta regime, since the stability of the scheme is guaranteed by a time step imposed only by the velocity of the local fluid flow \({\textbf {v}}\).

However, the resulting implicit system is in general nonlinear due to the non-linearity of the implicitly treated flux terms. Moreover, this implies a huge computational overhead since nonlinear solvers would be required to solve large coupled systems. To overcome this problem, the non-linearity can be treated by adopting a fixed point iteration algorithm, that has been successfully applied to low Mach number flows for the Euler and MHD systems [31, 32]. If the magnetic sub-system is discretized implicitly as done in [36], the nonlinear coupling is even stronger, thus a fixed point method combined with a nested Newton solver [24] has to be employed, which makes the resulting method quite demanding in terms of implementation and computational efficiency. Furthermore, there is no guarantee of convergence since the contraction constant which satisfies the Banach–Cacciopoli theorem is actually unknown.

Therefore, our goal is to give a numerical scheme which only includes linear systems to be solved reducing the computational costs without modifying the model equations (1). Furthermore, a 3-split form as given in (15) and proposed in [36] is not suitable for the class of IMEX Runge–Kutta methods [3, 53] that allows only the splitting according to two time scales, namely a slow and a fast scale. Hence dealing with a 2-split form of the governing equations is favorable and we will detail how to resort to a semi-implicit IMEX discretization of the fluxes, following the time integrators proposed in [12] yielding an overall second-order time discretization.

Besides the treatment in time, the MHD equations require to be compliant with the divergence-free property of the magnetic field (2). A widespread technique consists in the use of staggered grids [62], since it has been shown that an electric field defined on a mesh that is dual with respect to the mesh of the magnetic field allows the divergence-free condition to be preserved up to machine accuracy. Nevertheless, the staggering of the meshes can become cumbersome, especially in higher dimensions. Consequently, we prefer to adopt a collocated approach utilizing a reformulation of the governing equations in terms of the magnetic potential \({\textbf {A}}\) [43, 44]. Since the magnetic field \({\textbf {B}}\) is the curl of \({\textbf {A}}\), a mimetic finite difference div-curl operator will then be designed following the general approach introduced in [17].

Summarizing, we will first derive the time semi-discrete numerical scheme in one space dimension where the focus lies on the semi-implicit formulation of the flux splitting. Since the divergence-free constraint reduces to \(\partial _x(B_x) = 0\), we solve for the magnetic field directly. Secondly, the time semi-discrete numerical scheme in multiple space dimensions is considered, where the magnetic field \({\textbf {B}}\) is replaced by the curl of the magnetic potential, i.e. \({\textbf {B}}= \nabla \times {\textbf {A}}\). Thirdly, the extension to second order time accuracy is carried out relying on semi-implicit IMEX time marching schemes. Then, the details of the spatial discretization are provided, including the structure-preserving div-curl operator needed to respect the solenoidal property of the magnetic field at the discrete level upon which the section is concluded with the description of the fully discrete numerical scheme.

Space and time computational domain. The three-dimensional computational domain is defined in terms of the spatial intervals as \(\Omega =[x_{\min };x_{\max }] \times [y_{\min };y_{\max }] \times [z_{\min };z_{\max }]\), and it is discretized using a Cartesian grid composed of \(N_x \times N_y \times N_z\) cells. The characteristic mesh sizes are then given by

$$\begin{aligned} {\Delta x}=\frac{x_{\max }-x_{\min }}{N_x}, \qquad {\Delta y}=\frac{y_{\max }-y_{\min }}{N_y}, \qquad {\Delta z}=\frac{z_{\max }-z_{\min }}{N_z}. \end{aligned}$$
(19)

The time interval \(T=[0; t_f]\) is discretized by time steps \({\Delta t}= t^{n+1}-t^n\) which are always subject to a CFL-type stability condition that is only based on the characteristic speeds of the convective sub-system (16a). Thus, with \(|\lambda ^{c}|^n\) denoting the maximum eigenvalue of the convective sub-system (16b) at the time level \(t^n\), the CFL condition is given by

$$\begin{aligned} \Delta t \le \text {CFL}\frac{({\Delta x}{\Delta y}{\Delta z})^{1/3}}{\max \limits _{\Omega }|\lambda ^{c}|^n}. \end{aligned}$$
(20)

3.1 Time Semi-discrete Scheme in One Space Dimension

We consider the one-dimensional MHD system (12)–(13). The divergence free condition on the magnetic field in one dimension reduces to \(\partial _x(B_x) = 0\), thus the first component of the magnetic field needs to be constant, that is \(B_x=const\).

Applying a forward Euler method on the interval \([t^{n};t^{n+1}]\) to the convective sub-system (16a), we obtain the intermediate states \({\textbf {q}}^\star \) for density and momentum as

$$\begin{aligned} {\textbf {q}}^\star = {\textbf {q}}^n - \Delta t \, \frac{\partial {\textbf {f}}^{c}({\textbf {q}}^{n})}{\partial x}. \end{aligned}$$
(21)

The remaining flux terms will be considered implicitly, leading to a coupling of the magnetic field with the momentum and energy equation. The two implicit sub-systems will be solved sequentially.

  1. 1.

    The coupling of the magnetic field with the momentum equation provides the magnetic field at the new time level \({\textbf {B}}^{n+1}\).

  2. 2.

    The coupling of the energy with the momentum equation yields the total energy density at the new time level \((\rho E)^{n+1}\).

The time discretization of the implicit magnetic subsystem reads

$$\begin{aligned}{} & {} \displaystyle (\rho u)^{n+1}&= \rho u^\star - \Delta t \frac{\partial }{\partial x} \left( p^n + \frac{{\textbf {B}}^n\cdot {\textbf {B}}^{n+1}}{8 \pi } - \frac{1}{4\pi } B_x^2\right) , \end{aligned}$$
(22a)
$$\begin{aligned}{} & {} \displaystyle (\rho v)^{n+1}&= \rho v^\star - \Delta t \frac{\partial }{\partial x} \left( - \frac{1}{4\pi } B_x B_y^{n+1}\right) , \end{aligned}$$
(22b)
$$\begin{aligned}{} & {} \displaystyle (\rho w)^{n+1}&= \rho w^\star - \Delta t \frac{\partial }{\partial x} \left( - \frac{1}{4\pi } B_x B_z^{n+1}\right) , \end{aligned}$$
(22c)
$$\begin{aligned}{} & {} B_y^{n+1}&= B_y^n - \Delta t\frac{\partial }{\partial x} \left( \frac{(\rho u)^{n+1}}{\rho ^{n+1}} B_y^n - \frac{(\rho v)^{n+1}}{\rho ^{n+1}} B_x \right) , \end{aligned}$$
(22d)
$$\begin{aligned}{} & {} B_z^{n+1}&= B_z^n - \Delta t \frac{\partial }{\partial x} \left( \frac{(\rho u)^{n+1}}{\rho ^{n+1}} B_z^n - \frac{(\rho w)^{n+1}}{\rho ^{n+1}} B_x \right) . \end{aligned}$$
(22e)

Note that the density at the new time \(\rho ^{n+1}\) is known after the explicit step (21), and \(B_x\) is constant. Furthermore, the pressure \(p^n\) in the momentum equation (22a) accounts for more physical information in the computation of the new magnetic field. In addition, this contribution is treated explicitly inspired by the approach forwarded in [21] for an implicit treatment of the viscous terms in the compressible Navier–Stokes equations. We remark that we could even not consider the pressure contribution at this stage, since here the momentum equation is needed only to provide a flux for the magnetic sub-system, and we are not solving for the momentum at the new time level. Formal substitution of the evolution equations (22a)–(22c) into the equation for the magnetic field components (22d)–(22e) yields the following sub-system for the unknowns \(B_y^{n+1}\) and \(B_z^{n+1}\):

$$\begin{aligned}{} & {} B_y^{n+1} = B_y^\star + \Delta t^2\frac{\partial }{\partial x} \left( \frac{B_y^n}{\rho ^{n+1}}\frac{\partial }{\partial x} \left( \frac{B_y^n B_y^{n+1} + B_z^n B_z^{n+1}}{8 \pi }\right) + \frac{B_x}{\rho ^{n+1}} \frac{\partial }{\partial x} \left( \frac{B_x B_y^{n+1}}{4\pi } \right) \right) , \nonumber \\ \end{aligned}$$
(23a)
$$\begin{aligned}{} & {} B_z^{n+1} = B_z^\star + \Delta t^2 \frac{\partial }{\partial x} \left( \frac{B_z^n}{\rho ^{n+1}}\frac{\partial }{\partial x} \left( \frac{B_y^n B_y^{n+1} + B_z^n B_z^{n+1}}{8 \pi }\right) + \frac{B_x}{\rho ^{n+1}} \frac{\partial }{\partial x} \left( \frac{B_x B_z^{n+1}}{4\pi } \right) \right) ,\nonumber \\ \end{aligned}$$
(23b)

where

$$\begin{aligned}{} & {} B_y^\star = B_y^n - \Delta t\frac{\partial }{\partial x} \left( \frac{B_y^n}{\rho ^{n+1}}\left( \rho u^\star - \Delta t\frac{\partial }{\partial x} \left( p^n - \frac{B_x^2}{8\pi } \right) \right) + \frac{B_x}{\rho ^{n+1}} \rho v^\star \right) , \end{aligned}$$
(24)
$$\begin{aligned}{} & {} B_z^\star = B_z^n - \Delta t\frac{\partial }{\partial x} \left( \frac{B_z^n}{\rho ^{n+1}}\left( \rho u^\star - \Delta t\frac{\partial }{\partial x} \left( p^n - \frac{B_x^2}{8\pi } \right) \right) + \frac{B_x}{\rho ^{n+1}} \rho w^\star \right) . \end{aligned}$$
(25)

Thanks to the semi-implicit discretization of the term \(\Vert {\textbf {B}}\Vert ^2 \approx {\textbf {B}}^n\cdot {\textbf {B}}^{n+1}\) in the \(x-\)momentum equation (22a), the above system is linear.

Finally, we can write the implicit system for the energy. Since the magnetic field at the new time level \({\textbf {B}}^{n+1}\) is known from the solution of (23), the approaches introduced in implicit–explicit schemes for the Euler equations can be readily applied. Following [3], the energy sub-system reads

$$\begin{aligned}{} & {} \displaystyle (\rho u)^{n+1} = (\rho u)^\star - \Delta t \frac{\partial }{\partial x} \left( p^{n+1} + \frac{\Vert {\textbf {B}}^{n+1}\Vert ^2}{8 \pi } - \frac{1}{4\pi } B_x^2\right) \end{aligned}$$
(26a)
$$\begin{aligned}{} & {} \displaystyle (\rho E)^{n+1} = (\rho E)^n - \Delta t \frac{\partial }{\partial x} \left( \left( \rho E^n + p^n\right) \frac{(\rho u)^{n+1}}{\rho ^{n+1}} + \frac{\Vert {\textbf {B}}^{n+1}\Vert ^2}{8 \pi } u^n - \frac{1}{4 \pi } B_x ({\textbf {v}}^n \cdot {\textbf {B}}^{n+1})\right) . \nonumber \\ \end{aligned}$$
(26b)

Let us notice that a semi-implicit scheme has again been applied to the split fluxes (14), in which the chosen discretization for the terms \(\left( \rho E^n + p^n\right) u^{n+1}\) in \({\textbf {f}}^p\) and \(\frac{\Vert {\textbf {B}}^{n+1}\Vert ^2}{8 \pi } u^n\) in \({\textbf {f}}^b\) allows to retrieve a linear sub-system. Indeed, defining

$$\begin{aligned} p^{n+1} = (\rho E^{n+1} - \rho k^n - {m^{n+1}})(\gamma - 1), \end{aligned}$$
(27)

and inserting the \(x-\)momentum equation (26a) into (26b), the following elliptic equation on the total energy is obtained

$$\begin{aligned}{} & {} \displaystyle (\rho E)^{n+1} = (\rho E)^\star + (\gamma - 1)\Delta t^2\frac{\partial }{\partial x} \left( \frac{\rho E^n + p^n}{\rho ^{n+1}} \, \frac{\partial }{\partial x} \left( (\rho E)^{n+1} \right) \right) , \end{aligned}$$
(28)

where

$$\begin{aligned}{} & {} \rho E^\star&= \rho E^n - \Delta t \frac{\partial }{\partial x} \left( \frac{\rho E^n + p^n}{\rho ^{n+1}}(\rho u)^{\star \star } + \frac{\Vert {\textbf {B}}^{n+1}\Vert ^2}{8 \pi } u^n - \frac{1}{4 \pi } B_x ({\textbf {v}}^n \cdot {\textbf {B}}^{n+1})\right) , \end{aligned}$$
(29)
$$\begin{aligned}{} & {} (\rho u)^{\star \star }&= (\rho u)^\star - \Delta t\frac{\partial }{\partial x} \left( {(2-\gamma ) \frac{\Vert {\textbf {B}}^{n+1}\Vert ^2}{8\pi }} - (\gamma - 1) \, \rho ^n k^n + \frac{\Vert {\textbf {B}}^{n+1}\Vert ^2}{8 \pi } - \frac{1}{4\pi } B_x^2\right) . \end{aligned}$$
(30)

We recall that the density \(\rho ^{n+1}\) at the new time level is already known from the explicit step (21) as the mass flux is contained in the explicitly treated convective sub-system given in (14). The implicit energy equation (28) is thus a linear problem for the scalar unknown \((\rho E)^{n+1}\). This is because of: (i) the choice of the ideal gas EOS (4); (ii) the semi-implicit time discretization in the pressure and magnetic fluxes \({\textbf {f}}^p\) and \({\textbf {f}}^b\) of (14).

Once the total energy at the new time level is obtained, the x-component of the momentum can be updated according to (26a) and the y- and z-components according to (22b) and (22c), respectively.

Remark 1

(On the stability of the time semi-discrete scheme) In the semi-implicit discretizations designed for both the magnetic and the energy sub-systems, given by (23) and (26), respectively, we make use of a time linearization of the nonlinear terms such that we only have to solve linear systems. Consequently, the proposed schemes cannot be expected to be unconditionally stable, as it would be granted by solving the corresponding original nonlinear sub-systems. However, the time step of our schemes is always limited by the convective sub-system, where we have a CFL stability condition oriented towards the fastest material wave as given in (20). Therefore, we do not use arbitrarily large time steps in our numerical scheme, but they are always limited by the fastest material wave speed. For high Mach number flows, the flow speed is indeed responsible for the most severe restriction, while for low Mach number flows only weak shocks might arise. In those regimes, our scheme is stable which is also numerically verified in the results presented in Sect. 4. Nevertheless, a thorough study and analysis of the stability condition of the proposed semi-implicit linearization would be necessary.

3.2 Time Semi-discrete Scheme in Multiple Space Dimensions

In multiple space dimension, the preservation of the divergence-free property of the magnetic field at the discrete level is extremely important to ensure physically admissible solutions. According to [23], violating the \(\nabla \cdot {\textbf {B}}= 0\) constraint leads to non-physical phenomena, e.g spurious numerical monopoles may be generated or magnetic field lines may break into open lines. To guarantee that condition (2) is obeyed, instead of solving for \({\textbf {B}}\) directly, as done in the one-dimensional case, we use the magnetic vector potential \({\textbf {A}}\) which generates the magnetic field by its curl. Thus, since \(\nabla \cdot {\textbf {B}}= \nabla \cdot (\nabla \times {\textbf {A}}) = 0\), the objective of the numerical scheme is to preserve the div-curl property exactly up to machine precision. The details will be discussed later in Sect. 3.4. Here, we provide the semi-discrete scheme in time for the ideal MHD system in multiple space dimensions equipped with \({\textbf {A}}\) instead of \({\textbf {B}}\).

The system of equations is non-conservative for the time evolution of \({\textbf {A}}\), and it is given by

$$\begin{aligned} \frac{\partial }{\partial t} \left( \begin{array}{c} \displaystyle \rho \\ \displaystyle \rho {\textbf {v}}\\ \displaystyle \rho E \\ \displaystyle {\textbf {A}}\end{array} \right) + \nabla \cdot \left( \begin{array}{c} \displaystyle \rho {\textbf {v}}\\ \displaystyle \rho {\textbf {v}}\otimes {\textbf {v}}+ \left( p + \frac{\Vert \nabla \times {\textbf {A}}\Vert ^2}{8 \pi }\right) \mathbb {I} - \frac{1}{4\pi } (\nabla \times {\textbf {A}}) \otimes ( \nabla \times {\textbf {A}}) \\ \displaystyle \left( \rho E + p + \frac{\Vert \nabla \times {\textbf {A}}\Vert ^2}{8 \pi }\right) {\textbf {v}}- \frac{1}{4 \pi } ( \nabla \times {\textbf {A}}) ({\textbf {v}}\cdot ( \nabla \times {\textbf {A}})) \\ \displaystyle {\textbf {0}} \end{array} \right) \nonumber \\ + \left( \begin{array}{c} \displaystyle 0 \\ \displaystyle {\textbf {0}} \\ \displaystyle 0 \\ \displaystyle \left( \nabla \times {\textbf {A}}\right) \times {\textbf {v}}\end{array} \right) = {\textbf {0}}, \end{aligned}$$
(31)

with the identity

$$\begin{aligned} {\textbf {B}}- \nabla \times {\textbf {A}}= 0. \end{aligned}$$
(32)

The structure of the time semi-discrete scheme is the same as in the one-dimensional case, but the magnetic sub-system is now written in terms of \({\textbf {A}}\). Consequently, we focus only on the magnetic sub-system where \((\rho {\textbf {v}})^\star \) and \(\rho ^{n+1}\) are known from the convective step (21). Then, assuming that \({\textbf {B}}^n = \nabla \times {\textbf {A}}^n\) is fulfilled at the current time step, the magnetic sub-system writes

$$\begin{aligned}{} & {} \displaystyle (\rho {\textbf {v}})^{n+1} = (\rho {\textbf {v}})^\star - \Delta t\nabla \cdot \left( \left( p^n + \frac{{\textbf {B}}^n\cdot (\nabla \times {\textbf {A}}^{n+1})}{8 \pi }\right) \mathbb {I} - \frac{{\textbf {B}}^n \otimes ( \nabla \times {\textbf {A}}^{n+1})}{4\pi } \right) , \nonumber \\ \end{aligned}$$
(33a)
$$\begin{aligned}{} & {} {\textbf {A}}^{n+1} = {\textbf {A}}^{n}- \Delta t ~{\textbf {B}}^n \times \frac{(\rho {\textbf {v}})^{n+1}}{\rho ^{n+1}}. \end{aligned}$$
(33b)

Analogously to the one-dimensional case, plugging the momentum equations (33a) into (33b) yields

$$\begin{aligned}{} & {} {\textbf {A}}^{n+1} = {\textbf {A}}^\star + \Delta t~{\textbf {B}}^n \times \frac{\Delta t}{\rho ^{n+1}}\nabla \cdot \left( \left( \frac{{\textbf {B}}^n\cdot (\nabla \times {\textbf {A}}^{n+1})}{8 \pi }\right) \mathbb {I} - \frac{{\textbf {B}}^n \otimes ( \nabla \times {\textbf {A}}^{n+1})}{4\pi } \right) \end{aligned}$$
(34)

where

$$\begin{aligned}{} & {} {\textbf {A}}^\star = {\textbf {A}}^{n}- \Delta t~ {\textbf {B}}^n \times \frac{1}{\rho ^{n+1}}\left( (\rho {\textbf {v}})^\star - \Delta t\nabla p^n\right) . \end{aligned}$$
(35)

We remark that a semi-implicit discretization has been employed for the terms \(\Vert \nabla \times {\textbf {A}}\Vert ^2 \approx (\nabla \times {\textbf {A}}^n) \cdot (\nabla \times {\textbf {A}}^{n+1})={\textbf {B}}^n \cdot (\nabla \times {\textbf {A}}^{n+1})\) and \((\nabla \times {\textbf {A}}) \otimes ( \nabla \times {\textbf {A}}) \approx (\nabla \times {\textbf {A}}^n) \otimes ( \nabla \times {\textbf {A}}^{n+1})={\textbf {B}}^n \otimes ( \nabla \times {\textbf {A}}^{n+1})\). The magnetic potential at the new time level permits to easily evaluate the new magnetic field as \({\textbf {B}}^{n+1} = \nabla \times {\textbf {A}}^{n+1}\).

Analogously to the one-dimensional case, we obtain the implicit energy update (28) in a multi-dimensional setting, which remains a linear system with the scalar unknown \((\rho E)^{n+1}\). After solving the energy sub-system, the momentum equations can be updated according to

$$\begin{aligned} (\rho {\textbf {v}})^{n+1} = (\rho {\textbf {v}})^\star - \Delta t\nabla \cdot \left( \left( p^{n+1} + \frac{\Vert {\textbf {B}}^{n+1}\Vert ^2}{8 \pi }\right) \mathbb {I} - \frac{{\textbf {B}}^{n+1} \otimes {\textbf {B}}^{n+1}}{4\pi } \right) , \end{aligned}$$
(36)

where the new magnetic field \({\textbf {B}}^{n+1}\) is used, and the new pressure \(p^{n+1}\) is computed by (27).

We remark at this point, that the scheme is asymptotic preserving (AP) for \({M}_b=1\) and \({M}_{c}\) tending to zero for well-prepared initial data towards the incompressible Euler equations. For a proof see [49], where the AP property is proven in the context of an IMEX finite volume scheme for single-temperature two-fluid all speed flows. The numerical scheme for the Euler sub-system coincides with the scheme presented in this work, thus the proof can be applied directly on the time semi-discrete scheme presented in this section for \({M}_b= \mathcal {O}(1)\).

3.3 Second Order Time Discretization

The semi-discrete scheme presented in the previous section is first order accurate in time. To achieve second order of accuracy, we rely on the class of semi-implicit IMplicit–EXplicit (IMEX) time integrators proposed in [12]. These Runge–Kutta methods perfectly fit to our semi-discrete scheme since we have applied a time linearization to the 3-split form of the fluxes (14). Such linearization is typically referred to as semi-implicit technique.

Without loss of generality, let us consider the one-dimensional system (12)–(13) and the associated time semi-discrete scheme presented in Sect. 3.1. According to [12], the governing equations can be written in the form of an autonomous system

$$\begin{aligned} \frac{\partial {\textbf {q}}}{\partial t} = \mathcal {H}({\textbf {q}}_E(t),{\textbf {q}}_I(t)), \end{aligned}$$
(37)

with initial condition \({\textbf {q}}_0={\textbf {q}}(t=0)\). The function \(\mathcal {H}\) represents the spatial approximation of the flux terms (13) that will be detailed later, and it is a function of two arguments, namely the explicit and the implicit state vector \({\textbf {q}}_E\) and \({\textbf {q}}_I\), respectively. To integrate the system (37) in time, Implicit–Explicit Runge–Kutta schemes are used, see e.g. [53] for Stiffly Accurate (SA) IMEX-RK methods widely used for the construction of multi-scale schemes. An IMEX-RK scheme is described by a double Butcher tableau

$$\begin{aligned} \begin{array}{c|c} \tilde{c} &{} \tilde{A} \\ \hline &{} \tilde{b}^\top \end{array} \qquad \begin{array}{c|c} c &{} A \\ \hline &{} b^\top \end{array}, \end{aligned}$$
(38)

with the matrices \((\tilde{A},A) \in \mathbb {R}^{s \times s}\) and the vectors \((\tilde{c},c,\tilde{b},b) \in \mathbb {R}^s\). The tilde symbol refers to the explicit scheme and matrix \(\tilde{A}=(\tilde{a}_{ij})\) is a lower triangular matrix with zero elements on the diagonal, while \(A=({a}_{ij})\) is a triangular matrix which accounts for the implicit scheme, thus having non-zero elements on the diagonal. Here, we adopt the LSDIRK2 scheme from [3], which is represented by the following tableaux

$$\begin{aligned} \begin{array}{c|cc} 0 &{} 0 &{} 0 \\ \tilde{c} &{} \tilde{c} &{} 0 \\ \hline &{} 1-\alpha &{} \alpha \end{array} \qquad \begin{array}{c|cc} \alpha &{} \alpha &{} 0 \\ 1 &{} 1-\alpha &{} \alpha \\ \hline &{} 1-\alpha &{} \alpha \end{array}, \end{aligned}$$
(39)

with \(\alpha =1-1/\sqrt{2}\) and \(\tilde{c}=1/(2\alpha )\). Since \(\tilde{b}=b\) and \( b \) coincides with the last stage in \( A \) in (39), the LSDIRK2 scheme is SA which is a crucial property for assuring asymptotic consistency and accuracy of the scheme, see also [15]. To obtain a semi-implicit IMEX-RK method, let us first set \({\textbf {q}}_E^n={\textbf {q}}^n\) and \({\textbf {q}}_I^n = {\textbf {q}}^n\), then the stage fluxes for \(i = 1, \ldots , s\) are calculated as

$$\begin{aligned} {\textbf {q}}_E^i&= {\textbf {q}}_E^n + {\Delta t}\sum \limits _{j=1}^{i-1} \tilde{a}_{ij} k_j, \qquad 2 \le i \le s, \end{aligned}$$
(40a)
$$\begin{aligned} \tilde{{\textbf {q}}}_I^i&= {\textbf {q}}_E^n + {\Delta t}\sum \limits _{j=1}^{i-1} a_{ij} k_j, \qquad 2 \le i \le s, \end{aligned}$$
(40b)
$$\begin{aligned} k_i&= \mathcal {H} \left( {\textbf {q}}_E^i, \tilde{{\textbf {q}}}_I^i + {\Delta t}\, a_{ii} \, k_i \right) , \qquad 1 \le i \le s. \end{aligned}$$
(40c)

Note that the evaluation of the stage fluxes (40c) requires the solution of an implicit system, that corresponds to the implicit magnetic and energy sub-systems given by (23) and (28), respectively.

Finally, the numerical solution is updated with \({\textbf {q}}^{n+1}={\textbf {q}}^{s}\), i.e. the solution coincides with the last Runge–Kutta stage because of the Stiffly Accurate property of the chosen IMEX scheme (39).

3.4 Discrete Spatial Operators

A triple index \(i j k\) referred to each space direction allows a cell to be uniquely identified, whereas half indices are adopted to label cell interfaces in \(x-\), \(y-\) and \(z-\)direction, namely \((i+\frac{1}{2} j k)\), \((i j+\frac{1}{2} k)\) and \((i j k+\frac{1}{2})\), respectively. The cell barycenter has coordinates \((x_i,y_j,z_k)\), and \(|\omega ^{i j k}|={\Delta x}{\Delta y}{\Delta z}\) is the cell volume. Collocated grids are adopted for the spatial discretization of the numerical solution, thus the discrete representation of a generic scalar quantity \(q({\textbf {x}})\) at a fixed time is expressed in each cell in the finite volume sense as the cell average

$$\begin{aligned} q_{i j k} = \frac{1}{|\omega _{i j k}|} \, \int \limits _{\omega _{i j k}} q({\textbf {x}}) \, d{\textbf {x}}, \end{aligned}$$
(41)

Likewise, we denote by \({\textbf {q}}({\textbf {x}})=(q_x,q_y,q_z)\) a generic vector, whose components undergo the same cell centered discretization (41), hence implying \({\textbf {q}}_{i j k}=(q_{x,i j k},q_{y,i j k},q_{z,i j k})\).

We introduce a set of discrete spatial operators that will be employed in the numerical scheme.

Numerical flux operator . To compute numerical fluxes, we rely on the numerical flux operator which is defined in the \(x-\)direction by

(42)

where is a Rusanov–type numerical flux function which reads

(43)

with f(q) representing the physical convex flux related to variable q, and \(q_{i+\frac{1}{2} j k}^\pm \) denoting the boundary extrapolated values of the quantity q at the cell interface \((i+\frac{1}{2} j k)\). The numerical dissipation is computed as

$$\begin{aligned} \alpha _{i+\frac{1}{2} j k} = \max \left( |u_{i+1 j k}|,|u_{i j k}| \right) , \end{aligned}$$
(44)

thus it is only proportional to the material speed u in \(x-\)direction. The above operator can be easily extended to the other spatial directions, namely

(45)

A first order accurate numerical flux is obtained by choosing \(q_{i+\frac{1}{2} j k}^+=q_{i+1 j k}\) and \(q_{i+\frac{1}{2} j k}^-=q_{i j k}\) in (43). To attain second order of accuracy, a TVD reconstruction is carried out for the quantity \(q({\textbf {x}})\) in each spatial direction, hence obtaining a piecewise polynomial representation \(r({\textbf {x}})\) which, in \(x-\)direction for cell \(\omega _{i j k}\), writes

$$\begin{aligned} r_{i j k}(x) = c_0 \, q_{i j k} + c_1 \, (x-x_i), \end{aligned}$$
(46)

with the expansion coefficients computed using a minmod limiter [58] as

$$\begin{aligned} c_0 = 1, \qquad c_1 = \text {minmod} \left( \frac{q_{i+1 j k}-q_{i j k}}{{\Delta x}}, \, \frac{q_{i j k}-q_{i-1 j k}}{{\Delta x}} \right) . \end{aligned}$$
(47)

A second order numerical flux is then obtained by setting \(q_{i+\frac{1}{2} j k}^+=r_{i+1 j k}(x_{i+\frac{1}{2}})\) and \(q_{i+\frac{1}{2} j k}^-=r_{i j k}(x_{i-\frac{1}{2}})\) in (43).

Central flux operator . The operator is the same as but zero numerical dissipation is considered, i.e. \(\alpha _{i+\frac{1}{2} j k}=0\) in (43), hence obtaining a second order central flux operator.

Differential operator . This operator applies to two generic quantities \(h({\textbf {x}})\) and \(q({\textbf {x}})\). In \(x-\)direction, it computes a second derivative with second order of accuracy of the form \(\partial _x(h \, \partial _x q)\) by

(48)

with the interface quantities \(h_{i\pm 1/2 j k}\) given by the arithmetic average

$$\begin{aligned} h_{i+\frac{1}{2} j k} = \frac{1}{2} (h_{i+1 j k}+h_{i j k}), \qquad h_{i-\frac{1}{2} j k} = \frac{1}{2} (h_{i j k}+h_{i-1 j k}). \end{aligned}$$
(49)

The multidimensional extension writes .

Gradient operator . The gradient operator is computed at the aid of a second order central finite difference discretization:

(50)

Curl operator . The curl operator, directly applied to the vector \({\textbf {q}}\), follows from the computation of the gradient operator. Indeed, it simply writes

(51)

Divergence operator . The divergence operator also makes use of the gradient operator (50) as follows

(52)

It is easy to check that the chosen divergence and curl operators are structure preserving, meaning that they satisfy the algebraic identity \(\nabla \cdot (\nabla \times {\textbf {q}})=0\) at the discrete level, namely

(53)

This relation is crucial for ensuring the solenoidal property of the magnetic field at the discrete level. A proof of the div-curl relation (53) can be found in Appendix A of [17].

Laplace operator . This operator approximates the Laplacian of a scalar function with a second order central finite difference discretization for a space-dependent diffusion coefficient \(\kappa \) as

(54)

3.5 Fully Discrete Scheme in Multiple Space Dimensions

A single time step of the new semi-implicit method from time \(t^n\) to \(t^{n+1}\) in a fully discrete set-up is made of the following steps.

  1. 1.

    Solve the explicit convective sub-system based on the flux \({\textbf {f}}^c\) for density and momentum as

    (55a)
    (55b)
    (55c)
    (55d)

    Let us notice that \(\rho ^{\star }_{i j k}=\rho ^{n+1}_{i j k}\), thus the density at the next time level is already available. Furthermore, the explicit contribution of momentum is given by the vector

    $$\begin{aligned} (\rho {\textbf {v}})^{\star }_{i j k}=((\rho u)^{\star }_{i j k},(\rho v)^{\star }_{i j k},(\rho w)^{\star }_{i j k})^\top . \end{aligned}$$
  2. 2.

    Solve the implicit magnetic sub-system (34) and obtain the vector potential \({\textbf {A}}_{i j k}^{n+1}\) from

    (56)

    with the right hand side

    (57)

    Therein, following [44], we have added numerical dissipation by means of the Laplace operator (54) applied to all components of \({\textbf {A}}\) to stabilize the numerical scheme especially in high Mach and Alfvén regimes. The diffusion coefficients are proportional to the eigenvalues of the magnetic sub-system (18b), e.g. \(\kappa _x=|\lambda ^b| {\Delta x}\). The resulting Laplace operators are discretized implicitly, thus the extra viscosity does not affect the stability of the overall scheme based on the material CFL condition (20). To compute the solution of this linear system (56), (57), we use the GMRES method [57] up to a prescribed tolerance (typically set to \(10^{-14}\)).

  3. 3.

    Compute the magnetic field and the magnetic energy density at the next time level as

    (58)

    Thanks to the structure preserving property (53), the magnetic field \({\textbf {B}}_{i j k}^{n+1}\) is divergence-free up to machine accuracy.

  4. 4.

    After inserting the definition for \(p^{n+1}\) via (27) in the momentum equation (36), one can summarize all known terms, including the implicit magnetic fluxes \({\textbf {f}}^b\), in the intermediate quantities \((\rho {\textbf {v}})^{\star \star }\) and \((\rho E)^{\star \star }\). Therein, all magnetic contributions are evaluated at the new time level \({\textbf {B}}^{n+1}\). Using notation (58) for the magnetic energy density, they read

    (59a)
    (59b)
    (59c)
    (59d)
  5. 5.

    Solve the elliptic equation for the total energy \((\rho E)_{i j k}^{n+1}\) according to

    (60)

    with the right hand side

    (61)

    Even in this case, the linear system is solved with the GMRES method up to a residual of the order of \(10^{-14}\).

  6. 6.

    Update the momentum at the next time level \((\rho {\textbf {v}})_{i j k}^{n+1}\) according to

    (62a)
    (62b)
    (62c)

    which is equivalent to (36) after the introduction of the new pressure (27).

Summarizing, to stabilize the numerical scheme, we have introduced two sources of artificial viscosity. The first one is the dissipative part of the explicit Rusanov flux proportional to the local fluid velocity \({\textbf {v}}\), and the second one via an implicit Laplacian operator in the magnetic sub-system proportional to the local eigenvalue \(\lambda ^b\) of the magnetic-subsystem. In particular, the magnetic dissipation contributes to the stability of the numerical scheme especially in high Mach and Alfvén Mach number regimes. Since it is treated implicitly, the material time step restriction does not need to be restricted to guarantee the stability of the numerical scheme.

4 Numerical Results

In the sequel, we present a large suite of test cases for ideal MHD aiming at demonstrating the accuracy, robustness and effectiveness of our new scheme in different regimes of both the Mach and the Alfvén number. If not otherwise specified, we set \(\gamma = 3/5\) and the time step \({\Delta t}\) is computed according to the stability condition (20) with \(\text {CFL} = 0.9\), which only depends on the material waves. The novel scheme is labeled with SIFV-EB , that stands for Semi-Implicit Finite Volume method with implicit discretization for the energy (E) and the magnetic field (B). If not stated otherwise, it is always used the second order version of the SIFV-EB scheme in space and time.

Boundary conditions for the magnetic potential \({\textbf {A}}\) In all the following test problems we always perform a linear extrapolation to determine the boundary conditions for the magnetic potential \({\textbf {A}}\). Without loss of generality, let us consider the component \(A_{x,i}\) for a cell attached to the left boundary \(x_{i-1/2}=x_{\min }\) of the computational domain, i.e. \(i=1\). The sought boundary state \(A_{x,b}\) in x-direction is formally located at \(x_b=x_{\min }-{\Delta x}/2\) and is computed as

$$\begin{aligned} A_{x,b} = A_{x,i} - \alpha {\Delta x}\qquad \text { with } \qquad \alpha = \frac{A_{x,i+1}-A_{x,i}}{{\Delta x}}. \end{aligned}$$
(63)

This procedure applies for all the components of \({\textbf {A}}\) and all the spatial directions \({\textbf {x}}\). The Laplace operator in (56), which accounts for artificial viscosity in the implicit update of the magnetic potential, can thus be applied without any modification.

4.1 Accuracy of the Numerical Scheme

We test the accuracy of the numerical scheme on a slight modification of the analytical vortex solution forwarded in [4] on the two-dimensional computational domain \(\Omega =[-5;5]\times [-5;5]\). The vortex is constructed as a perturbation \(\delta {\textbf {q}}\) on top of an unperturbed magnetohydrodynamics background flow given by the constant states \({\textbf {q}}_0 = (\rho _0, {\textbf {v}}_0,p_0, {\textbf {0}})\). The perturbations of the velocity and magnetic field are given by

$$\begin{aligned}{} & {} (\delta u, \delta v) = \frac{\tilde{v}}{2 \pi } \, \exp \left( \frac{1- r^2}{2}\right) \cdot (- r \sin (\theta ), r \cos (\theta )), \end{aligned}$$
(64)
$$\begin{aligned}{} & {} (\delta B_x, \delta B_y) = \frac{\tilde{B}}{2 \pi } \, \exp \left( \frac{1- r^2}{2}\right) \cdot (- r \sin (\theta ), r \cos (\theta )), \end{aligned}$$
(65)

with the constants \(\tilde{v} = \sqrt{2\pi }\) and \({\tilde{B}} = \sqrt{4 \pi }\). The perturbation of the magnetic field is generated by the magnetic potential perturbation in z-direction \(\delta A_z = \frac{{\tilde{B}}}{2\pi } \, \exp (1-r^2)\). The pressure is set such that it balances the centrifugal force generated by the circular motion against the centripetal force stemming from the tension in the magnetic field lines. In radial coordinates, with the generic radial position \(r = \sqrt{x^2 + y^2}\), the equation for the pressure perturbation writes

$$\begin{aligned} \frac{\partial \delta p}{\partial r} = \left( \frac{\rho v_\theta ^2}{r} - \frac{\delta B_\theta ^2}{4 \pi r} - \frac{\partial (\delta B_\theta )^2}{8 \pi r}\right) , \end{aligned}$$
(66)

with the definitions

$$\begin{aligned} \delta v_\theta = \frac{\tilde{v}}{2 \pi } \, r \, \exp \left( \frac{1- r^2}{2}\right) , \qquad \delta B_\theta = \frac{\tilde{B}}{2 \pi } \, r \, \exp \left( \frac{1- r^2}{2}\right) . \end{aligned}$$
(67)

Integration of (66) yields

$$\begin{aligned} \delta p = \frac{1}{2} e^{1-r^2} \left( \frac{1}{8 \pi }\frac{\tilde{B}^2}{(2 \pi )^2} \left( 1-r^2\right) -\frac{1}{2}\rho \left( \frac{\tilde{v}}{2\pi }\right) ^2\right) . \end{aligned}$$
(68)

We set the background velocity field to \({\textbf {v}}_0 = (1,1,0)\), thus the vortex is moving diagonally through the computational domain, and the background pressure is \(p_0 = 1\). Since the novelty of the scheme is the stability under a material time step which is independent of the sound and Alfvén speeds, we study the experimental order of convergence (EOC) under a variation of the Alfvén speeds. To this end, let us note that simply adding a constant background magnetic field does not yield an analytic solution of the ideal MHD equations in this setup. Thus, since the Alfvén speeds depend on the inverse of the density, the Alfvén Mach number can be decreased by lowering the background density \(\rho _0\). We underline that decreasing the density will increase the sound speed as well, and the kinetic influence on the pressure perturbation (68) will decrease. However, the contribution of the magnetic field remains the same for all the cases considered. We remark that, due to a zero background magnetic field, it is not possible to compute the Alfvén Mach number \(M_b\) over the whole computational domain. Therefore, the maximal acoustic Mach number \(M_c\) and Alfvén speed b are reported in Table 1 for different background densities \(\rho _0 = 10^{-k}\), \(k = 0, \ldots , 5\).

Table 1 MHD traveling vortex. Maximum acoustic Mach number \({M}_{c}\) and Alfvén speed b at the initial time
Table 2 MHD traveling vortex. \(L^2\) error and EOC for the second order SIFV-EB scheme with varying background density \(\rho _0\) at final time \(t_f = 1\)

The simulations are run on a sequence of successively refined meshes until the final time \(t_f=1\). In Table 2, the \(L^2\) error in \(\rho , u, p, B_x\) and \(A_z\) are summarized. We observe that, for all regimes, the expected EOC of two is achieved. Furthermore, the scheme performs well for small values of the density. We recall, however, that the scheme is not naturally positivity preserving.

To demonstrate the advantage of having a scale independent CFL stability condition, we plot in Fig. 1 the ratio between a fully explicit time step restricted by the fastest characteristic speeds against the time step given by the CFL condition of our scheme (20). The SIFV-EB scheme allows, especially for low acoustic and Alfvén Mach numbers, to use a time step which is several orders of magnitude larger than the one of an explicit scheme while maintaining second order accuracy in space and time.

Fig. 1
figure 1

MHD traveling vortex. Time evolution of the ratio between the material time step of the SIFV-EB scheme and the magneto-sonic time step of a fully explicit finite volume scheme for different values of the background density \(\rho _0\)

4.2 1D Riemann Problems

Next, we consider a series of Riemann Problems (RP) which are standard one-dimensional test cases for ideal MHD solvers. The setup is detailed in Table 3 and it is taken from [30]. They have already been used to validate for instance the Osher-type scheme [33] or the HLLEM Riemann solver presented in [30]. We compare the results obtained with our new SIFV-EB scheme against the exact solution, that has been computed with an exact Riemann solver that has kindly been provided by Falle and Komissarov [34, 35] and which is labeled in Figs. 2 and 3 as reference solution. For an alternative exact Riemann solver of the MHD equations, see also [60]. These test cases verify the robustness of the new SIFV-EB scheme in the case of moderate and high Mach number flows. The computational domain is given by \(\Omega =[-0.5;0.5]\) and the grid is made of 2000 cells along the \(x-\)direction with Dirichlet boundaries.

Table 3 Initialization of Riemann problems. Initial states left (L) and right (R) are reported as well as the final time of the simulation \(t_f\). In all cases \(\gamma =5/3\) and the position of the initial discontinuity is \(x_d=0\), except for RP2 and RP3 where it is \(x_d=-0.1\)

For each RP, depicted in Figs. 2 and 3. The SIFV-EB scheme is able to capture the correct shock position and all waves accurately for RP2–RP7. In particular, the overshoot in density and pressure in RP1 is an artifact that also appears in approximate solutions produced with the HLLEM scheme from [30], the Osher-type scheme [33] or the Rusanov scheme. Moreover, RP7 contains an isolated steady Alfvén wave which is well resolved. However, small perturbations of density and pressure appear around the jump position. To further investigate the nature of these errors, we compare the solution to an explicit second order MUSCL-FV scheme using a TVD limiter in Fig. 4 with the same mesh resolution. We can observe that these artifacts also arise with the same order of magnitude using the explicit solver. This is comparable to the errors that appear in the density and pressure for RP1 which have been reproduced with different approximate Riemann solvers, see e.g. [30, 33].

Fig. 2
figure 2

Riemann problems. RP1 at time \(t_f=0.1\) (top), RP2 at time \(t_f=0.2\) (middle) and RP3 at time \(t_f=0.15\) (bottom). Left: density \(\rho \). Center: pressure \( p \). Right: magnetic field component \(B_y\)

Overall, the new SIFV-EB scheme is clearly more diffusive than an explicit approximate Riemann solver. This is due to the semi-implicit nature and the material time stepping, based on the fluid velocity u, that allows much larger time steps. This is illustrated in Fig. 5 where a comparison between the material time stepping \(\Delta t\) of the SIFV-EB scheme with respect to a fully explicit time step \(\Delta t_\text {MHD}\), enforced by the fast magneto-sonic wave speeds \(\lambda _{1,8}\), is given. Even though most RP are placed in a compressible regime, our scheme allows for larger time steps that is reflected by slightly more diffusive fast traveling waves, while the material waves are captured accurately, as expected. Let us note that the first time step is always given by a magneto-sonic explicit time step \(\Delta t = \Delta t_\text {MHD}\), since tests RP1, RP3 and RP4 are initialized with a zero velocity u which would lead to an infinitely large first time step and thus to inaccurate numerical results. Since this yields \(\Delta t/\Delta t_\text {MHD} = 1\) for the first time step, we have plotted the ratio starting from the second time step in Fig. 5. Moreover, the time step ratio remains almost constant for those Riemann problems which satisfy a maximum principle for the velocity u.

Fig. 3
figure 3

Riemann problems. RP4 at time \(t_f=0.16\), RP5 at time \(t_f=0.04\), RP6 at time \(t_f=0.03\) and RP7 at time \(t_f=0.2\) (from top to bottom). Left: density \(\rho \). Center: pressure \( p \). Right: magnetic field component \(B_y\)

Fig. 4
figure 4

Riemann problem RP7 at time \(t_f=0.2\). Comparison between the second order accurate SIFV-EB scheme and an explicit MUSCL-TVD scheme. Left: density \(\rho \). Right: pressure \( p \)

Fig. 5
figure 5

Riemann problems. Time evolution of the ratio between the material time step of the SIFV-EB scheme and the magneto-sonic time step of a fully explicit finite volume scheme for all the Riemann problems RP1–RP7

4.3 Blast Wave

The MHD blast wave problem introduced in [7] represents a challenging test since it contains a strong magnetic field and a jump in the pressure of four orders of magnitude. The initial density is constant \(\rho = 1\), the initial velocity field is set to zero \((u,v,w) = (0,0,0)\) and the magnetic field is \({\textbf {B}}= (70,0,0)\). The computational domain \(\Omega =[-0.5;0.5]\times [-0.5;0.5]\) is paved with \(N_x \times N_y=1024 \times 1024\) cells, and Dirichlet boundary conditions are imposed everywhere. Inside the circular region \(r < 0.1\) with \(r = \sqrt{x^2 + y^2}\), the pressure is set to \(p = 1000\) whereas outside it is assigned with \(p = 0.1\). Thus initially, the Alfvén waves are faster than the sound speed inside the circular domain, that are given by \({b} = 70\) and \(c = 37.4166\), respectively. Here, we set \(\gamma = 1.4\) and the final time is chosen to be \(t_f = 0.01\). The results at final time for density, pressure, magnitude of the velocity computed as \({\textbf {v}}^2\) as well as the magnetic energy density m are displayed in Fig. 6 for the second-order SIFV-EB scheme. We observe that there are no oscillations arising in the simulation and all waves are captured accurately. The results compare qualitatively well with the literature [6, 18, 36].

Fig. 6
figure 6

Blast problem at time \(t_f=0.01\). Results for the logarithm (base 10) of density and pressure, magnitude of the velocity and magnetic pressure (from top left to bottom right)

4.4 Ideal MHD Rotor Problem

The next test case concerns a benchmark for the ideal MHD equations, the so-called rotor problem proposed in [7], which is characterized by a big density difference inside and outside of the rotor. The computational domain is given by the square \(\Omega =[-0.5;0.5]\times [-0.5;0.5]\) with Dirichlet boundaries, and it is discretized using \(N_x \times N_y=1024 \times 1024\) control volumes. The background pressure and magnetic field are constant and set to \(p = 1\) and \({\textbf {B}}= (2.5,0,0)^T\), respectively. The corresponding magnetic vector potential in z-direction is \(A_z = 2.5 y\). The density and velocity field are defined differently inside and outside of the rotor, i.e.

$$\begin{aligned} \rho = {\left\{ \begin{array}{ll} 10 &{} \text {if} \quad 0 \le r \le 0.1, \\ 1 &{} \text {else}, \end{array}\right. }\quad \quad (u,v,w) = {\left\{ \begin{array}{ll} (0,0,10) \times (x,y,z) &{} \text {if} \quad 0 \le r \le 0.1,\\ (0,0,0) &{} \text {else.} \end{array}\right. } \end{aligned}$$
(69)

The ratio of specific heats is set to \(\gamma = 1.4\) and the simulation is run until the final time \(t_f=0.25\). In Fig. 7, the results for the second-order SIFV-EB scheme are plotted for the density, pressure, acoustic Mach number \({M}_{c}\) and the magnetic energy density m. The scheme, though spanning a Mach number regime from weakly compressible to compressible with \({M}_{c}> 1\), yields results that compare well with simulations reported in literature see e.g. [18, 31].

Fig. 7
figure 7

Rotor problem at time \(t_f=0.25\). Results for density, pressure, Mach number and magnetic energy density (from top left to bottom right)

Furthermore, in Fig. 8 we also monitor the error in the divergence of the magnetic field, which is measure in the \(L_{\infty }\) norm over the whole computational domain at all time instants. For both the blast wave and the rotor problem we achieve a discrete divergence-free condition up to machine accuracy. Alongside, the new semi-implicit schemes allows the time step to be still larger than the one of a fully explicit scheme, even if strong shocks occur in these test cases. Looking at the right panel of Fig. 8, we clearly see that the SIFV-EB method can lead to a time marching scheme with a time step that is up to four times larger than a classical explicit solver.

Fig. 8
figure 8

Blast problem and rotor problem. left: time evolution of the infinity norm of the divergence of the magnetic field \(|\nabla \cdot {\textbf {B}}|_{\infty }\) for 1000 time steps. Right: Time evolution of the ratio between the material time step of the SIFV-EB scheme and the magneto-sonic time step of a fully explicit finite volume scheme

4.5 Orszag–Tang Vortex

We consider the well-known Orszag–Tang vortex for the two-dimensional ideal MHD equations [27, 54, 56]. The initial condition is smooth and reads

$$\begin{aligned}{} & {} (\rho , u, v, w, p, B_x, B_y, B_z) \nonumber \\ {}{} & {} = \left( \frac{25}{36\pi }, - \sin (2 \pi y), \sin (2 \pi x), 0, \frac{5}{12 \pi }, - \frac{\sin (2 \pi y)}{\sqrt{4 \pi } }, \frac{\sin (4 \pi y)}{\sqrt{4 \pi } }, 0\right) . \end{aligned}$$
(70)

The magnetic field \({\textbf {B}}\) is generated by the z-component of the magnetic potential

$$\begin{aligned} A_z = \frac{1}{8 \pi ^{3/2}} (\cos (2 \pi x) + 2\cos (\pi y)). \end{aligned}$$
(71)

Though initially smooth, the dynamics develop shocks along the diagonal direction in combination with a vortex located at the center of the computational domain, which is defined by \(\Omega =[0;1]\times [0;1]\) with periodic boundaries. We use a mesh made of \(N_x \times N_y=1024 \times 1024\) cells. Figure 9 depicts snapshots of the pressure computed with our second-order SIFV-EB scheme at times \(t = \{0.5, 1, 2, 4\}\). The features of the flows and the development of the shock are captured well and the results are qualitatively in very good agreement with those reported in the literature [5, 6, 31].

Fig. 9
figure 9

Orszag–Tang vortex at time \(t=0.5\), \(t=2\), \(t=3\) and \(t=4\) (from top left to bottom right). Results are given for the pressure p with 31 equidistant contour lines in the interval [0.5, 5.0]

4.6 Field Loop Advection

We solve the magnetic field loop advection problem originally proposed in [39], in the low Mach number version of [31] with \(\rho = 1\), an initial velocity field \((u,v,w) = (2,1,0)\) and the pressure \(p = 10^5\). The computational domain is given by \(\Omega =[-1;1]\times [-0.5;0.5]\) with periodic boundaries, and we use a mesh composed of \(N_x \times N_y = 512 \times 256\) cells. The magnetic field is prescribed by the magnetic vector potential in z-direction given by

$$\begin{aligned} A_z = {\left\{ \begin{array}{ll} A_0 (R- r) &{} \quad \text {if} \quad r \le R,\\ 0 &{} \quad \text {else}, \end{array}\right. } \end{aligned}$$
(72)

where \(A_0=10^{-3}\), \(R = 0.3\) and \(r = \sqrt{x^2 + y^2}\). This test case is very challenging because of a singular point in the magnetic field \({\textbf {B}}\) at the center of the computational domain. This setting places the flow in a low acoustic Mach number regime \({M}_{c}\approx 6 \cdot 10^{-3}\) and high Alfvén Mach number regime \({M}_b\approx 7.9 \cdot 10^3\). To make the test more challenging, we perform four different simulations with a progressively increasing value of \(A_0\), reaching a configuration with an Alfvén Mach number \({M}_b\approx 7.9\) corresponding to \(A_0=1\). The final time is chosen to be \(t_f = 1\), and the results are depicted in Fig. 10. The shape of the magnitude of the magnetic field remains qualitatively unchanged despite the difference in the Alfvén Mach number, hence demonstrating that the new SIFV-EB scheme is independent of the magnetic scales. Indeed, the time step for all the simulations is the same and is only determined by the convective velocity \((u,v)=(2,1)\) which transports the loop diagonally through the domain.

Fig. 10
figure 10

Field loop advection problem at time \(t_f=1\). Magnitude of the magnetic field with \(A_0 = \{ 10^{-3}, 10^{-2}, 10^{-1}, 10^{0}\}\) (from top to bottom)

In Fig. 11 we show the errors related to the divergence of the magnetic field for all four simulations, demonstrating that the discrete divergence-free condition is preserved up to machine accuracy. The infinity norm of the divergence of \({\textbf {B}}\) is considered over the whole domain and at each time level.

Fig. 11
figure 11

Field loop advection problem with \(A_0 = \cdot \{ 10^{-3}, 10^{-2}, 10^{-1}, 10^{0}\}\). Evolution of the infinity norm of the divergence of the magnetic field \(|\nabla \cdot {\textbf {B}}|_{\infty }\) for 1000 time steps of each simulation

4.7 Magnetized Kelvin Helmholtz Instability

We consider the setup for the Kelvin–Helmholtz instability recently proposed in [47] for ideal MHD. The computational domain is the rectangular box \(\Omega =[0;2]\times [-0.5;0.5]\) with periodic boundaries. It is paved with a computational grid made of \(N_x \times N_y = 512 \times 256\) control volumes. A uniform density \(\rho =\gamma \) with \(\gamma =1.4\) and a uniform pressure \(p=1\) is initially assigned to the fluid. The velocity and the magnetic field are prescribed as a function of the parameter \(M_x\), which represents the maximum acoustic Mach number of the horizontal flow. The velocity field is given by

$$\begin{aligned} u=M_x \, (1-2\eta (x)), \qquad v = 0.1 \, M_x \, \sin (2\pi x), \end{aligned}$$
(73)

with the perturbation \(\eta (x)\)

$$\begin{aligned} \eta (x) = {\left\{ \begin{array}{ll} 0.5 \left( 1 + \sin (16\pi (y+0.25)) \right) &{} \quad \text {if } y \ge -\frac{9}{32} \text { and } y< -\frac{7}{32},\\ 1 &{} \text {if } y \ge -\frac{7}{32} \text { and } y< \frac{7}{32}, \\ 0.5 \left( 1 - \sin (16\pi (y-0.25)) \right) &{} \quad \text {if } y \ge \frac{7}{32} \text { and } y < \frac{9}{32},\\ 0 &{} \quad \text {otherwise}. \end{array}\right. } \end{aligned}$$
(74)

The magnetic field at the initial time is uniform and horizontal, i.e. \(B_x=0.1 \, M_x\), and the associated \(z-\)component of the magnetic potential is given by \(A_0=B_x \, y\). This configuration at time \(t=0\) leads to a unit adiabatic sound speed and to a minimum Alfvén mach number \(M_{b,\min {}}=11.82\). The simulation is run with different values of \(M_x\) until the final time \(t_f=t_{\max }/6\) with \(t_{\max }=4.8/M_x\). The flow develops a smooth and resolved interface across the shear flow, hence yielding to convergent results in the early stages of the dynamics. Figure 12 plots the acoustic Mach number at the end of the simulation. It is rescaled with the prescribed value of \(M_x\). Note that all the results are almost identical since excessive numerical dissipation is avoided thanks to the central implicit discretization of the pressure and the magnetic terms. Fully explicit schemes would not preserve the vortical structures as the value of \(M_x\) gets smaller, as noticed in [47]. Furthermore, our SIFV-EB scheme can run these test cases with a time step that is up to 10,000 times larger compared to a fully explicit method, as shown in Fig. 13.

Fig. 12
figure 12

Kelvin–Helmholtz instability test at time \(t/t_{\max }=1/6\) for \(M_x=\{10^{-1},10^{-2},10^{-3},10^{-4}\}\). Distribution of the acoustic Mach number rescaled by the corresponding value of \(M_x\) (\({M}_{c}/M_x\)) with 31 equidistant contour lines in the interval [0, 1.6]

Fig. 13
figure 13

Kelvin–Helmholtz instability test. Time evolution of the ratio between the material time step of the SIFV-EB scheme and the magneto-sonic time step of a fully explicit finite volume scheme for different values of \(M_x\)

4.8 3D Cloud-Shock Interaction Problem

As last test case we consider the 3D cloud-shock interaction problem. The computational domain is given by \(\Omega =[0;1]^3\) with Dirichlet boundary conditions, and we employ a computational mesh with a total number of \(N_x=N_y=N_z=180^3\) cells, corresponding to approximately \(16.5 \cdot 10^6\) degrees of freedom. The initial condition is taken from [44] where the initial shock front is located at \(x_0 = 0.0\) with

$$\begin{aligned}{} & {} (\rho , u, v, w, p, B_x, B_y, B_z) = \nonumber \\{} & {} {\left\{ \begin{array}{ll} \begin{aligned} \hspace{-5.0pt}&{}&{}(3.86859, &{}&{}11.2536, \quad &{}0, &{}0, &{}&{}167.345, \quad &{}0, &{}2.1826182, &{}&{}-2.1826182~)&{} \quad \text {if } x < x_0 \\ \hspace{-5.0pt}&{}&{}(1, &{}&{}0, \quad &{} 0,&{} 0, &{}&{}1,\quad &{}0, &{}0.56418958, &{}&{}0.56418958~)&{} \quad \text {if } x \ge x_0 \end{aligned} \end{array}\right. }.\nonumber \\ \end{aligned}$$
(75)

The associated magnetic vector potential writes

$$\begin{aligned} {\textbf {A}}= {\left\{ \begin{array}{ll} \begin{aligned} \hspace{-5.0pt}&{}&{}(2.1826182 y, &{}&{}0, \quad &{}&{} -2.1826182 (x - 0.05) ~)^T&{} \quad \text {if } x < x_0 \\ \hspace{-5.0pt}&{}&{}(-0.56418958 y, &{}&{}0, \quad &{}&{} 0.56418956 (x - 0.05)~)^T&{} \quad \text {if } x \ge x_0 \end{aligned} \end{array}\right. }. \end{aligned}$$
(76)

This shock front travels towards a spherical cloud of density \(\rho = 10\) situated at \({\textbf {x}}= (0.25,0.5,0.5)\) with radius \(r=0.15\). The final time is set to \(t_f = 0.06\). In Fig. 14, we compare the first against the second order SIFV-EB scheme. The density profiles along the planes cutting through the center of the initial cloud position are displayed. The first snapshot is taken shortly after the shock front hits the density cloud, the second one after the shock front passes through the cloud, and the third one shortly before the shock front leaves the computational domain. One can observe that the second-order scheme greatly improves the resolution of the flow structures, which are qualitatively in very good agreement with the results presented in [44]. This test case demonstrates the capability of the SIFV-EB scheme to handle genuinely 3D magnetized flows at reasonable compute times due to the linear implicit structure of our novel SIFV-EB scheme.

Fig. 14
figure 14

3D cloud-shock interaction problem at time \(t=0.02\) (top), \(t=0.04\) (middle) and \(t=0.06\) (bottom). Distribution of the logarithm of density obtained with first (left) and second (right) order SIFV-EB schemes. Slices along the planes \(x=0.25\), \(y=0.5\) and \(z=0.5\)

5 Conclusions

In this work, we have introduced a new divergence-free semi-implicit finite volume method for the simulation of ideal magnetized flows in multiple space dimensions. To tackle the time multi-scale nature of the governing equations, a flux splitting technique is adopted, which allows to separate the convective terms, the hydrodynamic pressure contribution and its magnetic counterpart. More specifically, the non-linear convective contribution is discretized explicitly with a classical finite volume scheme, while we use a finite difference semi-implicit strategy to compute the hydrodynamic pressure and the magnetic fluxes, that ultimately yields two linear systems to be solved at each time step of the algorithm. We underline that these two systems are uncoupled, thus firstly we solve for the unknown magnetic field, and secondly we determine the unknown pressure contribution. This approach makes the scheme very efficient, especially in the low acoustic or Alfvén regimes, since the time step is restricted by a milder CFL stability condition that is only based on the material waves. Furthermore, no numerical dissipation is added in the discretization of the implicit pressure fluxes, hence the scheme does not pollute the solution in the low acoustic Mach number regime, contrarily to standard explicit finite volume methods. To satisfy the solenoidal property of the magnetic field, the equations are written in terms of the magnetic vector potential in a multi-dimensional setting, and a set of finite difference operators are specifically designed to mimic the algebraic property of the zero div-curl at the discrete level, thus preserving the structure of the underlying model. The entire spatial discretization is cell-centered, and second-order of accuracy is achieved by means of a TVD reconstruction procedure in the finite volume scheme. The class of semi-implicit IMEX Runge–Kutta schemes is employed to reach second-order accuracy also in time. The new schemes have been thoroughly tested in terms of accuracy and robustness against a wide set of test cases, addressing different acoustic and Alfvén Mach number regimes, demonstrating the capability of our novel methods to span a wide range of physical settings in ideal MHD.

In the future, we plan to carry out a theoretical and numerical study of the limit models in the low Alfvén Mach number, which is still rather unexplored. The extension of the presented approach to unstructured meshes is also foreseen, with particular care in the development of divergence-free operators that can guarantee the solenoidal property of the magnetic field. Finally, future research lines will consider the application to viscous and resistive MHD equations in the context of Tokamak simulations.