Abstract
We present a high order, robust, and stable shockcapturing technique for finite element approximations of ideal MHD. The method uses continuous Lagrange polynomials in space and explicit RungeKutta schemes in time. The shockcapturing term is based on the residual of MHD which tracks the shock and discontinuity positions, and adds sufficient amount of viscosity to stabilize them. The method is tested up to third order polynomial spaces and an expected fourthorder convergence rate is obtained for smooth problems. Several discontinuous benchmarks such as OrszagTang, MHD rotor, BrioWu problems are solved in one, two, and three spacial dimensions. Sharp shocks and discontinuity resolutions are obtained.
Similar content being viewed by others
1 Introduction
Conservation laws play an important role in modeling and understanding physical processes. For example, conservation of mass, energy, and momentum are fundamental principles in gas and fluid dynamics. For ideal flow, these principles are modeled using the wellknown system of Euler equations. Despite a long history and extensive research in understanding and solving Euler equations, many important mathematical and numerical questions remain unsolved. Especially for highspeed flows (higher than the speed of sound), solutions to the Euler system lose their regularity and many complex phenomena such as shocks, strong discontinuities, rarefaction, and contact waves develop. Besides, at very high temperature and energy gas transforms into plasma. Plasma is an ionized gas and the dynamic of plasmas is modeled by adding additional terms and equations involving the magnetic field \({\varvec{B}}\) into the Euler system. This resulting system is usually referred to as Magnetohydrodynamics or MHD in short.
Numerical approximation of MHD started as soon as researchers started to simulate the Euler equations, see [1, 2]. Existing numerical methods for compressible Euler equations are hard to extend to approximate the MHD system. If one reason is solving dadditional equations, where d is the space dimension, other two main reasons are (i) developing high order robust shockcapturing techniques, (ii) satisfying the divergencefree constraint for the magnetic field, i.e., \(\nabla {\cdot \,}{\varvec{B}}= 0\). Stateoftheart numerical methods to solve the MHD equations are finite differences, finite volumes, and discontinuous Galerkin (DG) schemes. Most of the finite difference and finite volume schemes are based on approximate solutions to the Riemann problem of MHD, see for instance [3,4,5,6,7,8,9] and references therein. Due to similarities of finite volume and DG schemes, an approximate Riemann solver approach was incorporated in the Galerkin variational formulation for the DG schemes, see e.g., [10,11,12]. In general, the exact or approximate Riemann solvers are difficult to compute. Especially, the MHD system is not strictly hyperbolic and has a nonconvex flux, and therefore it may admit nonregular waves which may result in nonunique Riemann solution [13]. To overcome this difficulty, numerical methods that do not use Riemann solvers have been developed. For instance central DG schemes reported in [14,15,16] approximate the MHD solutions without using any approximate or exact Riemann solvers.
The success of finite volume and DG schemes has not been observed in a continuous finite element (FE) framework. A reason for it could be the lack of high order, robust explicit stabilization techniques to stabilize continuous FE approximations of MHD. Traditional stabilization methods for FE approximations of conservation laws including Euler and MHD equations are based on the GalerkinLeastSquares argument (GLS) augmented with residualbased shockcapturing terms, see for instance [17, 18] and references therein. GLS schemes are implicit by construction, difficult to make high order in time, and nontrivial to implement since the test functions are required to be timedependent. Only a few works were done to simulate resistive MHD using GLS stabilization, see for instance [19,20,21] and references therein.
It appears that a way of constructing a highorder explicit FE approximation of conservation laws could be by entirely disregarding the GLS terms from the stabilized formulation. Recently, [22,23,24,25] proposed the socalled entropy viscosity method, where the FE approximation is stabilized by adding an elliptic term, and the artificial viscosity coefficient is constructed to be proportional to an entropy residual of the system. For scalar conservation laws, the FE residual is one of the entropy residuals. Therefore, the residualbased artificial viscosity method can be obtained by disregarding the GLS terms in the stabilization method of [17]. In [26], we proved that the FE approximation of residualbased artificial viscosity method applied to scalar conservation laws converges to the unique entropy solution, and we extended the method to solve more general systems in the framework of DG, spectral elements, finite differences, and radial basis functions (RBF), see e.g., [27,28,29,30,31]. For other approaches to constructing the nonlinear artificial viscosity methods, we refer to the work of [32,33,34], where the stabilization is constructed based on a smoothness indicator of the solution.
In this work, we propose a new residualbased shockcapturing method for FE approximation of the MHD system. The method is explicit in time and works for high order polynomial degrees. The divergencefree constraint is obtained using several techniques, including the projection of \({\varvec{B}}\) into a divergencefree space [35] and the hyperbolic cleaning [36]. We should emphasize that positivity and invariant domain preservation of the method as in [37] is left beyond the scope of this paper.
The paper is organized as follows: in Sect. 2, we introduce important notations and terms that are used in the paper, such as FE spaces, meshes, and matrices. In Sect. 3, we introduce the ideal MHD equations, eigenvalues, and the divergence cleaning techniques. In Sect. 4, we present a viscous regularization of the MHD equations using a novel residualbased shockcapturing method. Finally, in Sect. 5, we solve several wellknown benchmark problems for ideal MHD. The results show that the viscosity method does not change the convergence orders of the base scheme for smooth problems while being able to capture discontinuous solutions in the nonsmooth tests. Section 6 is the conclusion.
2 Continuous Galerkin Finite Element Method
In this section, we introduce the finite element spaces and notations that are used in this work.
Let us consider an open bounded domain \(\Omega \subset {{\mathbb {R}}}^d\), \(d=1,2,3\) with boundary \(\Gamma \). We denote \({{\mathcal {T}}}_h\) a finite partition of \(\Omega \) into disjoint elements K such that no vertex of any element is placed on the interior of an edge of another element. The union of all the closure of elements K constitutes \({\overline{\Omega }}\), where \({\overline{\Omega }}\) denotes the closure of \(\Omega \).
We seek finite element solution in Lagrange polynomial spaces
where \({{\mathbb {P}}}_k\) is a space of polynomials of at most k degrees. Let \(\Phi _i\) be the kdegree Lagrange basis function in \({{\mathcal {Q}}}_h\) which takes value 1 at node i, and 0 at any other nodes. The node distribution is uniform as in conventional continuous FE methods. The functions \(\{\Phi _i\}_{i=1}^{N_h}\) form a basis for \({{\mathcal {Q}}}_h\), where \(N_h\) is the total number of nodes in \({{\mathcal {Q}}}_h\). We define \({{\mathcal {I}}}(i)\) the set of all nodal points contained within the support of \(\Phi _i\). Furthermore, we use the following Hilbert space inner products,
We will use a meshfunction \(h_h({\varvec{x}})\in {{\mathcal {Q}}}_h\) which we compute using the following projection: find \(h_h({\varvec{x}})\in {{\mathcal {Q}}}_h\) such that
where \(h_K\) is the circumradius of the element K.
3 Governing Equations of MHD
Let us denote the time interval \([0, {\widehat{t}} \,\,]\), where \({\widehat{t}}\) is the final time. For all \(({\varvec{x}},t) \in D:= \Omega \times [0,{\widehat{t}} \,\,]\), we seek solution of the MHD equations \({{\mathbf {\mathsf{{{U}}}}}}:=(\rho , {\varvec{m}}, E, {\varvec{B}}),\;\rho , E: D\rightarrow {{\mathbb {R}}}\), \({\varvec{m}},{\varvec{B}}:D\rightarrow {{\mathbb {R}}}^d\), where \(\rho \) is the mass density, \({\varvec{m}}\) is the momentum, E is the total energy, \({\varvec{B}}\) is the magnetic field. The ideal MHD equations in conservative form with appropriate boundary conditions are defined as follows:
where the nonlinear tensor fluxes \({{\mathbf {\mathsf{{{F}}}}}}_{{{\mathcal {E}}}}({{\mathbf {\mathsf{{{U}}}}}}), {{\mathbf {\mathsf{{{F}}}}}}_{{{\mathcal {B}}}}({{\mathbf {\mathsf{{{U}}}}}})\) are defined as
with \({\varvec{u}}:={\varvec{m}}/ \rho \) being the velocity field, and \({\varvec{\beta }}\) being the Maxwell stress tensor:
where \({{\mathbb {I}}}\) denotes the identity matrix of size \(d\times d\). The combination of hydrodynamics and electromagnetism nature of the MHD system can be seen from the MHD equations in the form of (3.1), through the separated fluxes \({{\mathbf {\mathsf{{{F}}}}}}_{{{\mathcal {E}}}}({{\mathbf {\mathsf{{{U}}}}}})\) and \({{\mathbf {\mathsf{{{F}}}}}}_{{{\mathcal {B}}}}({{\mathbf {\mathsf{{{U}}}}}})\). The thermodynamic pressure p is computed from the equation of state
where e is the internal energy and \(\gamma \) is the adiabatic gas constant. The internal energy is computed as
In addition, the magnetic field should satisfy the following divergence free constraint:
Note that the above equations are in nondimensional form, as suggested by [20, Sec. 3.1].
3.1 Eigenvalues of the Inviscid MHD
We are going to use the maximum wave speeds to construct our stabilization terms. A good approximation of the local wave speeds is obtained by eigenvalues of the inviscid MHD equations. It is wellknown that eight eigenvalues are corresponding to the eight elementary waves for the ideal MHD equations, see e.g., [4, 38, 39]: let \({\varvec{e}}\in {{\mathbb {R}}}^d\) be a direction vector, \(a:=(\gamma p/\rho )^{\frac{1}{2}}\) be the speed of sound, \(c_{a} := {\varvec{B}}{\cdot }{\varvec{e}}/\rho ^\frac{1}{2}\) and
The eigenvalues from the smallest to the largest are
where the subscripts \(_{f}\), \(_{s}\), and \(_{a}\) correspond to fast and slow magnetosonic waves, and the Alfén waves. The characteristics \(\lambda _{4,5}\) correspond to entropy and divergence waves. It is clear to see that the first and eighth eigenvalues are the ones of interest, which represent the fastest moving waves. Later in Sect. 4, we will use the maximum wave speed
in the construction of the nonlinear viscosity term.
3.2 Divergence Cleaning Techniques
To satisfy the magnetic divergencefree condition (3.5), we have verified that our proposed nonlinear stabilization can be used along with popular techniques for divergence cleaning: the elliptic correction/projection method by [35], and the hyperbolic correction by [36, 40]. A numerical comparison between the mentioned techniques is included in Sect. 5.3.
3.2.1 Elliptic Correction/Projection Method
In each time step, instead of using the magnetic solution \({\varvec{B}}\) from the system, \({\varvec{B}}'\) the projection of \({\varvec{B}}\) onto a magnetic divergencefree space is used. [35] proposed using
where \(\Psi _p\) is the solution to the Poisson equation
This yields \(\nabla {\cdot \,}{\varvec{B}}' = 0\) as the nonphysical part \(\nabla \Psi _p\) is removed from the numerical solution \({\varvec{B}}\). After each correction in the magnetic field \({\varvec{B}}\), the dependent variables: pressure p, temperature T, energy E, and the entropy functions are updated accordingly to ensure consistency of the discrete solution. Contrary to the seemingly adhoc nature of this method, [41] shows that the projection method preserves conservative properties and accuracy of the base scheme.
Pseudo timestepping Numerically minimizing \(\vert \nabla {\cdot \,}{\varvec{B}}'\vert \) by the projection method is considered computationally expensive. A more affordable alternative, proposed by [42], is solving the following timedependent equation for \(\Psi _p\),
where the variable \({{\widetilde{t}}}\) is a separate time dimension. At equilibrium, the solution to (3.8) is the one to the Poisson equation. A semidiscretization of (3.8) is given by
where \({\widetilde{\tau }}\) is the pseudo step size. After each pseudo time step, the magnetic solution \({\varvec{B}}\) is corrected \({\varvec{B}}^{\ell +1}={\varvec{B}}^{\ell }\nabla \Psi _p^{\ell +1}\). The divergence \(\nabla {\cdot \,}{\varvec{B}}'\) is gradually decreased. One can think of this technique as an iterative method for solving the Poisson equation (3.7). The computational cost depends on how many pseudo steps are performed. Since the divergence error is not necessarily exactly zero, normally a few pseudo steps are sufficient.
3.2.2 Hyperbolic Correction
An auxiliary scalar variable \(\Psi _l\) is added to the system to transport and suppress the divergence violation on the magnetic field. We add a fifth equation to the MHD system
where \(c_r = 0.3\) in 2D or \(c_r = 1.0\) in 3D [40], and \(h_h({\varvec{x}})\) denotes the mesh function computed in (2.2). The coefficient \(c_h\) is set to be the maximum wave speed \(c_h\) = \(\max _{j=1,...,N_h}\left( \vert \lambda _1({\varvec{N}}_j)\vert , \vert \lambda _8({\varvec{N}}_j)\vert \right) \). In addition, a source term is added to the right hand side of (3.1),
where
If the hyperbolic correction is used, the internal energy (3.4) is modified as
and the extra wave speeds are given by \(\lambda _{\text {GLM}1,2}={\varvec{u}}{\cdot }{\varvec{e}}\pm c_h\), see [43].
Remark 1
(The Powell source term [4]) Even when one of the divergence cleaning methods is used, as in the numerical examples in Sect. 5, the divergence error of the numerical solution is not perfectly zero. It has been analyzed by several authors, see e.g., [43, 44], that when the divergence error is nonzero, the Powell source term [4] or its variances should be added to the ideal MHD system to maintain the consistency of the Lorentz force and thermodynamics. However, as a result from the addition of the source term, the flux becomes nonconservative. This leads to some drawbacks. For instance, in presence of strong shocks, the locations of the discontinuities can be inaccurate [41]. A common approach in the recent works is to combine the GLM method with the Powell term, see [43, 45]. We however do not observe significant numerical benefits of the Powell term in the numerical examples presented in this paper. The discussion of stability and entropy principles in addition of the Powell term to our FE framework is left as a future work.
4 Nonlinear Viscosity Method for MHD
The aim of this paper is to solve the inviscid MHD system (3.1) using continuous finite element approximations. We use the following two vector valued spaces:
where \({{\mathcal {Q}}}_h\) is defined in (2.1). Then, we formulate the finite element approximation of the MHD system (3.1) as follows: find \({{\mathbf {\mathsf{{{U}}}}}}_h(t) :=(\rho _h, {\varvec{m}}_h, E_h, {\varvec{B}}_h)^\top \in {{\mathcal {C}}}^1([0,{\widehat{t}} \,\,]; {\mathcal {{\varvec{W}}}}_h)\) such that
Given that the flux functions are interpolated in a polynomial space, the inner products can be computed exactly using appropriate numerical quadrature rules. This holds true in our numerical simulations using FEniCS, an opensource finite element framework, see [46]. The finite element approximation of the flux terms in (4.2) is equivalent to central difference schemes, therefore produces spurious oscillations and cannot be used for strong discontinuities such as shocks and contact lines. Below, we introduce a nonlinear artificial viscosity approach to fix this issue.
4.1 New Class of Viscous Regularization of the MHD Equations
In this section, we propose using the following vanishing viscosity regularization of the MHD system. The new regularization is obtained by adding an elliptic term \(\nabla {\cdot \,}{{\mathbf {\mathsf{{{F}}}}}}_{{{\mathcal {V}}}}({{\mathbf {\mathsf{{{U}}}}}})\) into the MHD system, where \({{\mathbf {\mathsf{{{F}}}}}}_{{{\mathcal {V}}}}({{\mathbf {\mathsf{{{U}}}}}})\) denotes a viscous flux tensor.
As a heuristic argument to construct \({{\mathbf {\mathsf{{{F}}}}}}_{{{\mathcal {V}}}}({{\mathbf {\mathsf{{{U}}}}}})\), we start from the viscous flux of the resistive MHD equations, see e.g., [47],
where the temperature \(T_h\) is a function in \({{\mathcal {Q}}}_h\). The viscous shear stress tensor \({\varvec{\tau }}_h\) is defined as
where \(\mu _h \ge 0\) is the artificial dynamic viscosity, \(\lambda _h\) is the bulk viscosity of undetermined sign such that \(\lambda _h + 2\mu _h > 0\), \(\kappa _h \ge 0\) is the artificial heat conduction, \(\eta _h \ge 0\) is the artificial electric resistivity of the medium. Note that the electric resistivity \(\eta _h\) has the same dimension as the dynamic viscosity coefficient \(\mu _h\). We point out that the temperature and velocity fields are computed at the nodal points: \(T_h({\varvec{N}}_i) = p_h({\varvec{N}}_i)/\rho _h({\varvec{N}}_i)\), \({\varvec{u}}_h({\varvec{N}}_i) = {\varvec{m}}_h({\varvec{N}}_i)/\rho _h({\varvec{N}}_i)\), \(i\in \{1,\ldots ,N_h\}\).
By considering zero magnetic field, i.e., \({\varvec{B}}\equiv 0\) and thus \({{\mathbf {\mathsf{{{F}}}}}}_{{{\mathcal {B}}}}({{\mathbf {\mathsf{{{U}}}}}}) \equiv 0\), we obtain from (3.1) the compressible Euler equations. For the compressible Euler equations, a frequent choice of viscous regularization is the NavierStokes flux, see e.g., [25], which coincides with \({{\mathbf {\mathsf{{{F}}}}}}_{{{\mathcal {V}}}}^0({{\mathbf {\mathsf{{{U}}}}}}_h)\) when \({\varvec{B}}\equiv 0\). The NavierStokes flux does not add any viscosity term to the mass equation. Therefore, positivity of density can be violated [25, 48]. In [48], the authors have shown the importance of regularizing the mass equation and have proven that it is a key argument for keeping density and internal energy positive, and for the minimum entropy principle. Numerical validation of the viscous regularization compressible Euler equation including the mass equation in the context of highorder finite element approximation is reported in [25]. They show that the new viscous flux performs better than the traditional NavierStokes flux in capturing complex phenomena, e.g., shocks, rarefaction, contact lines, while maintaining high order accuracy.
For MHD, we add a corresponding elliptic term scaling by a positive number \(\nu _h\) to regularize the mass conservation. Therefore, the obtained viscous flux is a slightly modified NavierStokes viscous fluxes for the flow part and resistivity magnetic fluxes for the magnetic part:
Then, the viscous regularized finite element approximation of the MHD equations is: find \({{\mathbf {\mathsf{{{U}}}}}}^{{\varepsilon }}_h(t) \in {{\mathcal {C}}}^1([0,{\widehat{t}} \,\,]; {\mathcal {{\varvec{W}}}}_h)\) such that
where \({\varvec{n}}\) is the normal vector pointing outward at every point on the boundary \(\Gamma \). In the rest of the paper, we look for a viscous solution, however, to make the notation easier, we drop the superscript \(^{{\varepsilon }}\) sign.
We construct the viscosity coefficients \(\nu _h, \mu _h, \kappa _h\), and \(\eta _h\), all are from the finite element space \({{\mathcal {Q}}}_h\), and make them proportional to a nonlinear functional such that enough viscosity is added to the system in terms of stability and accuracy.
In the following sections, we construct \(\nu _i^{L,n}\) and \(\nu _i^{H,n}\), the low and high order kinematic artificial viscosity coefficients correspondingly for each nodes \({\varvec{N}}_i\), \(i= \{1, \ldots , N_h\}\). Other viscosity coefficients are then constructed using the kinematic viscosity coefficient.
4.2 FirstOrder Viscosity
At each node \(i \in \{1,2,\dots ,N_h \}\), we compute the first order viscosity at time \(t=t^n\) as
where \(h_i\) is the nodal values of the mesh function \(h_h({\varvec{x}})\), \(\lambda ^n_{\max }\) is the largest eigenvalue at time \(t=t^n\), given by (3.6), and \(C_{\max }\) is a positive parameter. A typical range of \(C_{\max }\) is reportedly [0.15, 0.5], see [27]. In one space dimension, it can shown that \(C_{\max } = 0.5\) leads to the first order LaxFriedrichs scheme. We use \(C_{\max } = 0.5\) in all the numerical examples in this article for all polynomial degrees. Note, that the mesh function is already scaled with the polynomial degree in (2.2).
This choice of firstorder viscosity is consistent with the CFL condition discussed later. In addition, the largest eigenvalue turned out to be sufficient to construct a stable firstorder viscosity for the numerical examples considered in this work. We emphasize that for a positivity preserving firstorder scheme, similar to the Euler system, as in [49], a more accurate estimate of the maximum wave velocity is required.
Our goal is to build a highorder stabilized method. We use the firstorder scheme as a safety factor and then construct a highorder extension of it.
4.3 HighOrder ResidualBased Viscosity
The idea behind a high order scheme is to build an indicator that tracks strong shocks and discontinuities and activates the firstorder method from the section above. At the same time, the indicator should decrease the viscosity where the solution is smooth. For this, we use the finite element residual of the PDE as an indicator, since it vanishes in smooth regions, i.e., \(\sim {{\mathcal {O}}}(h_h^{k+1})\), and has a jump of size \(\sim {{\mathcal {O}}}(h_h^{ 1})\) at discontinuities.
We use the residual as an indicator, therefore, we need to get rid of the corresponding solution unit. Our aim is to find a normalization function such that it transforms any input function to the same arithmetic range, and is locally amplified at the regions where the input function changes drastically.
Consider a continuous scalar function \(w:{{\mathbb {R}}}^d\rightarrow {{\mathbb {R}}}\) and in particular the case \(w \in {{\mathcal {Q}}}_h\). We propose dividing w by the following function to normalize w
where \({\bar{S}}\) indicates the global maximum variance \({\bar{S}}(w) = \Vert w  \text {mean}(w)\Vert _{L^{\infty }(\Omega )}\), and the global constant \(\alpha \) is calculated as
which acts as a unit normalizer of local jumps to the global variance. As a technical detail, notice that when w is a constant uniform function, we have \({\max _{\Omega }w\min _{\Omega }w}=\max _{j\in {{\mathcal {I}}}(i)} w_j\min _{j\in {{\mathcal {I}}}(i)}w_j=0\) for all \(i\in \{1,2,\dots ,N_h\}\). In that case, n(w) reduces to \(\left (1C_l){\bar{S}}(w)\right \) which although being zero, we do not suffer from division by zero in the calculation of n(w). In an earlier development, the normalization function n(w) in [30] can be obtained by setting \(\alpha = 1\) in (4.6). We observe that the new formulation (4.6) deals better with mixedsigned solutions since the two factors in n(w) are of the same unit. To demonstrate this argument, we rewrite the expression (4.6) as
The parameter \(C_l \in (0, 1)\) allows fine tuning of how sensitive this normalization affects the local discontinuities. Observe that the ratio \((\max _{j\in {{\mathcal {I}}}(i)}w_j\min _{j\in {{\mathcal {I}}}(i)}w_j)/(\max _{\Omega }w\min _{\Omega }w)\) is in between the interval [0, 1], and is amplified at local solution jumps. If the input function w holds both positive and negative parts, and if \(\alpha =1\), it is possible that \(n(w)_i = 0\) at the regions where the local jumps incidentally matches the global variance. However, once the local jump bypasses the global variance, n(w) can become uncontrollably big, which opposes to our aim that n(w) should be small at such circumstances. On the other hand, the formula (4.7) does not suffer this issue because the value within the bracket in (4.7) is strictly positive. How small n(w) can become is tuned with the parameter \(C_l\). For example, if \(C_l = 1\), n(w) can become zero at the largest jump of w. Lowering \(C_l\) from 1 towards 0 would make n(w) at jumps of w larger and larger but not exceeding \({\bar{S}}(w)\). In smooth regions, n(w) turns into \({\bar{S}}(w)\), which is the classical normalization function of our residualbased viscosity technique, see [26].
Next, we construct a normalized finite element residual of the MHD equations as
where the normalization terms \(n(\rho ^n_h),\) \( n({\varvec{m}}^n_{h,1}),\) \(\dots ,\) \( n({\varvec{m}}^n_{h,d}),\) \(n(E_h),\) \(n({\varvec{B}}^n_{h,1}),\dots ,n({\varvec{B}}^n_{h,d})\), as defined above, normalize the residual units and magnitude. It is also possible that the denominators in (4.8) become close to zero, in the cases when the initial solution or the analytic solution of the corresponding component is a constant or almost a constant. To avoid division by zero, instead of using \(R(q_h)/n(q_h)\), where \(q_h\) is a scalar function, we use \(R(q^n_h)\frac{n(q^n_h)}{n(q^n_h)^2+\epsilon }\). We choose \(\epsilon \) to be machine epsilon, i.e. approximately \(2.2e^{16}\).
For each component \(q^n_h\in \{\rho ^n_h, {\varvec{m}}^n_{h,1},\dots ,{\varvec{m}}^n_{h,d},E^n_h,{\varvec{B}}^n_{h,1},\dots ,{\varvec{B}}^n_{h,d}\}\), the residual \(R(q^n_h)\) can be calculated by standard finite element projection,
where \(f(q^n_h)\) corresponds to the nonlinear MHD flux in (4.2) for each component \(q^n_h\), and \(\text {BDF}(q_h)^n\) is a backward difference approximation of the time derivative \({\partial }_tq_h\) at time \(t=t^n\). Note that the secondorder BDF formula is sufficient in getting 4th order accurate scheme, which is given by
For \({{\mathbb {P}}}_1,{{\mathbb {P}}}_3\) Lagrange elements, we observe that without destroying robustness, the residual can be calculated much more efficiently by approximating the above projection solution by lumping the mass matrix,
where \(m_i = \int _{\Omega } \varphi _i \,\mathrm {d}x > 0\) for \({{\mathbb {P}}}_1,{{\mathbb {P}}}_3\) Lagrange polynomials.
Finally, we are now ready to construct the final artificial viscosity on each node i at time \(t=t^n\):
where \(\nu _i^H = C_Rh_{h,i}^2 R^n_i\), \(R^n_i\) is the nodal value of the residual \({{\widetilde{R}}}_h^n\), \(C_R\) is a positive parameter. A typical range of \(C_{R}\) is reportedly [0.1, 1], see [27]. For the numerical simulations in this paper, we use \(C_R = 1\). In the rest of this paper, we refer to using (4.10) in the formulation of the viscous regularized Eq. (4.5) as the “RV method”.
4.4 Other Viscosity Coefficients
In the previous sections, we have shown how the kinematic viscosity coefficient \(\nu _h\) is constructed. The unit of \(\nu _h\) is \(\text{ length}^2/ \text{ time }\), which corresponds to its physical unit. Next, we calculate the dynamic viscosity as
The heat conduction \(\kappa _h\) is then computed using the dynamic viscosity \(\mu _h\):
where Pr is the Prandtl number, a dimensionless parameter. We also know that the unit of electrical resistivity is the same as kinematic viscosity, i.e. \(\text{ length}^2/ \text{ time }\). Thus, in our numerical calculation, we take
Lastly, we set the bulk viscosity coefficient \(\lambda _h:=0\) in all results presented in this paper.
4.5 Adaptive TimeStepping
Once the MHD system is discretized in space using the continuous finite element method we obtain the system of ODEs (4.5). Let us denote this system as
where \({{\mathbb {M}}}\in {{\mathbb {R}}}^{(2d+2)N_h\times (2d+2)N_h}\) is the mass matrix, \({{\mathcal {F}}}({{\mathbf {\mathsf{{{U}}}}}}_h(t), {\varvec{\mu }}_h(t))\) is the righthandside function of the system which depends on the solution \({{\mathbf {\mathsf{{{U}}}}}}_h(t)\) and the viscosity vector is \({\varvec{\mu }}_h(t) := (\nu _h(t), \mu _h(t), \kappa _h(t), \eta _h(t))\).
Next, discretize this system in time using explicit rstage RungeKutta methods:
where \(\tau _n := t^{n+1}  t^n\), \({{\mathbf {\mathsf{{{U}}}}}}^{n}_h := {{\mathbf {\mathsf{{{U}}}}}}_h(t^n)\), \(b_i\), \(i=1,\ldots ,r\) are coefficients obtained from the Butcher tableau, and the stage variables \({{\mathbf {\mathsf{{{K}}}}}}_i\) are computed as follows: for the given solution \({{\mathbf {\mathsf{{{U}}}}}}_h^n\) and the viscosity vector \({\varvec{\mu }}_h^n:={\varvec{\mu }}_h(t^n)\) at time level \(t^n\), set \({{\mathbf {\mathsf{{{W}}}}}}_0:= {{\mathbf {\mathsf{{{U}}}}}}_h^n\), then let \({{\mathbf {\mathsf{{{W}}}}}}_l\) be the solution at the lth stage of the RungeKutta method, then compute \({{\mathbf {\mathsf{{{K}}}}}}_l\) by solving the following system:
for all \(l=0,\ldots , r\). Note that the viscosity coefficients can also be computed on the fly at every RungeKutta stage. However, in this work, the viscosity coefficient is constructed from the previous time level and does not change within the RungeKutta stages.
The timestep \(\tau _n\) is computed adaptively using a CFL condition
4.6 Boundary Conditions
In the following numerical examples we use the following boundary conditions: Dirichlet, Neumann, periodic, and slip or an impermeability boundary condition. The Neumann boundary condition is implemented as an additional boundary integral in the variational form. The periodic boundary condition is implemented by enforcing the same value of degrees of freedom (DOF) of matching nodes on two opposite boundaries in question.
The Dirichlet and slip boundary conditions are imposed strongly as a correction step after the RungeKutta method is applied. Assume that we want to compute solution at time level \(t^{n+1}\), \({{\mathbf {\mathsf{{{U}}}}}}_h^{n+1}\), we impose the Dirichlet boundary condition by setting the values of the solution on the boundary nodes \({\varvec{N}}_j\) by its boundary data.
The slip or an impermeability boundary condition requires \({\varvec{u}}_h^{n+1} {\cdot }{\varvec{n}}= 0\) on the boundary in question. This condition is equivalent to \({\varvec{m}}_h^{n+1} {\cdot }{\varvec{n}}= 0\). Then, the boundary value of momentum at the boundary node \({\varvec{N}}_j\), \({\varvec{m}}_h^{n+1}({\varvec{N}}_j)\) is replaced by \({\varvec{m}}_h^{n+1}({\varvec{N}}_j)  {\varvec{m}}_h^{n+1}({\varvec{N}}_j) {\cdot }{\varvec{n}}\).
We refer the reader to [25], where advantages of the strong implementation of the slip boundary condition versus its weak counterpart are discussed, and we refer to [37], where the correction technique is discussed for explicit schemes in more detail.
4.7 Summary of the Algorithm
To summarize, our stabilized finite element solution of the MHD system (3.1) can be obtained by the following steps. In each time step, the solution is advanced as

1.
Calculate the residual using (4.9), combine the low order and high order viscosity to calculate the amount of artificial viscosity using (4.10).

2.
Solve the main linear system (4.5) where the time derivative is discretized using a RungeKutta method (4.11) of order at least \(k+1\).

3.
If the projection method or the pseudo timestepping method is used for cleaning divergence of \({\varvec{B}}_h\), use the techniques described in Sect. 3.2.1. If the hyperbolic correction method in Sect. 3.2.2 is used, divergence cleaning is already incorporated into the system in the previous step.

4.
Apply boundary conditions strongly as described in Sect. 4.6.

5.
Compute an approximation of the maximum local velocity using (3.6), and identify the next time step size using (4.12).
5 Numerical Examples
In this section, we demonstrate the efficiency of our proposed stabilization method on several wellknown benchmark problems. For the following tests, the residual viscosity parameters are \(C_{\max } = 0.5, C_R = 1.0, C_l = 0.4\). We observe that the parameter \(C_l\) is not sensitive as in most circumstances, apart from enhanced smoothness at sharp shocks, any choice of \(C_l\in (0,1)\) would give satisfactory outcomes. We have used the classical RungeKutta 4 for all the tests with time step (4.12), where the CFL number is chosen to be 0.3. In all simulations below, we use \(Pr=1\), and the rest of viscosity coefficients are computed as in Sect. 4.4.
5.1 Accuracy Test
The first two test problems where an analytic solution can be derived are presented to show the high order property of the stabilization in the smooth regions.
5.1.1 Smooth Vortex Problem, [45]
Consider a periodic smooth vortex problem on a rectangle domain \(\Omega \!=\! {(10, 10) \!\times \! (10, 10)}\). The reference solution is a stationary flow with a vortex perturbation
where
the vortex radius is \(r=\sqrt{r_1^2+r_2^2}\), \((r_1,r_2)=(x,y){\varvec{u}}_0t\), and the vortex strength is \(\mu =5.389489439\). The adiabatic constant is \(\gamma =\frac{5}{3}\). The errors measured at final time \({\widehat{t}}=0.05\) using \({{\mathbb {P}}}_1, {{\mathbb {P}}}_2, {{\mathbb {P}}}_3\) elements are shown in Table 1. In Table 1, we show behavior of both the Galerkin solutions and the RV solutions. For the \({{\mathbb {P}}}_2\) solution, the obtained error is lower than that of the \({{\mathbb {P}}}_1\) solution under the same number of degrees of freedom. However, the convergence rate of the \({{\mathbb {P}}}_2\) is second order, which is suboptimal with regards to theoretical derivations. This is a known issue with continuous Galerkin approximations, which was earlier reported in, e.g., [25]. An analysis of the suboptimal convergence for evenorder CG schemes can be found in [50]. Figure 1 illustrates and compares the convergence history between the Galerkin solutions and the RV solutions. All the obtained convergence rates show that the RV method does not destroy highorder accuracy of the Galerkin smooth solutions.
5.1.2 Smooth Wave Propagation, [45]
In this test case, we consider a rectangle domain \(\Omega = {(0, 2\pi ) \times (0, 2\pi )}\). A periodic wavelike solution reads \((\rho (t), {\varvec{u}}(t), p(t), {\varvec{B}}(t))\) \(=\) \((1+0.99\sin (x+y2t),(1,1),1,(0.1,0.1))\). The adiabatic constant is \(\gamma =1.4\). The errors measured at final time \({\widehat{t}}=0.1\) using \({{\mathbb {P}}}_1, {{\mathbb {P}}}_2, {{\mathbb {P}}}_3\) elements are shown in Table 2. Again, the obtained convergence orders of the corresponding Galerkin approximations remains unchanged when the artificial viscosity term is added.
5.2 BrioWu MHD Shock Tube Problem, [3]
The RV method shows highorder accuracy for smooth problems considered in above. Now, we start solving problems with strong shocks and discontinuities.
We want to solve the onedimensional BrioWu MHD shock tube problem, which was first introduced by [3]. This is the onedimensional Riemann problem in the domain \(\Omega = {(0, 1)}\). The problem is challenging because the solution contains waves of different types, typical for an ideal MHD.
The problem setting is the following:
The adiabatic constant is \(\gamma =2\). The importance of this test is to examine whether a MHD solver can represent the shocks, rarefactions, contact lines, and the whole compound structure accurately. The solution at the final time \({\hat{t}} = 0.2\) is shown in Fig. 2. A wellknown reference solution is provided by the Athena code [51] with 10000 grid points.
The result in Fig. 2 shows that our proposed method can capture the wave structures efficiently and accurately. We also see that \({{\mathbb {P}}}_3\) solution is sharper than \({{\mathbb {P}}}_1\) for the same number of degrees of freedom.
5.3 2D OrszagTang problem, [52]
In this section, we consider the wellknown benchmark OrszagTang problem in 2D. The considered domain is a square, \(\Omega = {(0,1) \times (0,1)}\). The solution is initialized as
The adiabatic constant for this problem is \(\gamma =\frac{5}{3}\). The periodic boundary condition is used in both directions. For divergence cleaning, we have used the projection method. The density solution \(\rho _h\) and the artificial viscosity \(\mu _h\) at time \(t = 0.5\) and \(t=1.0\) are shown in Fig. 3 using \({{\mathbb {P}}}_1\) elements, and in Fig. 4 using \({{\mathbb {P}}}_3\) elements. At \(t=1.0\), the structure of the OrszagTang solution is considered turbulence [40].
Despite being a classical benchmark in studies of numerical schemes for MHD, the evolution of the OrszagTang solution after \(t=0.5\) has rarely been reported or discussed in the literature. For the sake of the readers, we note that the time scale can be different in some other papers. For example, in [41], the solution at \(t=3.14\) approximately corresponds to our solution at \(t=0.5\). The authors in [53] pointed out that for short integration in time, whether or not a divergence cleaning procedure is involved does not affect the OrszagTang solution as there is no noticeable difference. We also observe this situation in our continuous finite element simulation both visually and numerically, at least up to \(t=0.5\). In fact, it is evident that the OrszagTang solution up to \(t=0.5\) is relatively straightforward to be obtained by numerical schemes with shockcapturing capability, e.g., [41, 53, 54]. However, long time integration would discriminate different discretizations, as remarked by [54]. Using DG method, the authors in [54] reported that not all choices of the slope limiters and discretizations of the Powell term [4] would work well after \(t = 0.5\). The authors also identified that specifically at \(0.75 \le t \le 0.85\), numerical solutions are prone to divergence blowups due to complex shock collisions.
For this test case, we use the FE setup same to all other test cases without changing any parameter. All the shocks are captured locally and accurately by the RV method. This could be a motivation of using entropy viscosity methods, or in particular RV methods, for shockcapturing purposes. Under the same number of degrees of freedom, the \({{\mathbb {P}}}_3\) solution reveals more structural details of the shocks and turbulence. Similar to the reference [54] using a thirdorder DG scheme, we capture a twisting density upsurge in the centre of the domain using \({{\mathbb {P}}}_3\) Lagrange elements.
We discuss the effect of different divergence cleaning techniques in the finite element settings in the remaining of this section.
5.3.1 Numerical Comparison of the Divergence Cleaning Techniques
We show the absolute divergence error \(\int _{\Omega }\vert \nabla {\cdot \,}{\varvec{B}}_h\vert \,\mathrm {d}x\) of the OrszagTang test as a function of time using different divergence cleaning techniques in Fig. 5. The simulation uses \({{\mathbb {P}}}_1\) elements on a \(40\times 40\) right triangulation mesh. We note that if a sufficiently fine mesh was used, the reference simulation without divergence cleaning would break at some time around \(t=0.7\) due to large divergence error. The figure shows that our method works well with some of the most wellknown divergence cleaning techniques in MHD. The divergence error remains small with the use of the projection method, pseudo timestepping method, and hyperbolic method for divergence cleaning. Among the methods, the pseudo timestepping method with 10 pseudo iterations performs the best. However, the method is the most expensive because 10 pseudo iterations need to be computed in each time step. The projection method is more expensive than the hyperbolic cleaning method because a Poisson equation needs to be solved in each time step. The obtained behavior of the divergence error agrees with the reported results, e.g., [40, 43]. We hereby conclude that the investigated divergence cleaning techniques incorporates well with our shockcapturing method, in which the divergence error remains controlled over long time simulation.
5.4 3D OrszagTang Problem, [55]
The 3D OrszagTang problem is extended from the 2D OrszagTang problem in Sect. 5.3. The domain is a unit cube \(\Omega = {(0,1)\times (0,1)\times (0,1)}\). Essentially, density and pressure are identical to the 2D problem, independent of the zcoordinate. The velocity and magnetic field are also identical in the x and y directions, but zero in the zdirection,
We then add a small perturbation to the velocity, similar to [55],
where the perturbation parameter \(\epsilon _p\) is a small real number. We set \(\epsilon _p = 0.2\) same to [55]. The initial solution can be written as
The adiabatic constant is kept same to the 2D problem, \(\gamma =\frac{5}{3}\). All boundaries are periodic. We use the projection method to clean the divergence. The CFL number is 0.3. A \({{\mathbb {P}}}_3\) solution of the 3D OrszagTang problem is shown in Fig. 6. We stop the simulation at \(t=0.5\) to make the density plot in Fig. 6(a) directly comparable with [55]. The density cut \(z=0\) presents the highly recognizable 2D OrszagTang solution. Along the zaxis, the solution agrees well with the reported results in [55]. A quarter of the solution is hidden to reveal some of the inside structures. We see that the RV method can capture the shocks efficiently in 3D with the same finite element setup in 1D and 2D. We omit the discussion of divergence error in 3D as the purpose of this paper is to develop accurate shockcapturing techniques for finite element approximations.
5.5 MHD Rotor, [6]
The final benchmark we present is the rotor problem, first introduced in [6]. This problem is referred to as the “first rotor problem” in [41]. The initial solution is a disc being placed in the central of the domain \(\Omega = {(0,1) \times (0,1)}\). The ambient solution is a stationary medium at ten times lesser density along a homogeneous magnetic field,
Let r be the radius of the disc centered at the domain central. The disc is defined as
where \(f = (r_1r)/(r_1r_0)\), the inner radius \(r_0 = 0.1\) and the outer radius \(r_1 = 0.115\). The adiabatic constant is \(\gamma =1.4\). Due to imbalance in the centrifugal force, the disc is rotated as it proceeds in time, generating a twisting moment in the magnetic field. The difficulties of this test include: (i) resolving the torsional Alfvén waves, and (ii) during the rotation, the pressure can get close to zero which is challenging for numerical methods. [41] reported that many schemes fail to solve this problem owing to negative pressure. Our density and pressure solution at \(t=0.15\) are plotted in Fig. 7. The projection method is used for cleaning the divergence. It can be seen that the signature circle contour lines within the middle of Fig. 7(c) showing the rotational evolution, see e.g., [41], are finely captured.
6 Conclusion
The main purpose of this paper has been to numerically investigate a new viscous regularization of the ideal MHD equations. The proposed viscous regularization is inspired by the work of [48] on the Euler equations combining with the elliptic terms of the resistive MHD equations. The discretization consists of a highorder residualbased viscosity finite element method in space and the classical explicit RungeKuta methods in time. The results have shown that the proposed method can capture different structures of MHD discontinuities while achieving highorder accuracy, experimented up to fourthorder, in shockfree regions.
Future extensions of this paper may concern continuous analysis of the proposed viscous flux regarding e.g., positivitypreserving properties, Galilean invariance, and entropy principles. Discrete invariantdomain preserving schemes can be built upon such continuous properties using, for instance, the viscous operator by [56].
Data availability
Data sharing not applicable to this article as no datasets were generated or analysed during the current study.
References
Lax, P.D.: Weak solutions of nonlinear hyperbolic equations and their numerical computation. Comm. Pure Appl. Math. 7, 159–193 (1954). https://doi.org/10.1002/cpa.3160070112
Brackbill, J.U.: Numerical magnetohydrodynamics for highbeta plasmas. Meth. Comput. Phys. 16, 1–39 (1976). https://doi.org/10.1016/B9780124608160.500063
Brio, M., Wu, C.C.: An upwind differencing scheme for the equations of ideal magnetohydrodynamics. J. Comput. Phys. 75(2), 400–422 (1988). https://doi.org/10.1016/00219991(88)901209
Powell, K.G., Roe, P.L., Linde, T.J., Gombosi, T.I., De Zeeuw, D.L.: A solutionadaptive upwind scheme for ideal magnetohydrodynamics. J. Comput. Phys. 154(2), 284–309 (1999). https://doi.org/10.1006/jcph.1999.6299
Dai, W., Woodward, P.R.: A simple finite difference scheme for multidimensional magnetohydrodynamical equations. J. Comput. Phys. 142(2), 331–369 (1998). https://doi.org/10.1006/jcph.1998.5944
Balsara, D.S., Spicer, D.S.: A staggered mesh algorithm using high order Godunov fluxes to ensure solenoidal magnetic fields in magnetohydrodynamic simulations. J. Comput. Phys. 149(2), 270–292 (1999). https://doi.org/10.1006/jcph.1998.6153
Bouchut, F., Klingenberg, C., Waagan, K.: A multiwave approximate Riemann solver for ideal MHD based on relaxation. I. Theoretical framework. Numer. Math. 108(1), 7–42 (2007). https://doi.org/10.1007/s0021100701088
Balsara, D.S.: Multidimensional HLLE Riemann solver: application to Euler and magnetohydrodynamic flows. J. Comput. Phys. 229(6), 1970–1993 (2010). https://doi.org/10.1016/j.jcp.2009.11.018
Balsara, D.S., Dumbser, M., Abgrall, R.: Multidimensional HLLC Riemann solver for unstructured meshes–with application to Euler and MHD flows. J. Comput. Phys. 261, 172–208 (2014). https://doi.org/10.1016/j.jcp.2013.12.029
Warburton, T.C., Karniadakis, G.E.: A discontinuous Galerkin method for the viscous MHD equations. J. Comput. Phys. 152(2), 608–641 (1999). https://doi.org/10.1006/jcph.1999.6248
Li, F., Shu, C.W.: Locally divergencefree discontinuous Galerkin methods for MHD equations. J. Sci. Comput. 22(23), 413–442 (2005). https://doi.org/10.1007/s1091500441464
Dumbser, M., Loubère, R.: A simple robust and accurate a posteriori subcell finite volume limiter for the discontinuous Galerkin method on unstructured meshes. J. Comput. Phys. 319, 163–199 (2016). https://doi.org/10.1016/j.jcp.2016.05.002
Torrilhon, M.: Exact solver and uniqueness conditions for riemann problems of ideal magnetohydrodynamics. Tech. rep., Zurich: Seminar for Applied Mathematics, ETH (2002)
Balbás, J., Tadmor, E., Wu, C.C., Wu, C.C.: Nonoscillatory central schemes for one and twodimensional MHD equations. I. J. Comput. Phys. 201(1), 261–285 (2004). https://doi.org/10.1016/j.jcp.2004.05.020
Li, F., Xu, L., Yakovlev, S.: Central discontinuous Galerkin methods for ideal MHD equations with the exactly divergencefree magnetic field. J. Comput. Phys. 230(12), 4828–4847 (2011). https://doi.org/10.1016/j.jcp.2011.03.006
Cheng, Y., Li, F., Qiu, J., Xu, L.: Positivitypreserving DG and central DG methods for ideal MHD equations. J. Comput. Phys. 238, 255–280 (2013). https://doi.org/10.1016/j.jcp.2012.12.019
Szepessy, A.: Convergence of a shockcapturing streamline diffusion finite element method for a scalar conservation law in two space dimensions. Math. Comp. 53(188), 527–545 (1989). https://doi.org/10.2307/2008718
Johnson, C., Szepessy, A., Hansbo, P.: On the convergence of shockcapturing streamline diffusion finite element methods for hyperbolic conservation laws. Math. Comp. 54(189), 107–129 (1990). https://doi.org/10.2307/2008684
Badia, S., Codina, R., Planas, R.: On an unconditionally convergent stabilized finite element approximation of resistive magnetohydrodynamics. J. Comput. Phys. 234, 399–416 (2013). https://doi.org/10.1016/j.jcp.2012.09.031
Sitaraman, H., Raja, L.L.: A matrix free implicit scheme for solution of resistive magnetohydrodynamics equations on unstructured grids. J. Comput. Phys. 251, 364–382 (2013). https://doi.org/10.1016/j.jcp.2013.06.003
Shadid, J.N., Pawlowski, R.P., Cyr, E.C., Tuminaro, R.S., Chacón, L., Weber, P.D.: Scalable implicit incompressible resistive MHD with stabilized FE and fullycoupled NewtonKrylovAMG. Comput. Methods Appl. Mech. Engrg. 304, 1–25 (2016). https://doi.org/10.1016/j.cma.2016.01.019
Guermond, J.L., Pasquetti, R.: Entropybased nonlinear viscosity for Fourier approximations of conservation laws. C. R. Math. Acad. Sci. Paris 346(13–14), 801–806 (2008). https://doi.org/10.1016/j.crma.2008.05.013
Guermond, J.L., Pasqueti, R., Popov, B.: Entropy viscosity method for nonlinear conservation laws. J. Comput. Phys. 230(11), 4248–4267 (2011)
Guermond, J.L., Nazarov, M., Popov, B.: Implementation of the entropy viscosity method. Tech. Rep. 4015, KTH, Numerical Analysis, NA (2011). QC 20110720
Nazarov, M., Larcher, A.: Numerical investigation of a viscous regularization of the Euler equations by entropy viscosity. Comput. Methods Appl. Mech. Engrg. 317, 128–152 (2017)
Nazarov, M.: Convergence of a residual based artificial viscosity finite element method. Comput. Math. Appl. 65(4), 616–626 (2013). https://doi.org/10.1016/j.camwa.2012.11.003
Nazarov, M., Hoffman, J.: Residualbased artificial viscosity for simulation of turbulent compressible flow using adaptive finite element methods. Internat. J. Numer. Methods Fluids 71(3), 339–357 (2013). https://doi.org/10.1002/fld.3663
Marras, S., Nazarov, M., Giraldo, F.X.: Stabilized highorder Galerkin methods based on a parameterfree dynamic SGS model for LES. J. Comput. Phys. 301, 77–101 (2015). https://doi.org/10.1016/j.jcp.2015.07.034
Lu, L., Nazarov, M., Fischer, P.: Nonlinear artificial viscosity for spectral element methods. C. R. Math. Acad. Sci. Paris 357(7), 646–654 (2019). https://doi.org/10.1016/j.crma.2019.07.006
Stiernström, V., Lundgren, L., Nazarov, M., Mattsson, K.: A residualbased artificial viscosity finite difference method for scalar conservation laws. J. Comput. Phys. 430, 110,100 (2021). https://doi.org/10.1016/j.jcp.2020.110100. https://www.sciencedirect.com/science/article/pii/S0021999120308743
Tominec, I., Nazarov, M.: Residual viscosity stabilized rbffd methods for solving nonlinear conservation laws (2021)
Basting, M., Kuzmin, D.: An FCT finite element scheme for ideal MHD equations in 1D and 2D. J. Comput. Phys. 338, 585–605 (2017). https://doi.org/10.1016/j.jcp.2017.02.051
Kuzmin, D., Klyushnev, N.: Limiting and divergence cleaning for continuous finite element discretizations of the MHD equations. J. Comput. Phys. 407, 109230 (2020). https://doi.org/10.1016/j.jcp.2020.109230. (18)
Mabuza, S., Shadid, J.N., Cyr, E.C., Pawlowski, R.P., Kuzmin, D.: A linearity preserving nodal variation limiting algorithm for continuous Galerkin discretization of ideal MHD equations. J. Comput. Phys. 410, 109390 (2020). https://doi.org/10.1016/j.jcp.2020.109390. (28)
Brackbill, J.U., Barnes, D.C.: The effect of nonzero \(\nabla \cdot { B}\) on the numerical solution of the magnetohydrodynamic equations. J. Comput. Phys. 35(3), 426–430 (1980). https://doi.org/10.1016/00219991(80)900790
Dedner, A., Kemm, F., Kröner, D., Munz, C.D., Schnitzer, T., Wesenberg, M.: Hyperbolic divergence cleaning for the MHD equations. J. Comput. Phys. 175(2), 645–673 (2002). https://doi.org/10.1006/jcph.2001.6961
Guermond, J.L., Nazarov, M., Popov, B., Tomas, I.: Secondorder invariant domain preserving approximation of the Euler equations using convex limiting. SIAM J. Sci. Comput. 40(5), A3211–A3239 (2018). https://doi.org/10.1137/17M1149961
Barth, T.J.: In: An introduction to recent developments in theory and numerics for conservation laws (Freiburg/Littenweiler, 1997), Lect. Notes Comput. Sci. Eng., vol. 5, Springer, Berlin, pp. 195–285 (1999). https://doi.org/10.1007/9783642585357_5
Rossmanith, J.A.: An unstaggered, highresolution constrained transport method for magnetohydrodynamic flows. SIAM J. Sci. Comput. 28(5), 1766–1797 (2006). https://doi.org/10.1137/050627022
Tricco, T.S., Price, D.J., Bate, M.R.: Constrained hyperbolic divergence cleaning in smoothed particle magnetohydrodynamics with variable cleaning speeds. J. Comput. Phys. 322, 326–344 (2016). https://doi.org/10.1016/j.jcp.2016.06.053
Tóth, G.: The \(\nabla \cdot B=0\) constraint in shockcapturing magnetohydrodynamics codes. J. Comput. Phys. 161(2), 605–652 (2000). https://doi.org/10.1006/jcph.2000.6519
Hayashi, K.: Magnetohydrodynamic simulations of the solar corona and solar wind using a boundary treatment to limit solar wind mass flux. Astrophys. J., Suppl. Ser. 161(2), 480 (2005). https://doi.org/10.1086/491791
Derigs, D., Winters, A.R., Gassner, G.J., Walch, S., Bohm, M.: Ideal GLMMHD: about the entropy consistent ninewave magnetic field divergence diminishing ideal magnetohydrodynamics equations. J. Comput. Phys. 364, 420–467 (2018). https://doi.org/10.1016/j.jcp.2018.03.002
Sjögreen, B., Yee, H.C., Kotov, D., Kritsuk, A.G.: Skewsymmetric splitting for multiscale gas dynamics and MHD turbulence flows. J. Sci. Comput. 83(3), 40 (2020). https://doi.org/10.1007/s1091502001225w. (Paper No. 43)
Wu, K., Shu, C.W.: A provably positive discontinuous Galerkin method for multidimensional ideal magnetohydrodynamics. SIAM J. Sci. Comput. 40(5), B1302–B1329 (2018). https://doi.org/10.1137/18M1168042
Logg, A., Mardal, K.A., Wells, G.N. (Eds.), Automated solution of differential equations by the finite element method, Lecture Notes in Computational Science and Engineering, vol. 84, Springer, Heidelberg, pp. xiv+723 (2012). https://doi.org/10.1007/9783642230998. The FEniCS book
Dumbser, M., Balsara, D.S.: Highorder unstructured onestep \(P_NP_M\) schemes for the viscous and resistive MHD equations. CMES Comput. Model. Eng. Sci. 54(3), 301–333 (2009)
Guermond, J.L., Popov, B.: Viscous regularization of the Euler equations and entropy principles. SIAM J. Appl. Math. 74(2), 284–305 (2014). https://doi.org/10.1137/120903312
Guermond, J.L., Popov, B.: Invariant domains and firstorder continuous finite element approximation for hyperbolic systems. SIAM J. Numer. Anal. 54(4), 2466–2489 (2016). https://doi.org/10.1137/16M1074291
Ainsworth, M.: Dispersive behaviour of high order finite element schemes for the oneway wave equation. J. Comput. Phys. 259, 1–10 (2014). https://doi.org/10.1016/j.jcp.2013.11.003
Stone, J.M., Gardiner, T.A., Teuben, P., Hawley, J.F., Simon, J.B.: Athena: a new code for astrophysical mhd. Astrophys. J., Suppl. Ser. 178(1), 137 (2008)
Orszag, S.A., Tang, C.M.: Smallscale structure of twodimensional magnetohydrodynamic turbulence. J. Fluid Mech. 90(1), 129–143 (1979). https://doi.org/10.1017/S002211207900210X
Balsara, D.S.: Total variation diminishing scheme for adiabatic and isothermal magnetohydrodynamics. Astrophys. J., Suppl. Ser. 116(1), 133 (1998). https://doi.org/10.1086/313093
Guillet, T., Pakmor, R., Springel, V., Chandrashekar, P., Klingenberg, C.: Highorder magnetohydrodynamics for astrophysics with an adaptive mesh refinement discontinuous galerkin scheme. Mon. Notices Royal Astron. Soc. 485(3), 4209–4246 (2019)
Helzel, C., Rossmanith, J.A., Taetz, B.: An unstaggered constrained transport method for the 3D ideal magnetohydrodynamic equations. J. Comput. Phys. 230(10), 3803–3829 (2011). https://doi.org/10.1016/j.jcp.2011.02.009
Guermond, J.L., Nazarov, M.: A maximumprinciple preserving \(C^0\) finite element method for scalar conservation equations. Comput. Methods Appl. Mech. Engrg. 272, 198–213 (2014). https://doi.org/10.1016/j.cma.2013.12.015
Acknowledgements
Some computations were performed on UPPMAX provided by the Swedish National Infrastructure for Computing (SNIC) under project number SNIC 2021/22233.
Funding
Open access funding provided by Uppsala University. This research is funded by Swedish Research Council (VR) under grant number 202104620.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Competing interests
The authors have no conflicts of interest to disclose.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Dao, T.A., Nazarov, M. A HighOrder ResidualBased Viscosity Finite Element Method for the Ideal MHD Equations. J Sci Comput 92, 77 (2022). https://doi.org/10.1007/s10915022019184
Received:
Revised:
Accepted:
Published:
DOI: https://doi.org/10.1007/s10915022019184
Keywords
 MHD
 Stabilized finite element method
 Artificial viscosity
 Residual based shockcapturing
 High order method