FV_WENO_MHD_RMHD_PCP.pdf
Introduction
It is possible to claim that astrophysicists played a major role in the invention of higher order Godunov schemes [67 , 35 , 68 ] . This was done with the express intent of inventing robust and accurate schemes for astrophysical hydrodynamics. These second order accurate methods were popular because they were based on three simple algorithmic elements:- First, one had to reconstruct the primal variables of the flow in order to get second, or better, order of spatial accuracy. Second, one had to invoke a Riemann solver for which knowledge of the eigenstructure could be beneficial. Third, one used a predictor-corrector [67 , 35 , 36 ] or Runge-Kutta [62 ] timestepping strategy to obtain second or better order accuracy in time. This winning plan was easy to adopt, resulting in the popularity of the above-mentioned papers for astrophysical hydrodynamics.
Owing to the presence of magnetic fields in astrophysical flows, it was only natural that astrophysicists wanted to invent higher order Godunov methods for magnetohydrodynamic (MHD) flows. Initial progress on understanding the MHD eigenstructure [49 , 31 , 72 , 59 , 58 ] was soon followed by the development of Riemann solvers for MHD [34 , 4 , 5 , 45 , 57 ] (Li 2005). Inspired by the divergence-free discretizations of Yee (1966), and later on Brecht et al. (1981), DeVore (1991) and Evans and Hawley (1989), higher order Godunov schemes were designed which mimetically respected the divergence-free property of the magnetic field [37 , 60 , 6 ] . In time, higher order methods were developed for reconstructing the magnetic field in divergence-free fashion and with higher order accuracy [9 , 11 , 12 , 13 , 17 , 23 , 24 ] which allowed higher order MHD formulations to be achieved. The task of obtaining truly multidimensionally upwinded electric fields at edge centers that are needed for updating face-centered magnetic fields was also accomplished with the invention of multidimensional Riemann solvers [14 , 15 , 18 , 19 , 22 ] . Relativistic magnetohydrodynamics (RMHD) also plays an important role in computational astrophysics, with the result that many of these advances in MHD were paralleled in a few years by analogous advances in RMHD [52 , 10 , 43 , 38 , 66 Mignone et] al. 2006, 2009, Giacomazzo and Rezzolla 2006, Anton et al. 2010, Kim and Balsara, 2014, Balsara and Kim 2016, Cai et al. 2025) and several others.
Advances were also made in high accuracy methods (Harten et al. 1986, Shu and Osher 1988, 1989, Jiang and Shu 1996, Balsara and Shu 2000, Balsara, Garain and Shu 2016, Balsara et al. 2023, 2024a, 2024b, 2025), especially focusing on weighted essentially non-oscillatory (WENO) schemes but also including other efforts (McCorquodale and Colella 2013, Buchmüller et al. 2014). Those efforts at achieving higher order hydrodynamics also inspired an attempt to achieve higher order MHD and RMHD (Balsara 2009, Balsara et al. 2009, 2013, Seo and Ryu 2023, Balsara et al. 2025). However, astrophysical flows tend to have unusually large Mach numbers, exceptionally high Lorentz factors and very strong magnetic fields. These two effects tend to drive astrophysical flows to the point where pressures can become catastrophically negative resulting in a code crash. This has been the most pressing problem in computational astrophysics and space physics . Simply increasing the order of accuracy of an astrophysical code does not yield a solution to this problem. There were several early attempts to address this issue (Balsara and Spicer 1999b, Hu, Adams and Shu 2012, Balsara 2012b). A very early paper (Einfeldt et al. 1991) had shown that with the use of certain Riemann solvers of HLL (Harten Lax van Leer) and LLF (Local Lax Friedrich) type, positivity could be achieved in hydrodynamical simulations with first order schemes, however those results were not picked up or generalized for quite a while. In recent years, there has been an effort to generalize those results within the context of physical constraint preserving (PCP) methods (Wu and Shu 2018, 2020, Bhoriya et al. 2025, Balsara et al. 2025). Since higher order finite volume schemes which preserve the divergence of the magnetic field exactly are gaining popularity in computational astrophysics and space physics, the twin goals of this paper are:- 1) to show how one can formulate PCP schemes for divergence-free MHD and RMHD and 2) to also to show how this can be done for higher order finite volume schemes . This also provides us with an opportunity to show the simplicity of multidimensional Riemann solvers for MHD and RMHD as they have been formulated in the recent literature on finite difference schemes (Balsara et al. 2025), and how these should be extended to finite volume schemes. For the sake of completeness, it is also worth pointing out that finite difference WENO-based PCP schemes for divergence-free MHD and RMHD that go up to ninth order of accuracy have already been documented in Balsara et al. (2025). This paper, therefore, shows how those advances are to be extended to finite volume WENO-based schemes for divergence-free MHD and RMHD. This proves to be an entirely non-trivial extension because there are many design choices that apply to finite difference schemes that do not apply to finite volume schemes and vice versa.
The plan of this paper is as follows. Section 2 describes the systems of interest and their higher order spatial and temporal update. In Section 3 we provide a very brief synopsis of the recent multidimensional Riemann solver from Balsara et al. [28 ] which plays a key role in the design of PCP schemes. In Section 4 we describe a baseline higher order finite volume scheme. This is useful because it gives us the essential structure on which the PCP ideas can be engrafted. In Section 5 we describe a low order scheme that is PCP and we also describe how it can be non-linearly hybridized with the higher order scheme to yield a method that is always PCP. Section 6 provides a step-by-step description of the PCP method described here. Section 7 shows that our methods meet their design accuracies. Section 8 focuses on extreme test problems, i.e. the type of test problem that cannot be done by a normal higher order Godunov scheme except by use of the PCP methods described here. Section 9 offers some conclusions.
The MHD and RMHD Systems in Computational Astrophysics
In this Section we very quickly describe the MHD and RMHD systems that are of interest in computational astrophysics. While we show the equations in their 2D forms just to save space; the implementation is fully 3D.
The MHD system for an ideal fluid can be written in a conservation form as
∂ ∂ t ( ρ ρ v x ρ v y ρ v z ϵ B x B y B z ) + ∂ ∂ x ( ρ v x ρ v x 2 + p + B 2 / 8 π − B x 2 / 4 π ρ v x v y − B x B y / 4 π ρ v x v z − B x B z / 4 π ( ϵ + p + B 2 / 8 π ) v x − B x ( v ⋅ B ) / 4 π 0 v x B y − v y B x − ( v z B x − v x B z ) ) + ∂ ∂ y ( ρ v y ρ v y v x − B y B x / 4 π ρ v y 2 + p + B 2 / 8 π − B y 2 / 4 π ρ v y v z − B y B z / 4 π ( ϵ + p + B 2 / 8 π ) v y − B y ( v ⋅ B ) / 4 π − ( v x B y − v y B x ) 0 v y B z − v z B y ) = 0 (1) \frac{\partial}{\partial t}
\begin{pmatrix}
\rho\\
\rho v_x \\
\rho v_y \\
\rho v_z \\
\epsilon\\
B_x \\
B_y \\
B_z
\end{pmatrix}
+
\frac{\partial}{\partial x}
\begin{pmatrix}
\rho v_x \\
\rho v_x^2+p+\mathbf{B}^2/8\pi-B_x^2/4\pi\\
\rho v_xv_y-B_xB_y/4\pi\\
\rho v_xv_z-B_xB_z/4\pi\\
(\epsilon+p+\mathbf{B}^2/8\pi)v_x-B_x(\mathbf{v}\cdot\mathbf{B})/4\pi\\
0 \\
v_xB_y-v_yB_x \\
-(v_zB_x-v_xB_z)
\end{pmatrix}
+
\frac{\partial}{\partial y}
\begin{pmatrix}
\rho v_y \\
\rho v_yv_x-B_yB_x/4\pi\\
\rho v_y^2+p+\mathbf{B}^2/8\pi-B_y^2/4\pi\\
\rho v_yv_z-B_yB_z/4\pi\\
(\epsilon+p+\mathbf{B}^2/8\pi)v_y-B_y(\mathbf{v}\cdot\mathbf{B})/4\pi\\
-(v_xB_y-v_yB_x) \\
0 \\
v_yB_z-v_zB_y
\end{pmatrix}
=0 \tag*{(1)} ∂ t ∂ ρ ρ v x ρ v y ρ v z ϵ B x B y B z + ∂ x ∂ ρ v x ρ v x 2 + p + B 2 /8 π − B x 2 /4 π ρ v x v y − B x B y /4 π ρ v x v z − B x B z /4 π ( ϵ + p + B 2 /8 π ) v x − B x ( v ⋅ B ) /4 π 0 v x B y − v y B x − ( v z B x − v x B z ) + ∂ y ∂ ρ v y ρ v y v x − B y B x /4 π ρ v y 2 + p + B 2 /8 π − B y 2 /4 π ρ v y v z − B y B z /4 π ( ϵ + p + B 2 /8 π ) v y − B y ( v ⋅ B ) /4 π − ( v x B y − v y B x ) 0 v y B z − v z B y = 0 (1)
where ε = ρ v 2 / 2 + p / ( Γ − 1 ) + B 2 / 8 π \varepsilon=\rho v^{2}/2+p/(\Gamma-1)+\mathbf{B}^{2}/8\pi ε = ρ v 2 /2 + p / ( Γ − 1 ) + B 2 /8 π is the total energy density. The density is denoted by ρ \rho ρ ; the pressure is written as “p p p ”; the velocity components are given by v x v_{x} v x , v y v_{y} v y , v z v_{z} v z ; and the magnetic field components by B x B_{x} B x , B y B_{y} B y , B z B_{z} B z . “Γ \Gamma Γ ” denotes the ratio of specific heats. The vector of primitive variables that one seeks to extract from the vector of conserved variables is given by ( ρ , v x , v y , v z , p , B x , B y , B z ) T (\rho,v_{x},v_{y},v_{z},p,B_{x},B_{y},B_{z})^{T} ( ρ , v x , v y , v z , p , B x , B y , B z ) T . The usual challenge in MHD simulations has been that when the velocities or magnetic fields become too large, the pressure can become zero or negative. While co-evolving an entropy evolution equation can help, it also causes a loss of conservation when it is indeed invoked in a given zone.
The RMHD system is given by
∂ ∂ t ( ρ γ m x m y m z ε B x B y B z ) + ∂ ∂ x ( ρ γ v x m x v x + p + b 2 2 − B x b x γ m y v x − B x b y γ m z v x − B x b z γ m x 0 v x B y − v y B x − ( v z B x − v x B z ) ) + ∂ ∂ y ( ρ γ v y m x v y − B y b x γ m y v y + p + b 2 2 − B y b y γ m z v y − B y b z γ m y − ( v x B y − v y B x ) 0 v y B z − v z B y ) = 0 (2) \frac{\partial}{\partial t}
\begin{pmatrix}
\rho\gamma\\
m_x\\
m_y\\
m_z\\
\varepsilon\\
B_x\\
B_y\\
B_z
\end{pmatrix}
+
\frac{\partial}{\partial x}
\begin{pmatrix}
\rho\gamma v_x\\
m_xv_x+p+\frac{\mathbf{b}^{2}}{2}-\frac{B_xb_x}{\gamma}\\
m_yv_x-\frac{B_xb_y}{\gamma}\\
m_zv_x-\frac{B_xb_z}{\gamma}\\
m_x\\
0\\
v_xB_y-v_yB_x\\
-(v_zB_x-v_xB_z)
\end{pmatrix}
+
\frac{\partial}{\partial y}
\begin{pmatrix}
\rho\gamma v_y\\
m_xv_y-\frac{B_yb_x}{\gamma}\\
m_yv_y+p+\frac{\mathbf{b}^{2}}{2}-\frac{B_yb_y}{\gamma}\\
m_zv_y-\frac{B_yb_z}{\gamma}\\
m_y\\
-(v_xB_y-v_yB_x)\\
0\\
v_yB_z-v_zB_y
\end{pmatrix}
=0 \tag*{(2)} ∂ t ∂ ρ γ m x m y m z ε B x B y B z + ∂ x ∂ ρ γ v x m x v x + p + 2 b 2 − γ B x b x m y v x − γ B x b y m z v x − γ B x b z m x 0 v x B y − v y B x − ( v z B x − v x B z ) + ∂ y ∂ ρ γ v y m x v y − γ B y b x m y v y + p + 2 b 2 − γ B y b y m z v y − γ B y b z m y − ( v x B y − v y B x ) 0 v y B z − v z B y = 0 (2)
Here, ρ \rho ρ is the density, γ \gamma γ is the Lorentz factor, set { ε , m x , m y , m z } \{\varepsilon,m_x,m_y,m_z\} { ε , m x , m y , m z } forms the four-momentum density, v = ( v x , v y , v z ) T \mathbf{v}=(v_x,v_y,v_z)^{T} v = ( v x , v y , v z ) T is the 3-velocity vector, p p p is the pressure and B x , B y , B z B_x,B_y,B_z B x , B y , B z are the components of the magnetic field. The speed of light is assumed to be unity; therefore, the Lorentz factor is defined by γ = 1 / 1 − v 2 \gamma=1/\sqrt{1-\mathbf{v}^{2}} γ = 1/ 1 − v 2 . The conserved quantities m i m_i m i and ε \varepsilon ε are given by
m i = ( ρ h γ 2 + B 2 ) v i − ( v ⋅ B ) B i ; ε = ρ h γ 2 − p + B 2 2 + v 2 B 2 − ( v ⋅ B ) 2 2 (3) m_i=\left(\rho h\gamma^{2}+\mathbf{B}^{2}\right)v_i-(\mathbf{v}\cdot\mathbf{B})B_i\ ;\qquad\varepsilon=\rho h\gamma^{2}-p+\frac{\mathbf{B}^{2}}{2}+\frac{\mathbf{v}^{2}\mathbf{B}^{2}-(\mathbf{v}\cdot\mathbf{B})^{2}}{2} \tag*{(3)} m i = ( ρ h γ 2 + B 2 ) v i − ( v ⋅ B ) B i ; ε = ρ h γ 2 − p + 2 B 2 + 2 v 2 B 2 − ( v ⋅ B ) 2 (3)
where h = 1 + Γ Γ − 1 p ρ h=1+\frac{\Gamma}{\Gamma-1}\frac{p}{\rho} h = 1 + Γ − 1 Γ ρ p is the specific enthalpy and Γ \Gamma Γ denotes the polytropic index. In the above, Latin indices range from 1 to 3. The components and magnitude of the covariant magnetic field are defined as a four vector with 4-components denoted by b μ b_\mu b μ which should indeed be distinguished from the 3-vector B i B_i B i . The 4-vector representation of the magnetic field, b μ b_\mu b μ , and the 3-vector representation of the magnetic field, B i B_i B i , are related by the following relations:-
b μ = γ ( v ⋅ B , B i γ 2 + ( v ⋅ B ) v i ) ; b 2 = B 2 γ 2 + ( v ⋅ B ) 2 (4) b_\mu= \gamma\left( \mathbf{v}\cdot\mathbf{B}, \frac{B_i}{\gamma^2} + (\mathbf{v}\cdot\mathbf{B})v_i \right) \ ; \quad\mathbf{b}^2 = \frac{\mathbf{B}^2}{\gamma^2} + (\mathbf{v}\cdot\mathbf{B})^2 \tag*{(4)} b μ = γ ( v ⋅ B , γ 2 B i + ( v ⋅ B ) v i ) ; b 2 = γ 2 B 2 + ( v ⋅ B ) 2 (4)
Here the Greek indices range from 0 to 3 and the Roman indices range from 1 to 3. Cai et al. [33 ] have presented a provably convergent and robust Newton-Raphson method to extract the primitives from the conservative variables. We use the same strategy here. Despite the guarantee that a physical set of conserved variables will always yield a unique physical set of primitive variables, the RMHD system still poses other problems. As with the MHD system, when the velocities or magnetic fields become too large, the system can produce unphysical pressures. For the RMHD system, this pathology can indeed prevent us from extracting the primitive variables from the system of conserved variables. But there is an even deeper question in RMHD:- What is the optimal choice of primitive variables? It turns out that routine interpolation of certain choices of variables can, for entirely numerical reasons, produce velocities that are superluminal. For that reason, Balsara and Kim [20 ] suggested that the optimal primitive variables should be ( ρ , γ v x , γ v y , γ v z , p , B x , B y , B z ) T (\rho,\gamma v_x,\gamma v_y,\gamma v_z,p,B_x,B_y,B_z)^T ( ρ , γ v x , γ v y , γ v z , p , B x , B y , B z ) T . They showed that using this set of variables for the reconstruction always guarantees that a subluminal velocity can be extracted from the reconstructed polynomial. We make the same choice here. Eqn. (2.4) from Balsara and Kim [20 ] shows that given γ v x , γ v y , γ v z \gamma v_x,\gamma v_y,\gamma v_z γ v x , γ v y , γ v z it is very easy to extract the corresponding subliminal v x , v y , v z v_x,v_y,v_z v x , v y , v z .
It is easy to see that both eqn. (2.1) and eqn. (2.2) are in conservation form. As a result, the update of the conserved variables, i.e. the first five components in those equations, should be in flux-conservative fashion. The magnetic fields in both systems obey Faraday’s law
∂ B ∂ t + ∇ × E = 0. (5) \frac{\partial\mathbf{B}}{\partial t}+\nabla\times\mathbf{E}=0. \tag*{(5)} ∂ t ∂ B + ∇ × E = 0. (5)
Here the electric field vector is given constitutively by E = − v × B \mathbf{E}=-\mathbf{v}\times\mathbf{B} E = − v × B . Eqn. (2.5) satisfies an involution constraint which says that the magnetic field remains divergence-free for all time. It is now traditional in computational astrophysics and space physics to use mimetic discretizations, Yee [71 ] , to ensure that the involution is preserved. Figure 1 shows such a discretization where the facially-averaged magnetic field components are collocated at the face-centers and the edge-averaged electric fields that are used for their update are collocated at the edge-centers. The overbars on the magnetic field components and electric field components in Figure 1 are intended to emphasize their facially-averaged and edge-averaged interpretations respectively.
Figure 1. Most astrophysics and space physics use the Yee discretization shown here. The figure shows that the primal variables of the magnetic field, given by the normal components of the magnetic field, are facially-collocated. The components of the primal magnetic field vector are shown by the thick arrows. The overbars on the magnetic field components indicate that these are facially averaged. They undergo an update from the induction equation. The edge-collocated electric fields, which are used for updating the facial magnetic induction components, are shown by the thin arrows close to the appropriate edge. They too have overbars to indicate that they are edge-averaged. The superscript “num” for the electric field components indicates that they are multidimensionally stabilized and, therefore, suitable for use in a numerical scheme.
It should be emphasized that high order of accuracy is achieved for the conserved variables by using high order reconstruction/interpolation. In recent years, weighted essentially non-oscillatory WENO techniques have become so well developed for reconstructing or interpolating zone-centered variables that they can be used in an almost “off-the-shelf” fashion; see Jiang and Shu [50 ] , Balsara and Shu [8 ] , Balsara, Garain and Shu [21 ] and Balsara Samantaray and Subramanian [24 ] . The fluxes should also be integrated over the faces using high order quadrature; and multidimensional Gaussian quadrature formulae are easy to find on the internet. However, stability of the numerical fluxes is crucially important. It is achieved for the conserved variables only if the numerical flux that is used has a well-designed centered part as well as a part that provides numerical dissipation. Dumbser and Balsara [40 ] have provided one such general purpose Riemann solver that does just that. It has been shown to work well for MHD and RMHD. Many more one-dimensional Riemann solvers for MHD and RMHD have been cited in the Introduction. The one-dimensional Riemann solver in Dumbser and Balsara [40 ] does have one unique advantage which is that it can work with HLLE formulations which were originally shown by Einfeldt et al. [41 ] to be conducive to preserving positivity of pressure.
Higher order WENO-based methods for the reconstruction of magnetic fields are also well-known; see Balsara [12 ] , Balsara et al. [23 ] , Balsara, Samantaray and Subramanian [24 ] . In Balsara, Samantaray and Subramanian (2023) a WENO-based method for the reconstruction of facial vector fields is presented that is referred to as almost divergence preserving (ADP). While it is not exactly divergence-free, it is so up to discretization error and it has the benefit of being very low cost. We use it in this work. Just as the numerical flux needs to have a dissipative component, the electric field that is used for the update of eqn. (5) also needs to have a suitable numerical diffusion. Such multidimensional Riemann solvers have been constructed in Balsara [14 , 15 , 18 ] and Balsara and Nkonga [22 ] . In Balsara et al. [28 ] , a very simple analysis of eqn. (5) has been done which yields a multidimensional Riemann solver. Since it will prove to be very useful in obtaining the PCP property, we will briefly describe it in the next Section.
Recap of the 2D Riemann Solver
Figure 1 shows us that when obtaining the edge-centered electric fields we need a two-dimensional Riemann solver. Focusing on the z-component of the electric field in Figure 1 , we see that it would need to be upwinded in the x- and y-directions. Here we present such a 2D Riemann solver that has multidimensional upwinding. The detailed description is available in Balsara et al. [28 ] but here we provide the reader with just enough detail to understand it at an intuitive level and enough knowledge to use it in a code. We focus only on the sub-system of the MHD/RMHD equations that governs the evolution of the magnetic fields. Eqn. (5) can be written in flux form as:-
∂ ∂ t ( B x B y B z ) + ∂ ∂ x ( 0 − E z E y ) + ∂ ∂ y ( E z 0 − E x ) + ∂ ∂ z ( − E y E x 0 ) = 0 (6) \frac{\partial}{\partial t}
\begin{pmatrix}
B_x \\
B_y \\
B_z
\end{pmatrix}
+
\frac{\partial}{\partial x}
\begin{pmatrix}
0 \\
-E_z \\
E_y
\end{pmatrix}
+
\frac{\partial}{\partial y}
\begin{pmatrix}
E_z \\
0 \\
-E_x
\end{pmatrix}
+
\frac{\partial}{\partial z}
\begin{pmatrix}
-E_y \\
E_x \\
0
\end{pmatrix}
=0 \tag*{(6)} ∂ t ∂ B x B y B z + ∂ x ∂ 0 − E z E y + ∂ y ∂ E z 0 − E x + ∂ z ∂ − E y E x 0 = 0 (6)
In general, eqn. (6) will be a sub-portion of a larger PDE system. We just assume that the electric field is constitutively evaluated using other variables in the larger PDE system. We also assume that by using the information in 1D Riemann solvers at the faces that surround an edge, we can get extremal signal speeds at each edge of the mesh. Both these assumptions hold for MHD and RMHD. Figure 2 shows four zones in the xy-plane that come together at the z-edge of a three-dimensional mesh. Since the mesh is viewed from the top in plan view, the z-edge is shown by the black dot and the four abutting zones are shown as four squares. The four incoming states have subscripts given by “RU” for right-upper; “LU” for left-upper; “LD” for left-down and “RD” for right-down. At each zone-center the z-component of the electric field can be evaluated, with the result that E z R U E_{zRU} E z R U , E z L U E_{zLU} E z LU , E z L D E_{zLD} E z L D and E z R D E_{zRD} E z R D form four of the inputs to the 2D Riemann problem shown in Figure 2 . The normal component of the magnetic field is continuous at the faces of the mesh, with the result that B x D B_{xD} B x D , B x U B_{xU} B xU , B y R B_{yR} B y R and B y L B_{yL} B y L form the other four inputs to the 2D Riemann problem shown in Figure 2 . Using the 1D speeds from the 1D Riemann solvers in the surrounding faces in Figure 2 , we can deduce that the 2D Riemann problem will have an extremal right-going speed given by S R S_R S R ; an extremal left-going speed given by S L S_L S L , an extremal upward-going speed given by S U S_U S U and an extremal down-going speed given by S D S_D S D . We will also have need for the maximal speed given by S = max ( ∣ S R ∣ , ∣ S L ∣ , ∣ S U ∣ , ∣ S D ∣ ) S=\max\left(\lvert S_R\rvert,\lvert S_L\rvert,\lvert S_U\rvert,\lvert S_D\rvert\right) S = max ( ∣ S R ∣ , ∣ S L ∣ , ∣ S U ∣ , ∣ S D ∣ ) when discussing the LLF variant of the 2D Riemann solver that is presented here. These extremal speeds are shown in Figure 3 , and form a 2D wave model for the 2D Riemann solver.
Figure 2. shows four zones in the x y xy x y -plane that come together at the z z z -edge of a three-dimensional mesh. Since the mesh is viewed from the top in plan view, the z z z -edge is shown by the black dot and the four abutting zones are shown as four squares. The four incoming states have subscripts given by “RU” for right-upper; “LU” for left-upper; “LD” for left-down and “RD” for right-down. Figure 2 shows the situation before the states start interacting via four one-dimensional and one multidimensional Riemann problems. The thin oblique arrows indicate that higher-order interpolation can eventually be used to obtain the centered part of the electric field at the z z z -edge. The thick horizontal and vertical arrows denote the normal components of the magnetic field at the zone faces. Owing to the divergence constraint, these field components are continuous across zone faces. They can, therefore, be obtained from the higher order facial reconstruction of the normal component of the magnetic field within each face. This provides higher order values of the x x x - and y y y -components of the magnetic field at the z z z -edge that minimize the dissipation terms.
Figure 3. Figure 3 shows the same situation as in Figure 2 . However, it shows the situation after the four incoming states have interacted with each other. Four one-dimensional Riemann problems, shown by dashed lines, develop between the four pairs of incoming states. The resolved states from the one-dimensional HLL Riemann problems are shown by a superscript with a single star. The shaded region depicts the strongly interacting state that arises when the four one-dimensional Riemann problems interact with one another. The strongly interacting state is shown by a superscript with a double star. We want to find the z z z -component of the electric field in the strongly interacting state. This gives us the z z z -component of the electric field at the z z z -edge, which is shown by the dot in this two-dimensional projection.
Figure 3 shows the same situation as Figure 2 . However, it shows the situation after the four incoming states start interacting with each other. Four one-dimensional Riemann problems, shown by dashed lines, develop between the four pairs of incoming states. The resolved states from the one-dimensional Riemann problems are shown by a superscript with a single star. The shaded region depicts the strongly interacting state that arises when the four one-dimensional Riemann problems interact with one another. The strongly interacting state is shown by a superscript with a double star. We want to find the z-component of the electric field in the strongly interacting state. This gives us the z-component of the electric field that overlies the z-edge, which is shown by the dot in this two-dimensional projection.
In Figure 3 we see two x-directional Riemann problems which produce the states B x U ∗ , B y U ∗ , E z U ∗ B_{xU}^{*}, B_{yU}^{*}, E_{zU}^{*} B xU ∗ , B y U ∗ , E z U ∗ and B x D ∗ , B y D ∗ , E z D ∗ B_{xD}^{*}, B_{yD}^{*}, E_{zD}^{*} B x D ∗ , B y D ∗ , E z D ∗ . Application of the HLL Riemann solver in the x-direction gives us
B x U ∗ = B x U ; B y U ∗ = S R B y R − S L B y L S R − S L + E z R U − E z L U S R − S L ; E z U ∗ = S R E z L U − S L E z R U S R − S L − S R S L ( B y R − B y L ) S R − S L . (7) \begin{aligned}
B_{xU}^{*} &= B_{xU} \ ; \\
B_{yU}^{*} &= \frac{S_R B_{yR}-S_L B_{yL}}{S_R-S_L}+\frac{E_{zRU}-E_{zLU}}{S_R-S_L} \ ; \\
E_{zU}^{*} &= \frac{S_R E_{zLU}-S_L E_{zRU}}{S_R-S_L}-\frac{S_R S_L\left(B_{yR}-B_{yL}\right)}{S_R-S_L} \ . \tag*{(7)}
\end{aligned} B xU ∗ B y U ∗ E z U ∗ = B xU ; = S R − S L S R B y R − S L B y L + S R − S L E z R U − E z LU ; = S R − S L S R E z LU − S L E z R U − S R − S L S R S L ( B y R − B y L ) . (7)
If we also want the LLF variant of the above equation, we get
B x U ∗ = B x U ; B y U ∗ = B y R + B y L 2 + E z R U − E z L U 2 S ; E z U ∗ = E z L U + E z R U 2 + S ( B y R − B y L ) 2 . (8) \begin{aligned}
B_{xU}^{*} &= B_{xU} \ ; \\
B_{yU}^{*} &= \frac{B_{yR}+B_{yL}}{2}+\frac{E_{zRU}-E_{zLU}}{2S} \ ; \\
E_{zU}^{*} &= \frac{E_{zLU}+E_{zRU}}{2}+\frac{S\left(B_{yR}-B_{yL}\right)}{2} \ . \tag*{(8)}
\end{aligned} B xU ∗ B y U ∗ E z U ∗ = B xU ; = 2 B y R + B y L + 2 S E z R U − E z LU ; = 2 E z LU + E z R U + 2 S ( B y R − B y L ) . (8)
To obtain B x D ∗ , B y D ∗ , E z D ∗ B_{xD}^{*}, B_{yD}^{*}, E_{zD}^{*} B x D ∗ , B y D ∗ , E z D ∗ , we just have to set U → D U\to D U → D in the above equations. In Figure 3 we also see two y-directional Riemann problems which produce the states B x R ∗ , B y R ∗ , E z R ∗ B_{xR}^{*}, B_{yR}^{*}, E_{zR}^{*} B x R ∗ , B y R ∗ , E z R ∗ and B x L ∗ , B y L ∗ , E z L ∗ B_{xL}^{*}, B_{yL}^{*}, E_{zL}^{*} B xL ∗ , B y L ∗ , E z L ∗ . Application of the HLL Riemann solver in the y-direction gives us
B x R ∗ = S U B x U − S D B x D S U − S D − E z R U − E z R D S U − S D ; B y R ∗ = B y R (9) B_{xR}^{*}=\frac{S_U B_{xU}-S_D B_{xD}}{S_U-S_D}-\frac{E_{zRU}-E_{zRD}}{S_U-S_D}
\ ;\quad B_{yR}^{*}=B_{yR} \tag*{(9)} B x R ∗ = S U − S D S U B xU − S D B x D − S U − S D E z R U − E z R D ; B y R ∗ = B y R (9)
E z R ∗ = S U E z R D − S D E z R U S U − S D + S U S D ( B x U − B x D ) S U − S D . (10) E_{zR}^{*}=\frac{S_U E_{zRD}-S_D E_{zRU}}{S_U-S_D}+\frac{S_U S_D(B_{xU}-B_{xD})}{S_U-S_D}. \tag*{(10)} E z R ∗ = S U − S D S U E z R D − S D E z R U + S U − S D S U S D ( B xU − B x D ) . (10)
If we also want the LLF variant of the above equation, we get
B x R ∗ = ( B x U + B x D ) / 2 − ( E z R U − E z R D ) / ( 2 S ) ; B y R ∗ = B y R (11) B_{xR}^{*}=(B_{xU}+B_{xD})/2-(E_{zRU}-E_{zRD})/(2S)
\ ;\quad B_{yR}^{*}=B_{yR} \tag*{(11)} B x R ∗ = ( B xU + B x D ) /2 − ( E z R U − E z R D ) / ( 2 S ) ; B y R ∗ = B y R (11)
E z R ∗ = ( E z R D + E z R U ) / 2 − S ( B x U − B x D ) / 2. (12) E_{zR}^{*}=(E_{zRD}+E_{zRU})/2-S(B_{xU}-B_{xD})/2. \tag*{(12)} E z R ∗ = ( E z R D + E z R U ) /2 − S ( B xU − B x D ) /2. (12)
To obtain B x L ∗ B_{xL}^{*} B xL ∗ , B y L ∗ B_{yL}^{*} B y L ∗ , E z L ∗ E_{zL}^{*} E z L ∗ , we have just to set R → L R\rightarrow L R → L in the above two equations. This paragraph has fully described all the states that surround the shaded strongly interacting state in Figure 3 .
Indeed, the shaded strongly interacting state in Figure 3 is the thing that we seek. This state is shown with a double starred superscript in Figure 3 . The theory for 2D and 3D Riemann solvers was invented primarily to give us that state. Using the theory for 2D Riemann solvers that was developed in Balsara [14 , 15 , 18 , 19 ] , we get two options for the resolved strongly interacting state B x ∗ ∗ , B y ∗ ∗ , E z ∗ ∗ B_x^{**}, B_y^{**}, E_z^{**} B x ∗∗ , B y ∗∗ , E z ∗∗ in Figure 3 . The resolved magnetic fields, i.e. B x ∗ ∗ B_x^{**} B x ∗∗ and B y ∗ ∗ B_y^{**} B y ∗∗ , are uniquely given by
B x ∗ ∗ = ( S U B x U − S D B x D ) / ( S U − S D ) + ( E z L D − E z L U + E z R D − E z R U ) / ( 2 ( S U − S D ) ) (13) B_x^{**}=(S_U B_{xU}-S_D B_{xD})/(S_U-S_D)+(E_{zLD}-E_{zLU}+E_{zRD}-E_{zRU})/(2(S_U-S_D)) \tag*{(13)} B x ∗∗ = ( S U B xU − S D B x D ) / ( S U − S D ) + ( E z L D − E z LU + E z R D − E z R U ) / ( 2 ( S U − S D )) (13)
B y ∗ ∗ = ( S R B y R − S L B y L ) / ( S R − S L ) + ( − E z L D − E z L U + E z R D + E z R U ) / ( 2 ( S R − S L ) ) (14) B_y^{**}=(S_R B_{yR}-S_L B_{yL})/(S_R-S_L)+(-E_{zLD}-E_{zLU}+E_{zRD}+E_{zRU})/(2(S_R-S_L)) \tag*{(14)} B y ∗∗ = ( S R B y R − S L B y L ) / ( S R − S L ) + ( − E z L D − E z LU + E z R D + E z R U ) / ( 2 ( S R − S L )) (14)
Depending on the choice of x-flux or y-flux we get
E z ; 1 ∗ ∗ = − ( S R + S L ) B y ∗ ∗ / 2 + ( S U ( E z L D + E z R D ) − S D ( E z L U + E z R U ) ) / ( 2 ( S U − S D ) ) − S U S D ( B x D − B x U ) / ( S U − S D ) + ( S R B y R + S L B y L ) / 2 (15) E_{z;1}^{**}=-(S_R+S_L)B_y^{**}/2+(S_U(E_{zLD}+E_{zRD})-S_D(E_{zLU}+E_{zRU}))/(2(S_U-S_D))-S_U S_D(B_{xD}-B_{xU})/(S_U-S_D)+(S_R B_{yR}+S_L B_{yL})/2 \tag*{(15)} E z ; 1 ∗∗ = − ( S R + S L ) B y ∗∗ /2 + ( S U ( E z L D + E z R D ) − S D ( E z LU + E z R U )) / ( 2 ( S U − S D )) − S U S D ( B x D − B xU ) / ( S U − S D ) + ( S R B y R + S L B y L ) /2 (15)
or
E z ; 2 ∗ ∗ = ( S U + S D ) B x ∗ ∗ / 2 + ( S R ( E z L D + E z L U ) − S L ( E z R D + E z R U ) ) / ( 2 ( S R − S L ) ) − ( S U B x U + S D B x D ) / 2 − S R S L ( B y R − B y L ) / ( S R − S L ) (16) E_{z;2}^{**}=(S_U+S_D)B_x^{**}/2+(S_R(E_{zLD}+E_{zLU})-S_L(E_{zRD}+E_{zRU}))/(2(S_R-S_L))-(S_U B_{xU}+S_D B_{xD})/2-S_R S_L(B_{yR}-B_{yL})/(S_R-S_L) \tag*{(16)} E z ; 2 ∗∗ = ( S U + S D ) B x ∗∗ /2 + ( S R ( E z L D + E z LU ) − S L ( E z R D + E z R U )) / ( 2 ( S R − S L )) − ( S U B xU + S D B x D ) /2 − S R S L ( B y R − B y L ) / ( S R − S L ) (16)
Since both choices are equally viable and entirely consistent, we choose E z ∗ ∗ = ( E z ; 1 ∗ ∗ + E z ; 2 ∗ ∗ ) / 2 E_z^{**}=(E_{z;1}^{**}+E_{z;2}^{**})/2 E z ∗∗ = ( E z ; 1 ∗∗ + E z ; 2 ∗∗ ) /2 . If we want the LLF variant of the above three equations, we get
B x ∗ ∗ = ( B x U + B x D ) / 2 + ( E z L D − E z L U + E z R D − E z R U ) / ( 4 S ) ; B_x^{**} = (B_{xU}+B_{xD})/2 + (E_{zLD}-E_{zLU}+E_{zRD}-E_{zRU})/(4S) \, ; B x ∗∗ = ( B xU + B x D ) /2 + ( E z L D − E z LU + E z R D − E z R U ) / ( 4 S ) ;
B y ∗ ∗ = ( B y R + B y L ) / 2 + ( E z R D − E z L D + E z R U − E z L U ) / ( 4 S ) ; B_y^{**} = (B_{yR}+B_{yL})/2 + (E_{zRD}-E_{zLD}+E_{zRU}-E_{zLU})/(4S) \, ; B y ∗∗ = ( B y R + B y L ) /2 + ( E z R D − E z L D + E z R U − E z LU ) / ( 4 S ) ;
E z ∗ ∗ = ( E z R U + E z L U + E z L D + E z R D ) / 4 + S [ B x D − B x U + B y R − B y L ] / 2 . (17) E_z^{**} = (E_{zRU}+E_{zLU}+E_{zLD}+E_{zRD})/4 + S\left[B_{xD}-B_{xU}+B_{yR}-B_{yL}\right]/2 \, . \tag*{(17)} E z ∗∗ = ( E z R U + E z LU + E z L D + E z R D ) /4 + S [ B x D − B xU + B y R − B y L ] /2 . (17)
The last equation in 3.9 gives us a very useful insight. It tells us that just like a 1D Riemann solver, the electric field E z ∗ ∗ E_z^{**} E z ∗∗ from the two dimensional Riemann solver that is suited for numerical work is also made up of two parts. The first part, ( E z R U + E z L U + E z L D + E z R D ) / 4 (E_{zRU}+E_{zLU}+E_{zLD}+E_{zRD})/4 ( E z R U + E z LU + E z L D + E z R D ) /4 , which we call the centered part, gives us consistency. In other words, it gives us the correct averaged electric field at the z-edge. The second part, S [ B x D − B x U + B y R − B y L ] / 2 S\left[B_{xD}-B_{xU}+B_{yR}-B_{yL}\right]/2 S [ B x D − B xU + B y R − B y L ] /2 , bears the dissipative contribution. This is the amount of dissipation that the 2D Riemann solver decrees should be present in the numerical electric field E z ∗ ∗ E_z^{**} E z ∗∗ if the numerical magnetic field is to evolve stably on the mesh. Just like the 1D Riemann solver, the dissipation is proportional to the jumps in the solution. This completes our description of the states and the electric fields in Figure 3 which depicts the 2D Riemann solver.
The last bit of insight that one needs in order to use the 2D Riemann solver consists of realizing that it is not just capable of giving us the subsonic state shown in Figure 3 , but it can also give us the other eight supersonic states that are shown in Fig. 4. The state that we will always be interested in is indeed the state that overlies the z-axis which is shown by the thick black dot in Figure 3 and 4. Since the focus of this paper is utilitarian, we just document the result from Balsara et al. [28 ] as:-
if ( S L ≥ 0 and S D ≥ 0 ) then E z n u m = E z L D ; return ; elseif ( S R ≤ 0 and S D ≥ 0 ) then E z n u m = E z R D ; return ; elseif ( S R ≤ 0 and S U ≤ 0 ) then E z n u m = E z R U ; return ; elseif ( S L ≥ 0 and S U ≤ 0 ) then E z n u m = E z L U ; return ; elseif ( S L ≥ 0 ) then E z n u m = E z L ∗ ; return ; elseif ( S R ≤ 0 ) then E z n u m = E z R ∗ ; return ; elseif ( S D ≥ 0 ) then E z n u m = E z D ∗ ; return ; elseif ( S U ≤ 0 ) then E z n u m = E z U ∗ ; return ; else E z n u m = ( E z ; 1 ∗ ∗ + E z ; 2 ∗ ∗ ) / 2 ; return ; endif (18) \begin{aligned}
&\textit{if }(S_L \ge0\text{ and }S_D \ge0)\textit{ then}\\
&E_z^{num}=E_{zLD}\ ;\ \textit{return}\ ;\\
&\textit{elseif }(S_R \le0\text{ and }S_D \ge0)\textit{ then}\\
&E_z^{num}=E_{zRD}\ ;\ \textit{return}\ ;\\
&\textit{elseif }(S_R \le0\text{ and }S_U \le0)\textit{ then}\\
&E_z^{num}=E_{zRU}\ ;\ \textit{return}\ ;\\
&\textit{elseif }(S_L \ge0\text{ and }S_U \le0)\textit{ then}\\
&E_z^{num}=E_{zLU}\ ;\ \textit{return}\ ;\\
&\textit{elseif }(S_L \ge0)\textit{ then}\\
&E_z^{num}=E_{zL}^{*}\ ;\ \textit{return}\ ;\\
&\textit{elseif }(S_R \le0)\textit{ then}\\
&E_z^{num}=E_{zR}^{*}\ ;\ \textit{return}\ ;\\
&\textit{elseif }(S_D \ge0)\textit{ then}\\
&E_z^{num}=E_{zD}^{*}\ ;\ \textit{return}\ ;\\
&\textit{elseif }(S_U \le0)\textit{ then}\\
&E_z^{num}=E_{zU}^{*}\ ;\ \textit{return}\ ;\\
&\textit{else}\\
&E_z^{num}=\left(E_{z;1}^{**}+E_{z;2}^{**}\right)/2\ ;\ \textit{return}\ ;\\
&\textit{endif} \tag*{(18)}
\end{aligned} if ( S L ≥ 0 and S D ≥ 0 ) then E z n u m = E z L D ; return ; elseif ( S R ≤ 0 and S D ≥ 0 ) then E z n u m = E z R D ; return ; elseif ( S R ≤ 0 and S U ≤ 0 ) then E z n u m = E z R U ; return ; elseif ( S L ≥ 0 and S U ≤ 0 ) then E z n u m = E z LU ; return ; elseif ( S L ≥ 0 ) then E z n u m = E z L ∗ ; return ; elseif ( S R ≤ 0 ) then E z n u m = E z R ∗ ; return ; elseif ( S D ≥ 0 ) then E z n u m = E z D ∗ ; return ; elseif ( S U ≤ 0 ) then E z n u m = E z U ∗ ; return ; else E z n u m = ( E z ; 1 ∗∗ + E z ; 2 ∗∗ ) /2 ; return ; endif (18)
For the LLF Riemann solver there are no supersonic states and the entire result is given by eqn. (17) . This completes our description of the strategy for obtaining the numerical electric field for the induction equation. One can make cyclic variations of the formulae in this Section to obtain E x n u m E_x^{num} E x n u m and E y n u m E_y^{num} E y n u m .
Higher Order Finite Volume Method for MHD and RMHD
All higher order finite volume schemes follow a similar plan. First, they obtain a higher order reconstruction of the solution that is valid at all points in the zone of interest. This is shown in Sub-section 4.1. Second, 1D Riemann solvers are invoked at zone faces to get the numerical fluxes at the faces; and 2D Riemann solvers are invoked at zone edges to get the numerical electric field components at the edges. This is discussed further in Sub-section 4.2. Third, an SSP-RK (Strong Stability Preserving-Runge Kutta) timestepping is invoked to get higher order temporal accuracy; as done in Sub-section 4.3 Of course, one can also build a higher order method that is based on a higher order predictor-corrector formulation, but it is easier to introduce PCP methods within the context of SSP-RK timestepping, which we do here. The rest of this Section describes each of the three parts.
Higher Order Reconstruction of Facial and Zone-Centered Variables
For the facial magnetic fields, the almost divergence preserving (ADP) reconstruction from Balsara, Samantaray and Subramanian [24 ] is used. This step is done first. (The ADP reconstruction entails first reconstructing the magnetic field components two-dimensionally within the faces. Then this reconstruction is extended into the volume of the mesh. This ADP reconstruction yields a reconstruction of the vector field that is zero up to discretization error.) For the zone-centered variables, we start with the volume averaged vector of variables, which are denoted by U ‾ i , j , k \overline{\mathbf{U}}_{i,j,k} U i , j , k in zone ( i , j , k ) (i,j,k) ( i , j , k ) ; the overbar denotes volume averaging. We assume a uniform mesh with zones of size Δ x \Delta x Δ x , Δ y \Delta y Δ y and Δ z \Delta z Δ z in each of the three directions. We wish to take a timestep of size Δ t \Delta t Δ t that is within the CFL limit. Because the target scheme is PCP, it is very advantageous to reconstruct the primitive variables with high order accuracy. However, in order to do that, we have to carry out the following three steps:- 1) Obtain zone-centered point values for the conserved variables. 2) Obtain therefrom the corresponding zone-centered point values for the primitive variables. 3) Then obtain zone-averaged primitive variables. These can then be reconstructed with high order of accuracy. At second order, this is easily done. However, at third and higher orders, the process becomes more intricate. The next paragraph describes how this is done at third and fourth orders; the paragraph after that describes how this is done at fifth and sixth orders.
At fourth order, McCorquodale and Colella [54 ] showed how this three-step procedure is done, and we draw inspiration from eqns. (12) and (16) of that paper. Starting from a mesh function that is made of zone-averaged conserved variables U ‾ i , j , k \overline{\mathbf{U}}_{i,j,k} U i , j , k , we can obtain the corresponding point value U i , j , k \mathbf{U}_{i,j,k} U i , j , k at the center of zone ( i , j , k ) (i,j,k) ( i , j , k ) . The problem is that the process entails subtracting off higher order derivatives from U ‾ i , j , k \overline{\mathbf{U}}_{i,j,k} U i , j , k , and if those higher order derivatives are obtained from a discontinuous solution, it can seriously damage the extraction of point values. Therefore, it is possible to define a flattener function, η i , j , k \eta_{i,j,k} η i , j , k , within each zone such that η i , j , k = 0 \eta_{i,j,k}=0 η i , j , k = 0 for smooth flow and η i , j , k → 1 \eta_{i,j,k} \to1 η i , j , k → 1 for non-smooth flow. Let us also define the function ϕ i , j , k ≡ 1 − η i , j , k \phi_{i,j,k} \equiv1-\eta_{i,j,k} ϕ i , j , k ≡ 1 − η i , j , k within each zone such that ϕ i , j , k = 1 \phi_{i,j,k}=1 ϕ i , j , k = 1 for smooth flow and ϕ i , j , k → 0 \phi_{i,j,k}\to0 ϕ i , j , k → 0 when the flow becomes increasingly non-smooth. The description of such flattener functions for Euler flow is given in Colella and Woodward (1994), for MHD flows the flattener function is described in Balsara [16 ] and for RMHD flows it is presented in Balsara and Kim [20 ] . (The flattener function, which yields the coefficients η i , j , k \eta_{i,j,k} η i , j , k and ϕ i , j , k \phi_{i,j,k} ϕ i , j , k for RMHD, is defined by eqns. (2.8) and (2.9) in Balsara and Kim [20 ] .) If the flow is smooth, i.e. if ϕ i , j , k = 1 \phi_{i,j,k}=1 ϕ i , j , k = 1 , third or fourth order accuracy (depending on what is desired) can be ensured. In the fourth order limit we can assert
U i , j , k = U ‾ i , j , k − 1 12 ϕ i , j , k [ u x x + u y y + u z z ] with u x x = ( U ‾ i + 1 , j , k − 2 U ‾ i , j , k + U ‾ i − 1 , j , k ) / 2 ; u y y = ( U ‾ i , j + 1 , k − 2 U ‾ i , j , k + U ‾ i , j − 1 , k ) / 2 ; u z z = ( U ‾ i , j , k + 1 − 2 U ‾ i , j , k + U ‾ i , j , k − 1 ) / 2 (19) \begin{aligned}
\mathbf{U}_{i,j,k} &= \overline{\mathbf{U}}_{i,j,k}-\frac{1}{12}\phi_{i,j,k}\left[u_{xx}+u_{yy}+u_{zz}\right] \quad\text{with} \quad u_{xx}=\left(\overline{\mathbf{U}}_{i+1,j,k}-2\overline{\mathbf{U}}_{i,j,k}+\overline{\mathbf{U}}_{i-1,j,k}\right)/2 \ ;\\
u_{yy} &= \left(\overline{\mathbf{U}}_{i,j+1,k}-2\overline{\mathbf{U}}_{i,j,k}+\overline{\mathbf{U}}_{i,j-1,k}\right)/2 \ ; \quad u_{zz}=\left(\overline{\mathbf{U}}_{i,j,k+1}-2\overline{\mathbf{U}}_{i,j,k}+\overline{\mathbf{U}}_{i,j,k-1}\right)/2 \tag*{(19)}
\end{aligned} U i , j , k u y y = U i , j , k − 12 1 ϕ i , j , k [ u xx + u y y + u z z ] with u xx = ( U i + 1 , j , k − 2 U i , j , k + U i − 1 , j , k ) /2 ; = ( U i , j + 1 , k − 2 U i , j , k + U i , j − 1 , k ) /2 ; u z z = ( U i , j , k + 1 − 2 U i , j , k + U i , j , k − 1 ) /2 (19)
In other words, when the flow is sufficiently smooth, eqn. (19) will start with the volume averaged quantities (i.e. the ones with overbars) and give us a fourth order accurate value for U i , j , k \mathbf{U}_{i,j,k} U i , j , k , the vector of conserved variables which is defined pointwise at the zone center. Using standard root solver techniques that are available in the literature (for RMHD we recommend Cai et al. [33 ] ), we obtain V i , j , k \mathbf{V}_{i,j,k} V i , j , k , the vector of primitive variables defined pointwise at the zone centers of all the zones of the mesh. From these zone-centered point values for the primitive variables, we can obtain zone averaged values of the primitive variables, which we denote with an overbar. Again, at third and fourth order accuracy we obtain
V ‾ i , j , k = V i , j , k + 1 12 ϕ i , j , k [ v x x + v y y + v z z ] with v x x = ( V i + 1 , j , k − 2 V i , j , k + V i − 1 , j , k ) / 2 ; v y y = ( V i , j + 1 , k − 2 V i , j , k + V i , j − 1 , k ) / 2 ; v z z = ( V i , j , k + 1 − 2 V i , j , k + V i , j , k − 1 ) / 2 (20) \begin{aligned}
\overline{\mathbf{V}}_{i,j,k} &= \mathbf{V}_{i,j,k}+\frac{1}{12}\phi_{i,j,k}\left[v_{xx}+v_{yy}+v_{zz}\right] \quad\text{with} \quad v_{xx}=\left(\mathbf{V}_{i+1,j,k}-2\mathbf{V}_{i,j,k}+\mathbf{V}_{i-1,j,k}\right)/2 \ ;\\
v_{yy} &= \left(\mathbf{V}_{i,j+1,k}-2\mathbf{V}_{i,j,k}+\mathbf{V}_{i,j-1,k}\right)/2 \ ; \quad v_{zz}=\left(\mathbf{V}_{i,j,k+1}-2\mathbf{V}_{i,j,k}+\mathbf{V}_{i,j,k-1}\right)/2 \tag*{(20)}
\end{aligned} V i , j , k v y y = V i , j , k + 12 1 ϕ i , j , k [ v xx + v y y + v z z ] with v xx = ( V i + 1 , j , k − 2 V i , j , k + V i − 1 , j , k ) /2 ; = ( V i , j + 1 , k − 2 V i , j , k + V i , j − 1 , k ) /2 ; v z z = ( V i , j , k + 1 − 2 V i , j , k + V i , j , k − 1 ) /2 (20)
Since the goal is to arrive at a PCP method, we suggest that it is better to use reconstruction formulae on the zone averaged primitive variables in eqn. (20) than to use reconstruction on the conserved variables in eqn. (19) . For that reason, the zone averaged primitive variables V ‾ i , j , k \overline{\mathbf{V}}_{i,j,k} V i , j , k can be reconstructed with fourth order of accuracy using a multidimensional WENO reconstruction scheme like the one described in the supplement of Balsara, Samantaray and Subramanian [24 ] . (We have suitably documented this reconstruction strategy to 3D and up to fifth and sixth order in the above reference, and it has also been extended to even higher orders by us.) As a result, within each zone we have a third or fourth order accurate reconstructed function for the vector of primitive variables given by V ^ i , j , k ( x , y , z ) \widehat{\mathbf{V}}_{i,j,k}(x,y,z) V i , j , k ( x , y , z ) . The advantage of reconstructing the primitive variables is that one can immediately test whether the reconstructed variable is within the PCP domain. If it is not, then the higher order modes of the reconstructed variable can be reduced to ensure that the interpolating function remains within the PCP domain.
While McCorquodale and Colella [54 ] only went up to fourth order, the same philosophy can be used in conjunction with WENO reconstruction (see the supplement of (Balsara, Samantaray and Subramanian 2023)) to go to even higher orders. Therefore, for a fifth or sixth order scheme, the equation that is analogous to eqn. (19) is given by
U i , j , k = U ‾ i , j , k − 1 12 ϕ i , j , k [ u x x + u y y + u z z ] + 3 560 ϕ i , j , k [ u x x x x + u y y y y + u z z z z ] + 1 144 ϕ i , j , k [ u x x y y + u y y z z + u x x z z ] , u x x = ( − 74 U ‾ i , j , k + 40 U ‾ i − 1 , j , k − 3 U ‾ i − 2 , j , k + 40 U ‾ i + 1 , j , k − 3 U ‾ i + 2 , j , k ) / 56 ; u y y = ( − 74 U ‾ i , j , k + 40 U ‾ i , j − 1 , k − 3 U ‾ i , j − 2 , k + 40 U ‾ i , j + 1 , k − 3 U ‾ i , j + 2 , k ) / 56 ; u z z = ( − 74 U ‾ i , j , k + 40 U ‾ i , j , k − 1 − 3 U ‾ i , j , k − 2 + 40 U ‾ i , j , k + 1 − 3 U ‾ i , j , k + 2 ) / 56 ; u x x x x = ( 6 U ‾ i , j , k − 4 U ‾ i − 1 , j , k + U ‾ i − 2 , j , k − 4 U ‾ i + 1 , j , k + U ‾ i + 2 , j , k ) / 24 ; u y y y y = ( 6 U ‾ i , j , k − 4 U ‾ i , j − 1 , k + U ‾ i , j − 2 , k − 4 U ‾ i , j + 1 , k + U ‾ i , j + 2 , k ) / 24 ; u z z z z = ( 6 U ‾ i , j , k − 4 U ‾ i , j , k − 1 + U ‾ i , j , k − 2 − 4 U ‾ i , j , k + 1 + U ‾ i , j , k + 2 ) / 24 ; u x x y y = ( 4 U ‾ i , j , k − 2 U ‾ i , j − 1 , k − 2 U ‾ i , j + 1 , k − 2 U ‾ i − 1 , j , k + U ‾ i − 1 , j − 1 , k + U ‾ i − 1 , j + 1 , k − 2 U ‾ i + 1 , j , k + U ‾ i + 1 , j − 1 , k + U ‾ i + 1 , j + 1 , k ) / 4 ; u y y z z = ( 4 U ‾ i , j , k − 2 U ‾ i , j , k − 1 − 2 U ‾ i , j , k + 1 − 2 U ‾ i , j − 1 , k + U ‾ i , j − 1 , k − 1 + U ‾ i , j − 1 , k + 1 − 2 U ‾ i , j + 1 , k + U ‾ i , j + 1 , k − 1 + U ‾ i , j + 1 , k + 1 ) / 4 ; u x x z z = ( 4 U ‾ i , j , k − 2 U ‾ i , j , k − 1 − 2 U ‾ i , j , k + 1 − 2 U ‾ i − 1 , j , k + U ‾ i − 1 , j , k − 1 + U ‾ i − 1 , j , k + 1 − 2 U ‾ i + 1 , j , k + U ‾ i + 1 , j , k − 1 + U ‾ i + 1 , j , k + 1 ) / 4. (21) \begin{aligned}
\mathbf{U}_{i,j,k}={}&\overline{\mathbf{U}}_{i,j,k}-\frac{1}{12}\phi_{i,j,k}\left[u_{xx}+u_{yy}+u_{zz}\right]+\frac{3}{560}\phi_{i,j,k}\left[u_{xxxx}+u_{yyyy}+u_{zzzz}\right]\\
&+\frac{1}{144}\phi_{i,j,k}\left[u_{xxyy}+u_{yyzz}+u_{xxzz}\right],\\
u_{xx}={}&\left(-74\overline{U}_{i,j,k}+40\overline{U}_{i-1,j,k}-3\overline{U}_{i-2,j,k}+40\overline{U}_{i+1,j,k}-3\overline{U}_{i+2,j,k}\right)/56;\\
u_{yy}={}&\left(-74\overline{U}_{i,j,k}+40\overline{U}_{i,j-1,k}-3\overline{U}_{i,j-2,k}+40\overline{U}_{i,j+1,k}-3\overline{U}_{i,j+2,k}\right)/56;\\
u_{zz}={}&\left(-74\overline{U}_{i,j,k}+40\overline{U}_{i,j,k-1}-3\overline{U}_{i,j,k-2}+40\overline{U}_{i,j,k+1}-3\overline{U}_{i,j,k+2}\right)/56;\\
u_{xxxx}={}&\left(6\overline{U}_{i,j,k}-4\overline{U}_{i-1,j,k}+\overline{U}_{i-2,j,k}-4\overline{U}_{i+1,j,k}+\overline{U}_{i+2,j,k}\right)/24;\\
u_{yyyy}={}&\left(6\overline{U}_{i,j,k}-4\overline{U}_{i,j-1,k}+\overline{U}_{i,j-2,k}-4\overline{U}_{i,j+1,k}+\overline{U}_{i,j+2,k}\right)/24;\\
u_{zzzz}={}&\left(6\overline{U}_{i,j,k}-4\overline{U}_{i,j,k-1}+\overline{U}_{i,j,k-2}-4\overline{U}_{i,j,k+1}+\overline{U}_{i,j,k+2}\right)/24;\\
u_{xxyy}={}&\left(4\overline{U}_{i,j,k}-2\overline{U}_{i,j-1,k}-2\overline{U}_{i,j+1,k}-2\overline{U}_{i-1,j,k}+\overline{U}_{i-1,j-1,k}+\overline{U}_{i-1,j+1,k}-2\overline{U}_{i+1,j,k}+\overline{U}_{i+1,j-1,k}+\overline{U}_{i+1,j+1,k}\right)/4;\\
u_{yyzz}={}&\left(4\overline{U}_{i,j,k}-2\overline{U}_{i,j,k-1}-2\overline{U}_{i,j,k+1}-2\overline{U}_{i,j-1,k}+\overline{U}_{i,j-1,k-1}+\overline{U}_{i,j-1,k+1}-2\overline{U}_{i,j+1,k}+\overline{U}_{i,j+1,k-1}+\overline{U}_{i,j+1,k+1}\right)/4;\\
u_{xxzz}={}&\left(4\overline{U}_{i,j,k}-2\overline{U}_{i,j,k-1}-2\overline{U}_{i,j,k+1}-2\overline{U}_{i-1,j,k}+\overline{U}_{i-1,j,k-1}+\overline{U}_{i-1,j,k+1}-2\overline{U}_{i+1,j,k}+\overline{U}_{i+1,j,k-1}+\overline{U}_{i+1,j,k+1}\right)/4. \tag*{(21)}
\end{aligned} U i , j , k = u xx = u y y = u z z = u xxxx = u y y y y = u z z z z = u xx y y = u y y z z = u xx z z = U i , j , k − 12 1 ϕ i , j , k [ u xx + u y y + u z z ] + 560 3 ϕ i , j , k [ u xxxx + u y y y y + u z z z z ] + 144 1 ϕ i , j , k [ u xx y y + u y y z z + u xx z z ] , ( − 74 U i , j , k + 40 U i − 1 , j , k − 3 U i − 2 , j , k + 40 U i + 1 , j , k − 3 U i + 2 , j , k ) /56 ; ( − 74 U i , j , k + 40 U i , j − 1 , k − 3 U i , j − 2 , k + 40 U i , j + 1 , k − 3 U i , j + 2 , k ) /56 ; ( − 74 U i , j , k + 40 U i , j , k − 1 − 3 U i , j , k − 2 + 40 U i , j , k + 1 − 3 U i , j , k + 2 ) /56 ; ( 6 U i , j , k − 4 U i − 1 , j , k + U i − 2 , j , k − 4 U i + 1 , j , k + U i + 2 , j , k ) /24 ; ( 6 U i , j , k − 4 U i , j − 1 , k + U i , j − 2 , k − 4 U i , j + 1 , k + U i , j + 2 , k ) /24 ; ( 6 U i , j , k − 4 U i , j , k − 1 + U i , j , k − 2 − 4 U i , j , k + 1 + U i , j , k + 2 ) /24 ; ( 4 U i , j , k − 2 U i , j − 1 , k − 2 U i , j + 1 , k − 2 U i − 1 , j , k + U i − 1 , j − 1 , k + U i − 1 , j + 1 , k − 2 U i + 1 , j , k + U i + 1 , j − 1 , k + U i + 1 , j + 1 , k ) /4 ; ( 4 U i , j , k − 2 U i , j , k − 1 − 2 U i , j , k + 1 − 2 U i , j − 1 , k + U i , j − 1 , k − 1 + U i , j − 1 , k + 1 − 2 U i , j + 1 , k + U i , j + 1 , k − 1 + U i , j + 1 , k + 1 ) /4 ; ( 4 U i , j , k − 2 U i , j , k − 1 − 2 U i , j , k + 1 − 2 U i − 1 , j , k + U i − 1 , j , k − 1 + U i − 1 , j , k + 1 − 2 U i + 1 , j , k + U i + 1 , j , k − 1 + U i + 1 , j , k + 1 ) /4. (21)
Eqn. (21) at fifth and sixth orders is analogous to eqn. (19) at fourth order. It is worthwhile noting that the moments u x x u_{xx} u xx , u y y u_{yy} u y y , u z z u_{zz} u z z , u x x x x u_{xxxx} u xxxx , u y y y y u_{yyyy} u y y y y , u z z z z u_{zzzz} u z z z z , u x x y y u_{xxyy} u xx y y , u y y z z u_{yyzz} u y y z z and u x x z z u_{xxzz} u xx z z in the above formula are obtained from a high order reconstruction. As before, within each zone we can use the zone-centered conserved variable U ‾ i , j , k \overline{\mathbf{U}}_{i,j,k} U i , j , k to build the zone-centered point values for the vector of primitives V i , j , k \mathbf{V}_{i,j,k} V i , j , k . At fifth and sixth orders, the transcription that is analogous to eqn. (20) is given via a high order interpolation and is given by
V ‾ i , j , k = V i , j , k + 1 12 ϕ i , j , k [ V x x + V y y + V z z ] − 3 560 ϕ i , j , k [ V x x x x + V y y y y + V z z z z ] − 1 144 ϕ i , j , k [ V x x y y + V y y z z + V x x z z ] \overline{V}_{i,j,k}=V_{i,j,k}+\frac{1}{12}\phi_{i,j,k}\left[V_{xx}+V_{yy}+V_{zz}\right]-\frac{3}{560}\phi_{i,j,k}\left[V_{xxxx}+V_{yyyy}+V_{zzzz}\right]-\frac{1}{144}\phi_{i,j,k}\left[V_{xxyy}+V_{yyzz}+V_{xxzz}\right] V i , j , k = V i , j , k + 12 1 ϕ i , j , k [ V xx + V y y + V z z ] − 560 3 ϕ i , j , k [ V xxxx + V y y y y + V z z z z ] − 144 1 ϕ i , j , k [ V xx y y + V y y z z + V xx z z ]
with
v x x = ( − 346 V i , j , k − 14 V i , j , k − 1 − 14 V i , j , k + 1 − 14 V i , j − 1 , k − 14 V i , j + 1 , k + 184 V i − 1 , j , k + 7 V i − 1 , j , k − 1 + 7 V i − 1 , j , k + 1 + 7 V i − 1 , j − 1 , k + 7 V i − 1 , j + 1 , k − 11 V i − 2 , j , k + 184 V i + 1 , j , k + 7 V i + 1 , j , k − 1 + 7 V i + 1 , j , k + 1 + 7 V i + 1 , j − 1 , k + 7 V i + 1 , j + 1 , k − 11 V i + 2 , j , k ) / 336 \begin{aligned}
v_{xx}={}&\bigl(-346V_{i,j,k}-14V_{i,j,k-1}-14V_{i,j,k+1}-14V_{i,j-1,k}-14V_{i,j+1,k}+184V_{i-1,j,k}+7V_{i-1,j,k-1}+7V_{i-1,j,k+1}\\
&+7V_{i-1,j-1,k}+7V_{i-1,j+1,k}-11V_{i-2,j,k}+184V_{i+1,j,k}+7V_{i+1,j,k-1}+7V_{i+1,j,k+1}+7V_{i+1,j-1,k}+7V_{i+1,j+1,k}\\
&-11V_{i+2,j,k}\bigr)/336
\end{aligned} v xx = ( − 346 V i , j , k − 14 V i , j , k − 1 − 14 V i , j , k + 1 − 14 V i , j − 1 , k − 14 V i , j + 1 , k + 184 V i − 1 , j , k + 7 V i − 1 , j , k − 1 + 7 V i − 1 , j , k + 1 + 7 V i − 1 , j − 1 , k + 7 V i − 1 , j + 1 , k − 11 V i − 2 , j , k + 184 V i + 1 , j , k + 7 V i + 1 , j , k − 1 + 7 V i + 1 , j , k + 1 + 7 V i + 1 , j − 1 , k + 7 V i + 1 , j + 1 , k − 11 V i + 2 , j , k ) /336
v y y = ( − 346 V i , j , k − 14 V i , j , k − 1 − 14 V i , j , k + 1 + 184 V i , j − 1 , k + 7 V i , j − 1 , k − 1 + 7 V i , j − 1 , k + 1 − 11 V i , j − 2 , k + 184 V i , j + 1 , k + 7 V i , j + 1 , k − 1 + 7 V i , j + 1 , k + 1 − 11 V i , j + 2 , k − 14 V i − 1 , j , k + 7 V i − 1 , j − 1 , k + 7 V i − 1 , j + 1 , k − 14 V i + 1 , j , k + 7 V i + 1 , j − 1 , k + 7 V i + 1 , j + 1 , k ) / 336 \begin{aligned}
v_{yy}={}&\bigl(-346V_{i,j,k}-14V_{i,j,k-1}-14V_{i,j,k+1}+184V_{i,j-1,k}+7V_{i,j-1,k-1}+7V_{i,j-1,k+1}-11V_{i,j-2,k}+184V_{i,j+1,k}\\
&+7V_{i,j+1,k-1}+7V_{i,j+1,k+1}-11V_{i,j+2,k}-14V_{i-1,j,k}+7V_{i-1,j-1,k}+7V_{i-1,j+1,k}-14V_{i+1,j,k}+7V_{i+1,j-1,k}\\
&+7V_{i+1,j+1,k}\bigr)/336
\end{aligned} v y y = ( − 346 V i , j , k − 14 V i , j , k − 1 − 14 V i , j , k + 1 + 184 V i , j − 1 , k + 7 V i , j − 1 , k − 1 + 7 V i , j − 1 , k + 1 − 11 V i , j − 2 , k + 184 V i , j + 1 , k + 7 V i , j + 1 , k − 1 + 7 V i , j + 1 , k + 1 − 11 V i , j + 2 , k − 14 V i − 1 , j , k + 7 V i − 1 , j − 1 , k + 7 V i − 1 , j + 1 , k − 14 V i + 1 , j , k + 7 V i + 1 , j − 1 , k + 7 V i + 1 , j + 1 , k ) /336
v z z = ( − 346 V i , j , k + 184 V i , j , k − 1 − 11 V i , j , k − 2 + 184 V i , j , k + 1 − 11 V i , j , k + 2 − 14 V i , j − 1 , k + 7 V i , j − 1 , k − 1 + 7 V i , j − 1 , k + 1 − 14 V i , j + 1 , k + 7 V i , j + 1 , k − 1 + 7 V i , j + 1 , k + 1 − 14 V i − 1 , j , k + 7 V i − 1 , j , k − 1 + 7 V i − 1 , j , k + 1 − 14 V i + 1 , j , k + 7 V i + 1 , j , k − 1 + 7 V i + 1 , j , k + 1 ) / 336 \begin{aligned}
v_{zz}={}&\bigl(-346V_{i,j,k}+184V_{i,j,k-1}-11V_{i,j,k-2}+184V_{i,j,k+1}-11V_{i,j,k+2}-14V_{i,j-1,k}+7V_{i,j-1,k-1}+7V_{i,j-1,k+1}\\
&-14V_{i,j+1,k}+7V_{i,j+1,k-1}+7V_{i,j+1,k+1}-14V_{i-1,j,k}+7V_{i-1,j,k-1}+7V_{i-1,j,k+1}-14V_{i+1,j,k}+7V_{i+1,j,k-1}\\
&+7V_{i+1,j,k+1}\bigr)/336
\end{aligned} v z z = ( − 346 V i , j , k + 184 V i , j , k − 1 − 11 V i , j , k − 2 + 184 V i , j , k + 1 − 11 V i , j , k + 2 − 14 V i , j − 1 , k + 7 V i , j − 1 , k − 1 + 7 V i , j − 1 , k + 1 − 14 V i , j + 1 , k + 7 V i , j + 1 , k − 1 + 7 V i , j + 1 , k + 1 − 14 V i − 1 , j , k + 7 V i − 1 , j , k − 1 + 7 V i − 1 , j , k + 1 − 14 V i + 1 , j , k + 7 V i + 1 , j , k − 1 + 7 V i + 1 , j , k + 1 ) /336
v x x x x = ( 6 V i , j , k − 4 V i − 1 , j , k + V i − 2 , j , k − 4 V i + 1 , j , k + V i + 2 , j , k ) / 24 v_{xxxx}=\left(6V_{i,j,k}-4V_{i-1,j,k}+V_{i-2,j,k}-4V_{i+1,j,k}+V_{i+2,j,k}\right)/24 v xxxx = ( 6 V i , j , k − 4 V i − 1 , j , k + V i − 2 , j , k − 4 V i + 1 , j , k + V i + 2 , j , k ) /24
v y y y y = ( 6 V i , j , k − 4 V i , j − 1 , k + V i , j − 2 , k − 4 V i , j + 1 , k + V i , j + 2 , k ) / 24 v_{yyyy}=\left(6V_{i,j,k}-4V_{i,j-1,k}+V_{i,j-2,k}-4V_{i,j+1,k}+V_{i,j+2,k}\right)/24 v y y y y = ( 6 V i , j , k − 4 V i , j − 1 , k + V i , j − 2 , k − 4 V i , j + 1 , k + V i , j + 2 , k ) /24
v z z z z = ( 6 V i , j , k − 4 V i , j , k − 1 + V i , j , k − 2 − 4 V i , j , k + 1 + V i , j , k + 2 ) / 24 v_{zzzz}=\left(6V_{i,j,k}-4V_{i,j,k-1}+V_{i,j,k-2}-4V_{i,j,k+1}+V_{i,j,k+2}\right)/24 v z z z z = ( 6 V i , j , k − 4 V i , j , k − 1 + V i , j , k − 2 − 4 V i , j , k + 1 + V i , j , k + 2 ) /24
v x x y y = ( 4 V i , j , k − 2 V i , j − 1 , k − 2 V i , j + 1 , k − 2 V i − 1 , j , k + V i − 1 , j − 1 , k + V i − 1 , j + 1 , k − 2 V i + 1 , j , k + V i + 1 , j − 1 , k + V i + 1 , j + 1 , k ) / 4 v_{xxyy}=\left(4V_{i,j,k}-2V_{i,j-1,k}-2V_{i,j+1,k}-2V_{i-1,j,k}+V_{i-1,j-1,k}+V_{i-1,j+1,k}-2V_{i+1,j,k}+V_{i+1,j-1,k}+V_{i+1,j+1,k}\right)/4 v xx y y = ( 4 V i , j , k − 2 V i , j − 1 , k − 2 V i , j + 1 , k − 2 V i − 1 , j , k + V i − 1 , j − 1 , k + V i − 1 , j + 1 , k − 2 V i + 1 , j , k + V i + 1 , j − 1 , k + V i + 1 , j + 1 , k ) /4
v y y z z = ( 4 V i , j , k − 2 V i , j , k − 1 − 2 V i , j , k + 1 − 2 V i , j − 1 , k + V i , j − 1 , k − 1 + V i , j − 1 , k + 1 − 2 V i , j + 1 , k + V i , j + 1 , k − 1 + V i , j + 1 , k + 1 ) / 4 v_{yyzz}=\left(4V_{i,j,k}-2V_{i,j,k-1}-2V_{i,j,k+1}-2V_{i,j-1,k}+V_{i,j-1,k-1}+V_{i,j-1,k+1}-2V_{i,j+1,k}+V_{i,j+1,k-1}+V_{i,j+1,k+1}\right)/4 v y y z z = ( 4 V i , j , k − 2 V i , j , k − 1 − 2 V i , j , k + 1 − 2 V i , j − 1 , k + V i , j − 1 , k − 1 + V i , j − 1 , k + 1 − 2 V i , j + 1 , k + V i , j + 1 , k − 1 + V i , j + 1 , k + 1 ) /4
v x x z z = ( 4 V i , j , k − 2 V i , j , k − 1 − 2 V i , j , k + 1 − 2 V i − 1 , j , k + V i − 1 , j , k − 1 + V i − 1 , j , k + 1 − 2 V i + 1 , j , k + V i + 1 , j , k − 1 + V i + 1 , j , k + 1 ) / 4 (22) v_{xxzz}=\left(4V_{i,j,k}-2V_{i,j,k-1}-2V_{i,j,k+1}-2V_{i-1,j,k}+V_{i-1,j,k-1}+V_{i-1,j,k+1}-2V_{i+1,j,k}+V_{i+1,j,k-1}+V_{i+1,j,k+1}\right)/4 \tag*{(22)} v xx z z = ( 4 V i , j , k − 2 V i , j , k − 1 − 2 V i , j , k + 1 − 2 V i − 1 , j , k + V i − 1 , j , k − 1 + V i − 1 , j , k + 1 − 2 V i + 1 , j , k + V i + 1 , j , k − 1 + V i + 1 , j , k + 1 ) /4 (22)
These zone-averaged primitive variables can be reconstructed with fifth or sixth order of accuracy using a multidimensional WENO reconstruction scheme like the one described in the supplement of Balsara, Samantaray and Subramanian (2023). Therefore, within each zone we have a third, fourth, fifth or sixth order accurate reconstructed function for the vector of primitive variables given by V ^ i , j , k ( x , y , z ) \hat{\mathbf{V}}_{i,j,k}(x,y,z) V ^ i , j , k ( x , y , z ) .
In the most stringent of situations, these reconstructed functions V ^ i , j , k ( x , y , z ) \hat{\mathbf{V}}_{i,j,k}(x,y,z) V ^ i , j , k ( x , y , z ) may not be PCP at all locations of interest in the ( i , j , k ) (i,j,k) ( i , j , k ) zone. If we find ourselves in such a situation, we can always find a κ i , j , k ∈ [ 0 , 1 ] \kappa_{i,j,k}\in[0,1] κ i , j , k ∈ [ 0 , 1 ] such that a reset
V ^ i , j , k ( x , y , z ) → κ i , j , k V ^ i , j , k ( x , y , z ) + ( 1 − κ i , j , k ) V ‾ i , j , k (23) \hat{\mathbf{V}}_{i,j,k}(x,y,z)\rightarrow\kappa_{i,j,k}\hat{\mathbf{V}}_{i,j,k}(x,y,z)+(1-\kappa_{i,j,k})\overline{\mathbf{V}}_{i,j,k} \tag*{(23)} V ^ i , j , k ( x , y , z ) → κ i , j , k V ^ i , j , k ( x , y , z ) + ( 1 − κ i , j , k ) V i , j , k (23)
will bring the reconstructed functions within the PCP domain. The same plan can be used for the facial magnetic fields so that if we consider the higher order reconstructed x-component of the facial magnetic field to be B ^ x ; i + 1 / 2 , j , k ( y , z ) \hat{B}_{x;i+1/2,j,k}(y,z) B ^ x ; i + 1/2 , j , k ( y , z ) and the mean value of the magnetic field in the same x-face to be B ‾ x ; i + 1 / 2 , j , k \overline{B}_{x;i+1/2,j,k} B x ; i + 1/2 , j , k , then we can write an equation that is analogous to eqn. (23) as
B ^ x ; i + 1 / 2 , j , k ( y , z ) → min ( κ i , j , k , κ i + 1 , j , k ) B ^ x ; i + 1 / 2 , j , k ( y , z ) + ( 1 − min ( κ i , j , k , κ i + 1 , j , k ) ) B ‾ x ; i + 1 / 2 , j , k (24) \hat{B}_{x;i+1/2,j,k}(y,z) \to\min\left(\kappa_{i,j,k},\kappa_{i+1,j,k}\right)\hat{B}_{x;i+1/2,j,k}(y,z)+\left(1-\min\left(\kappa_{i,j,k},\kappa_{i+1,j,k}\right)\right)\overline{B}_{x;i+1/2,j,k} \tag*{(24)} B ^ x ; i + 1/2 , j , k ( y , z ) → min ( κ i , j , k , κ i + 1 , j , k ) B ^ x ; i + 1/2 , j , k ( y , z ) + ( 1 − min ( κ i , j , k , κ i + 1 , j , k ) ) B x ; i + 1/2 , j , k (24)
This Sub-section has shown us that if we start with U ‾ i , j , k \overline{\mathbf{U}}_{i,j,k} U i , j , k which is PCP in the zone ( i , j , k ) (i,j,k) ( i , j , k ) then we can always obtain a reconstructed function for the vector of primitive variables given by V ^ i , j , k ( x , y , z ) \hat{\mathbf{V}}_{i,j,k}(x,y,z) V ^ i , j , k ( x , y , z ) which retains the PCP property. Since these primitive variables are handed to the Riemann solvers, we guarantee that the variables that are fed to all the Riemann solvers are physical.
Invoking 1D and Multidimensional Riemann Solvers
Figure 5 shows the arrangement of the spatial nodes in the fourth order accurate RK-WENO algorithm for two space dimensions. The nodes within four abutting spatial zones are shown by the black dots. At fourth order, one-dimensional Gaussian quadrature requires the use of three quadrature points; we, therefore, have three nodes within each face of Figure 5 . When two nodes from opposing faces abut one another, we invoke a one-dimensional Riemann solver. The red, double-sided arrows indicate the application of 1D Riemann solvers at the nodal points in the x-direction. The blue, double-sided arrows indicate the application of 1D Riemann solvers at the nodal points in the y-direction. The two input states that go into each 1D Riemann solver must indeed be PCP. Therefore, eqn. (23) should certainly be used to make sure that whichever interpolant is used within each zone produces PCP values at all the nodal points within that zone.
Figure 5. Fig. 5 shows the arrangement of the spatial nodes in the fourth order accurate RK-WENO algorithm for two space dimensions. The nodes within four abutting spatial zones are shown by the black dots. At fourth order, one-dimensional Gaussian quadrature requires the use of three quadrature points; we, therefore, see three nodes within each face. The red, double-sided arrows indicate the application of 1D Riemann solvers at the nodal points in the x x x -direction. The blue, double-sided arrows indicate the application of 1D Riemann solvers at the nodal points in the y y y -direction. The green dashed square at the right-upper vertex of zone ( i , j ) (i,j) ( i , j ) indicates the application of a 2D Riemann solver at the vertices of the mesh.
At each zone center, we should also construct the pointwise electric field components. This is easily done because we have all the primitive variables at each zone center. These zone-centered electric fields are then interpolated in 3D to high order. At each edge, the electric fields from the four abutting zones are then interpolated to that edge, as shown in Figure 2 . This then forms the centered part of the multidimensional Riemann solver. The centered part gives us consistency in the Riemann solver. The facial magnetic field components have also been reconstructed within the faces of the mesh to high order in the ADP reconstruction step. As a result, the jumps in the facial magnetic fields form the dissipation terms in the multidimensional Riemann solver. The dissipation terms give us numerical stabilization. (The reader may want to circle back to the discussion around eqn. (17) in order to recapitulate these ideas about a centered part and a dissipation part in the multidimensional Riemann solver.) The green dashed square at the right-upper vertex of zone ( i , j ) (i,j) ( i , j ) in Figure 5 indicates the application of a 2D Riemann solver at the vertices of the mesh. This gives us the z z z -component of the electric field. Figure 5 depicts a 2D mesh just to make it easier to visualize the concepts; however, the entire discussion extends to full three dimensions.
In full 3D, the time rate of change for the conserved variables can be written up to higher order as
∂ t U ‾ i , j , k = − 1 Δ x ( F ‾ i + 1 / 2 , j , k H O − F ‾ i − 1 / 2 , j , k H O ) − 1 Δ y ( G ‾ i , j + 1 / 2 , k H O − G ‾ i , j − 1 / 2 , k H O ) − 1 Δ z ( H ‾ i , j , k + 1 / 2 H O − H ‾ i , j , k − 1 / 2 H O ) (25) \partial_t \overline{\mathbf{U}}_{i,j,k}=-\frac{1}{\Delta x}\left(\overline{\mathbf{F}}^{\mathrm{HO}}_{i+1/2,j,k}-\overline{\mathbf{F}}^{\mathrm{HO}}_{i-1/2,j,k}\right)-\frac{1}{\Delta y}\left(\overline{\mathbf{G}}^{\mathrm{HO}}_{i,j+1/2,k}-\overline{\mathbf{G}}^{\mathrm{HO}}_{i,j-1/2,k}\right)-\frac{1}{\Delta z}\left(\overline{\mathbf{H}}^{\mathrm{HO}}_{i,j,k+1/2}-\overline{\mathbf{H}}^{\mathrm{HO}}_{i,j,k-1/2}\right) \tag*{(25)} ∂ t U i , j , k = − Δ x 1 ( F i + 1/2 , j , k HO − F i − 1/2 , j , k HO ) − Δ y 1 ( G i , j + 1/2 , k HO − G i , j − 1/2 , k HO ) − Δ z 1 ( H i , j , k + 1/2 HO − H i , j , k − 1/2 HO ) (25)
The superscripts “HO” for the fluxes indicate that these are high order numerical quadratures of the fluxes evaluated at the faces of the mesh. The overbars for the fluxes indicate that these are facially averaged fluxes. Likewise, the time rate of change for the facially-averaged magnetic field variables can be written up to higher order as
∂ t B ‾ x ; i + 1 / 2 , j , k = − 1 Δ y Δ z ( Δ z E ‾ z ; i + 1 / 2 , j + 1 / 2 , k H O − Δ z E ‾ z ; i + 1 / 2 , j − 1 / 2 , k H O + Δ y E ‾ y ; i + 1 / 2 , j , k − 1 / 2 H O − Δ y E ‾ y ; i + 1 / 2 , j , k + 1 / 2 H O ) (26) \partial_t \overline{B}_{x;i+1/2,j,k}=-\frac{1}{\Delta y\Delta z}\left(\Delta z\overline{E}^{\mathrm{HO}}_{z;i+1/2,j+1/2,k}-\Delta z\overline{E}^{\mathrm{HO}}_{z;i+1/2,j-1/2,k}+\Delta y\overline{E}^{\mathrm{HO}}_{y;i+1/2,j,k-1/2}-\Delta y\overline{E}^{\mathrm{HO}}_{y;i+1/2,j,k+1/2}\right) \tag*{(26)} ∂ t B x ; i + 1/2 , j , k = − Δ y Δ z 1 ( Δ z E z ; i + 1/2 , j + 1/2 , k HO − Δ z E z ; i + 1/2 , j − 1/2 , k HO + Δ y E y ; i + 1/2 , j , k − 1/2 HO − Δ y E y ; i + 1/2 , j , k + 1/2 HO ) (26)
∂ t B ‾ y ; i , j − 1 / 2 , k = − 1 Δ x Δ z ( Δ x E ‾ x ; i , j − 1 / 2 , k + 1 / 2 H O − Δ x E ‾ x ; i , j − 1 / 2 , k − 1 / 2 H O + Δ z E ‾ z ; i − 1 / 2 , j − 1 / 2 , k H O − Δ z E ‾ z ; i + 1 / 2 , j − 1 / 2 , k H O ) (27) \partial_t \overline{B}_{y;i,j-1/2,k}=-\frac{1}{\Delta x\Delta z}\left(\Delta x\overline{E}^{\mathrm{HO}}_{x;i,j-1/2,k+1/2}-\Delta x\overline{E}^{\mathrm{HO}}_{x;i,j-1/2,k-1/2}+\Delta z\overline{E}^{\mathrm{HO}}_{z;i-1/2,j-1/2,k}-\Delta z\overline{E}^{\mathrm{HO}}_{z;i+1/2,j-1/2,k}\right) \tag*{(27)} ∂ t B y ; i , j − 1/2 , k = − Δ x Δ z 1 ( Δ x E x ; i , j − 1/2 , k + 1/2 HO − Δ x E x ; i , j − 1/2 , k − 1/2 HO + Δ z E z ; i − 1/2 , j − 1/2 , k HO − Δ z E z ; i + 1/2 , j − 1/2 , k HO ) (27)
∂ t B ‾ z ; i , j , k + 1 / 2 = − 1 Δ x Δ y ( Δ x E ‾ x ; i , j − 1 / 2 , k + 1 / 2 H O − Δ x E ‾ x ; i , j + 1 / 2 , k + 1 / 2 H O + Δ y E ‾ y ; i + 1 / 2 , j , k + 1 / 2 H O − Δ y E ‾ y ; i − 1 / 2 , j , k + 1 / 2 H O ) (28) \partial_t \overline{B}_{z;i,j,k+1/2}=-\frac{1}{\Delta x\Delta y}\left(\Delta x\overline{E}^{\mathrm{HO}}_{x;i,j-1/2,k+1/2}-\Delta x\overline{E}^{\mathrm{HO}}_{x;i,j+1/2,k+1/2}+\Delta y\overline{E}^{\mathrm{HO}}_{y;i+1/2,j,k+1/2}-\Delta y\overline{E}^{\mathrm{HO}}_{y;i-1/2,j,k+1/2}\right) \tag*{(28)} ∂ t B z ; i , j , k + 1/2 = − Δ x Δ y 1 ( Δ x E x ; i , j − 1/2 , k + 1/2 HO − Δ x E x ; i , j + 1/2 , k + 1/2 HO + Δ y E y ; i + 1/2 , j , k + 1/2 HO − Δ y E y ; i − 1/2 , j , k + 1/2 HO ) (28)
As before, the superscripts “HO” for the electric fields indicate that these are high order numerical quadratures of the electric fields evaluated along the edges of the mesh. The overbars for the electric fields indicate that these are edge-averaged electric fields. The above four equations tell us how the time rate of change of the primal variables, i.e. the zone-averaged fluid variables and the facially averaged magnetic field components, are updated with high order of accuracy.
SSP-RK Timestepping, Written Differently
Eqns. (25) to (28) can now be integrated into a higher order SSP-RK timestepping (Shu and Osher [62 ] , Spiteri and Ruuth [64 , 65 ] ). However, for the sake of understanding the steps that are to come later, we write this update a little differently in the narrative that follows. For the second order SSP-RK update we write
U ˉ i ( 1 ) = U ˉ i ( n ) + Δ t ∂ t U ˉ i ( n ) \bar{U}_i^{(1)} = \bar{U}_i^{(n)} + \Delta t \, \partial_t \bar{U}_i^{(n)} U ˉ i ( 1 ) = U ˉ i ( n ) + Δ t ∂ t U ˉ i ( n )
U ˉ i ( n + 1 ) = 1 2 U ˉ i ( n ) + 1 2 ( U ˉ i ( 1 ) + Δ t ∂ t U ˉ i ( 1 ) ) (29) \bar{U}_i^{(n+1)} = \frac{1}{2}\bar{U}_i^{(n)} + \frac{1}{2}\left(\bar{U}_i^{(1)} + \Delta t \, \partial_t \bar{U}_i^{(1)}\right) \tag*{(29)} U ˉ i ( n + 1 ) = 2 1 U ˉ i ( n ) + 2 1 ( U ˉ i ( 1 ) + Δ t ∂ t U ˉ i ( 1 ) ) (29)
For the third order, the similar style of update can be demonstrated as
U ˉ i ( 1 ) = U ˉ i ( n ) + Δ t ∂ t U ˉ i ( n ) \bar{U}_i^{(1)} = \bar{U}_i^{(n)} + \Delta t \, \partial_t \bar{U}_i^{(n)} U ˉ i ( 1 ) = U ˉ i ( n ) + Δ t ∂ t U ˉ i ( n )
U ˉ i ( 2 ) = 3 4 U ˉ i ( n ) + 1 4 ( U ˉ i ( 1 ) + Δ t ∂ t U ˉ i ( 1 ) ) \bar{U}_i^{(2)} = \frac{3}{4}\bar{U}_i^{(n)} + \frac{1}{4}\left(\bar{U}_i^{(1)} + \Delta t \, \partial_t \bar{U}_i^{(1)}\right) U ˉ i ( 2 ) = 4 3 U ˉ i ( n ) + 4 1 ( U ˉ i ( 1 ) + Δ t ∂ t U ˉ i ( 1 ) )
U ˉ i ( n + 1 ) = 1 3 U ˉ i ( n ) + 2 3 ( U ˉ i ( 2 ) + Δ t ∂ t U ˉ i ( 2 ) ) (30) \bar{U}_i^{(n+1)} = \frac{1}{3}\bar{U}_i^{(n)} + \frac{2}{3}\left(\bar{U}_i^{(2)} + \Delta t \, \partial_t \bar{U}_i^{(2)}\right) \tag*{(30)} U ˉ i ( n + 1 ) = 3 1 U ˉ i ( n ) + 3 2 ( U ˉ i ( 2 ) + Δ t ∂ t U ˉ i ( 2 ) ) (30)
A similar structure can be shown for the five-stage fourth order SSP-RK update as follows
U ˉ i ( 1 ) = 0.608247773428110 U ˉ i ( n ) + 0.391752226571890 ( U ˉ i ( n ) + Δ t ∂ t U ˉ i ( n ) ) \bar{U}_i^{(1)} = 0.608247773428110\bar{U}_i^{(n)} + 0.391752226571890\left(\bar{U}_i^{(n)} + \Delta t\partial_t\bar{U}_i^{(n)}\right) U ˉ i ( 1 ) = 0.608247773428110 U ˉ i ( n ) + 0.391752226571890 ( U ˉ i ( n ) + Δ t ∂ t U ˉ i ( n ) )
U ˉ i ( 2 ) = 0.444370493651235 U ˉ i ( n ) + 0.187218913298394 U ˉ i ( 1 ) + 0.368410593050371 ( U ˉ i ( 1 ) + Δ t ∂ t U ˉ i ( 1 ) ) \bar{U}_i^{(2)} = 0.444370493651235\bar{U}_i^{(n)} + 0.187218913298394\bar{U}_i^{(1)} + 0.368410593050371\left(\bar{U}_i^{(1)} + \Delta t\partial_t\bar{U}_i^{(1)}\right) U ˉ i ( 2 ) = 0.444370493651235 U ˉ i ( n ) + 0.187218913298394 U ˉ i ( 1 ) + 0.368410593050371 ( U ˉ i ( 1 ) + Δ t ∂ t U ˉ i ( 1 ) )
U ˉ i ( 3 ) = 0.620101851488403 U ˉ i ( n ) + 0.128006374239903 U ˉ i ( 2 ) + 0.251891774271694 ( U ˉ i ( 2 ) + Δ t ∂ t U ˉ i ( 2 ) ) \bar{U}_i^{(3)} = 0.620101851488403\bar{U}_i^{(n)} + 0.128006374239903\bar{U}_i^{(2)} + 0.251891774271694\left(\bar{U}_i^{(2)} + \Delta t\partial_t\bar{U}_i^{(2)}\right) U ˉ i ( 3 ) = 0.620101851488403 U ˉ i ( n ) + 0.128006374239903 U ˉ i ( 2 ) + 0.251891774271694 ( U ˉ i ( 2 ) + Δ t ∂ t U ˉ i ( 2 ) )
U ˉ i ( 4 ) = 0.178079954393132 U ˉ i ( n ) + 0.276945295378347 U ˉ i ( 3 ) + 0.544974750228521 ( U ˉ i ( 3 ) + Δ t ∂ t U ˉ i ( 3 ) ) \bar{U}_i^{(4)} = 0.178079954393132\bar{U}_i^{(n)} + 0.276945295378347\bar{U}_i^{(3)} + 0.544974750228521\left(\bar{U}_i^{(3)} + \Delta t\partial_t\bar{U}_i^{(3)}\right) U ˉ i ( 4 ) = 0.178079954393132 U ˉ i ( n ) + 0.276945295378347 U ˉ i ( 3 ) + 0.544974750228521 ( U ˉ i ( 3 ) + Δ t ∂ t U ˉ i ( 3 ) )
U ˉ i ( n + 1 ) = 0.517231671970585 U ˉ i ( 2 ) + { 0.032367241859857 U ˉ i ( 3 ) + 0.063692468666290 ( U ˉ i ( 3 ) + Δ t ∂ t U ˉ i ( 3 ) ) } + { 0.160701134266363 U ˉ i ( 4 ) + 0.226007483236906 ( U ˉ i ( 4 ) + Δ t ∂ t U ˉ i ( 4 ) ) } (31) \begin{aligned}
\bar{U}_i^{(n+1)} ={}& 0.517231671970585\bar{U}_i^{(2)}
+ \left\{0.032367241859857\bar{U}_i^{(3)}
+ 0.063692468666290\left(\bar{U}_i^{(3)} + \Delta t\partial_t\bar{U}_i^{(3)}\right)\right\}\\
&+ \left\{0.160701134266363\bar{U}_i^{(4)}
+ 0.226007483236906\left(\bar{U}_i^{(4)} + \Delta t\partial_t\bar{U}_i^{(4)}\right)\right\} \tag*{(31)}
\end{aligned} U ˉ i ( n + 1 ) = 0.517231671970585 U ˉ i ( 2 ) + { 0.032367241859857 U ˉ i ( 3 ) + 0.063692468666290 ( U ˉ i ( 3 ) + Δ t ∂ t U ˉ i ( 3 ) ) } + { 0.160701134266363 U ˉ i ( 4 ) + 0.226007483236906 ( U ˉ i ( 4 ) + Δ t ∂ t U ˉ i ( 4 ) ) } (31)
The common feature in eqns. (29) to (31) is that each stage has been written in the form of a forward Euler update. In the next Section we will show that we can make a forward Euler update PCP by nonlinearly hybridizing any high order code with a first order code. In doing so, we will have shown that every stage in an SSP-RK update can be written in terms of a convex combination of states, each of which is PCP. As a result, the entire scheme will be made PCP.
It is also worth noting that several problems in computational astrophysics do not have unusually large Mach numbers, neither do they have exceptionally high Lorentz factors and nor do they have ultra-strong magnetic fields. For such problems, even the algorithm that is described up to this point would yield a high order algorithm that does not need PCP enforcement. Thus the PCP property is an add-on step to help out in very stringent astrophysical and space physics simulations.
A First Order PCP Scheme that can be Hybridized with the Previous Section
When equations (25) to (28) are integrated into one of the three SSP-RK time-stepping schemes shown in eqns. (29) , (30) or (31) , the result is a scheme with higher order accuracy in space and time. Because of eqns. (23) and (24) we can guarantee that the method will never provide inputs to a Riemann solver that are not PCP. This ensures that the Riemann solvers will always be able to return meaningful higher order fluxes and electric fields. The problem is that this is still not sufficient to ensure that the final update for each stage in the multi-stage Runge-Kutta timestepping remains PCP. Our first task, which we take up in Sub-Section 5.1, is to describe a first order scheme that unconditionally stays within the PCP region. Our second task, which we take up in Sub-Section 5.2, is to describe how such a scheme can be integrated into a modified version of eqns. (25) to (28) in such a way that for troubled zones, and only for troubled zones, we gradually resort to the lower order scheme.
A First Order PCP Scheme for Divergence-Free MHD and RMHD
Let us first start with an interesting observation. A first order, zone-centered scheme for MHD and RMHD that is updated with fluxes that are obtained with an HLL or LLF Riemann solver will indeed be PCP. See Gurski [45 ] for a proof of this. No reconstruction of any sort is needed for such a scheme that is first order in space and time; as a result, the scheme is extremely inexpensive. This scheme only uses a single call to a one-dimensional HLL or LLF Riemann solver at each face, thus guaranteeing that it is very lightweight compared to any higher order scheme. In other words, we have carried out extensive numerical experimentation to show that for such a scheme, if all the variables in all the zones are PCP at the beginning of a forward Euler timestep, then they will remain PCP at the end of the timestep. This is a good observation because it gives us something to build on.
For any first order scheme we can always average facial magnetic fields to obtain zone-centered magnetic fields. Because the facial magnetic fields are our primal magnetic fields, those fields will have to be updated using first order accurate edge-centered electric fields, as described in eqns. (3.6) to (16) , or more simply in eqn. (17) . As in the previous paragraph, this only requires one, extremely light weight evaluation of the 2D Riemann solver at each edge and eqn. (17) shows that this evaluation is computationally very inexpensive. Even for the most stringent of problems, such a scheme will remain PCP in most of the zones. There will be a rare few zones where the averaging of the facial magnetic fields to the zone centers will indeed destroy the PCP property. To get a bullet-proof scheme, we have to find a way to cure this problem. (The subsequent nonlinear hybridization of such a low order PCP scheme with a higher order scheme that is not PCP will be described in the next Sub-Section.)
Let us re-articulate the previous paragraph in mathematical terms to make it more comprehensible. We start with U ‾ i , j , k n ; L O \overline{\mathbf{U}}_{i,j,k}^{n;LO} U i , j , k n ; L O where the sixth, seventh and eighth components of U ‾ i , j , k n ; L O \overline{\mathbf{U}}_{i,j,k}^{n;LO} U i , j , k n ; L O have been replaced by ( B ‾ x ; i + 1 / 2 , j , k n ; L O + B ‾ x ; i − 1 / 2 , j , k n ; L O ) / 2 (\overline{B}_{x;i+1/2,j,k}^{n;LO}+\overline{B}_{x;i-1/2,j,k}^{n;LO})/2 ( B x ; i + 1/2 , j , k n ; L O + B x ; i − 1/2 , j , k n ; L O ) /2 , ( B ‾ y ; i , j + 1 / 2 , k n ; L O + B ‾ y ; i , j − 1 / 2 , k n ; L O ) / 2 (\overline{B}_{y;i,j+1/2,k}^{n;LO}+\overline{B}_{y;i,j-1/2,k}^{n;LO})/2 ( B y ; i , j + 1/2 , k n ; L O + B y ; i , j − 1/2 , k n ; L O ) /2 and ( B ‾ z ; i , j , k + 1 / 2 n ; L O + B ‾ z ; i , j , k − 1 / 2 n ; L O ) / 2 (\overline{B}_{z;i,j,k+1/2}^{n;LO}+\overline{B}_{z;i,j,k-1/2}^{n;LO})/2 ( B z ; i , j , k + 1/2 n ; L O + B z ; i , j , k − 1/2 n ; L O ) /2 . We start by assuming that U ‾ i , j , k n ; L O \overline{\mathbf{U}}_{i,j,k}^{n;LO} U i , j , k n ; L O is PCP. We then make the updates:-
U ~ i , j , k n + 1 ; L O = U ‾ i , j , k n ; L O − Δ t Δ x ( F ‾ i + 1 / 2 , j , k L O − F ‾ i − 1 / 2 , j , k L O ) − Δ t Δ y ( G ‾ i , j + 1 / 2 , k L O − G ‾ i , j − 1 / 2 , k L O ) − Δ t Δ z ( H ‾ i , j , k + 1 / 2 L O − H ‾ i , j , k − 1 / 2 L O ) (32) \widetilde{\mathbf{U}}_{i,j,k}^{n+1;LO}=\overline{\mathbf{U}}_{i,j,k}^{n;LO}-\frac{\Delta t}{\Delta x}\left(\overline{\mathbf{F}}_{i+1/2,j,k}^{LO}-\overline{\mathbf{F}}_{i-1/2,j,k}^{LO}\right)-\frac{\Delta t}{\Delta y}\left(\overline{\mathbf{G}}_{i,j+1/2,k}^{LO}-\overline{\mathbf{G}}_{i,j-1/2,k}^{LO}\right)-\frac{\Delta t}{\Delta z}\left(\overline{\mathbf{H}}_{i,j,k+1/2}^{LO}-\overline{\mathbf{H}}_{i,j,k-1/2}^{LO}\right) \tag*{(32)} U i , j , k n + 1 ; L O = U i , j , k n ; L O − Δ x Δ t ( F i + 1/2 , j , k L O − F i − 1/2 , j , k L O ) − Δ y Δ t ( G i , j + 1/2 , k L O − G i , j − 1/2 , k L O ) − Δ z Δ t ( H i , j , k + 1/2 L O − H i , j , k − 1/2 L O ) (32)
B ‾ x ; i + 1 / 2 , j , k n + 1 ; L O = B ‾ x ; i + 1 / 2 , j , k n ; L O − Δ t Δ y Δ z ( Δ z E ‾ z ; i + 1 / 2 , j + 1 / 2 , k L O − Δ z E ‾ z ; i + 1 / 2 , j − 1 / 2 , k L O + Δ y E ‾ y ; i + 1 / 2 , j , k − 1 / 2 L O − Δ y E ‾ y ; i + 1 / 2 , j , k + 1 / 2 L O ) (33) \overline{B}_{x;i+1/2,j,k}^{n+1;LO}=\overline{B}_{x;i+1/2,j,k}^{n;LO}-\frac{\Delta t}{\Delta y\Delta z}\left(\Delta z\overline{E}_{z;i+1/2,j+1/2,k}^{LO}-\Delta z\overline{E}_{z;i+1/2,j-1/2,k}^{LO}+\Delta y\overline{E}_{y;i+1/2,j,k-1/2}^{LO}-\Delta y\overline{E}_{y;i+1/2,j,k+1/2}^{LO}\right) \tag*{(33)} B x ; i + 1/2 , j , k n + 1 ; L O = B x ; i + 1/2 , j , k n ; L O − Δ y Δ z Δ t ( Δ z E z ; i + 1/2 , j + 1/2 , k L O − Δ z E z ; i + 1/2 , j − 1/2 , k L O + Δ y E y ; i + 1/2 , j , k − 1/2 L O − Δ y E y ; i + 1/2 , j , k + 1/2 L O ) (33)
B ‾ y ; i , j + 1 / 2 , k n + 1 ; L O = B ‾ y ; i , j + 1 / 2 , k n ; L O − Δ t Δ x Δ z ( Δ x E ‾ x ; i , j − 1 / 2 , k + 1 / 2 L O − Δ x E ‾ x ; i , j − 1 / 2 , k − 1 / 2 L O + Δ z E ‾ z ; i − 1 / 2 , j − 1 / 2 , k L O − Δ z E ‾ z ; i + 1 / 2 , j − 1 / 2 , k L O ) (34) \overline{B}_{y;i,j+1/2,k}^{n+1;LO}=\overline{B}_{y;i,j+1/2,k}^{n;LO}-\frac{\Delta t}{\Delta x\Delta z}\left(\Delta x\overline{E}_{x;i,j-1/2,k+1/2}^{LO}-\Delta x\overline{E}_{x;i,j-1/2,k-1/2}^{LO}+\Delta z\overline{E}_{z;i-1/2,j-1/2,k}^{LO}-\Delta z\overline{E}_{z;i+1/2,j-1/2,k}^{LO}\right) \tag*{(34)} B y ; i , j + 1/2 , k n + 1 ; L O = B y ; i , j + 1/2 , k n ; L O − Δ x Δ z Δ t ( Δ x E x ; i , j − 1/2 , k + 1/2 L O − Δ x E x ; i , j − 1/2 , k − 1/2 L O + Δ z E z ; i − 1/2 , j − 1/2 , k L O − Δ z E z ; i + 1/2 , j − 1/2 , k L O ) (34)
B ‾ z ; i , j , k + 1 / 2 n + 1 ; L O = B ‾ z ; i , j , k + 1 / 2 n ; L O − Δ t Δ x Δ y ( Δ x E ‾ x ; i , j − 1 / 2 , k + 1 / 2 L O − Δ x E ‾ x ; i , j + 1 / 2 , k + 1 / 2 L O + Δ y E ‾ y ; i + 1 / 2 , j , k + 1 / 2 L O − Δ y E ‾ y ; i − 1 / 2 , j , k + 1 / 2 L O ) (35) \overline{B}_{z;i,j,k+1/2}^{n+1;LO}=\overline{B}_{z;i,j,k+1/2}^{n;LO}-\frac{\Delta t}{\Delta x\Delta y}\left(\Delta x\overline{E}_{x;i,j-1/2,k+1/2}^{LO}-\Delta x\overline{E}_{x;i,j+1/2,k+1/2}^{LO}+\Delta y\overline{E}_{y;i+1/2,j,k+1/2}^{LO}-\Delta y\overline{E}_{y;i-1/2,j,k+1/2}^{LO}\right) \tag*{(35)} B z ; i , j , k + 1/2 n + 1 ; L O = B z ; i , j , k + 1/2 n ; L O − Δ x Δ y Δ t ( Δ x E x ; i , j − 1/2 , k + 1/2 L O − Δ x E x ; i , j + 1/2 , k + 1/2 L O + Δ y E y ; i + 1/2 , j , k + 1/2 L O − Δ y E y ; i − 1/2 , j , k + 1/2 L O ) (35)
Now realize that because U ‾ i , j , k n ; L O \overline{\mathbf{U}}_{i,j,k}^{n;LO} U i , j , k n ; L O started off PCP, and because eqn. (32) is a first order update with a PCP-preserving flux, we are guaranteed that the updated zone-centered variable U ~ i , j , k n + 1 ; L O \widetilde{\mathbf{U}}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O will be PCP. It is only when the sixth, seventh and eighth components of U ~ i , j , k n + 1 ; L O \widetilde{\mathbf{U}}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O are replaced with ( B ‾ x ; i + 1 / 2 , j , k n + 1 ; L O + B ‾ x ; i − 1 / 2 , j , k n + 1 ; L O ) / 2 (\overline{\mathbf{B}}_{x;i+1/2,j,k}^{n+1;LO}+\overline{\mathbf{B}}_{x;i-1/2,j,k}^{n+1;LO})/2 ( B x ; i + 1/2 , j , k n + 1 ; L O + B x ; i − 1/2 , j , k n + 1 ; L O ) /2 , ( B ‾ y ; i , j + 1 / 2 , k n + 1 ; L O + B ‾ y ; i , j − 1 / 2 , k n + 1 ; L O ) / 2 (\overline{\mathbf{B}}_{y;i,j+1/2,k}^{n+1;LO}+\overline{\mathbf{B}}_{y;i,j-1/2,k}^{n+1;LO})/2 ( B y ; i , j + 1/2 , k n + 1 ; L O + B y ; i , j − 1/2 , k n + 1 ; L O ) /2 and ( B ‾ z ; i , j , k + 1 / 2 n + 1 ; L O + B ‾ z ; i , j , k − 1 / 2 n + 1 ; L O ) / 2 (\overline{\mathbf{B}}_{z;i,j,k+1/2}^{n+1;LO}+\overline{\mathbf{B}}_{z;i,j,k-1/2}^{n+1;LO})/2 ( B z ; i , j , k + 1/2 n + 1 ; L O + B z ; i , j , k − 1/2 n + 1 ; L O ) /2 that we have the possibility of losing the PCP property in a few rare zones! After the replacement of the sixth, seventh and eighth components of U ~ i , j , k n + 1 ; L O \widetilde{\mathbf{U}}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O by the facial averages, let us call the zone-centered variables U ‾ i , j , k n + 1 ; L O \overline{\mathbf{U}}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O . So it is this replacement by the facial averages that may, in a few rare zones, turn U ~ i , j , k n + 1 ; L O \widetilde{\mathbf{U}}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O (which is PCP) into U ‾ i , j , k n + 1 ; L O \overline{\mathbf{U}}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O (which may not be PCP). Our task is to fix this situation.
When the problem is cast this way, two clear fixes are obvious. The first fix is a fully conservative fix and we describe it in this paragraph. It finds its inspiration from recent work by Abgrall [1 , 2 ] . Realize that when U ‾ i , j , k n + 1 ; L O \overline{\mathbf{U}}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O loses the PCP property, it does so because of the slightest discretization error; i.e. the facial fluxes that were used to update the zone-centered energy did not bring in enough energy from neighboring zones to keep U ‾ i , j , k n + 1 ; L O \overline{\mathbf{U}}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O PCP. Let [ X ] 5 [\mathbf{X}]_5 [ X ] 5 denote the fifth component of a vector X \mathbf{X} X ; this is just a choice of notation. We can ever so slightly modify the fifth component of the flux for the MHD case as follows:-
[ F ~ i + 1 / 2 , j , k L O ] 5 = [ F ‾ i + 1 / 2 , j , k L O ] 5 − w ‾ i + 1 / 2 , j , k α ; [ F ~ i − 1 / 2 , j , k L O ] 5 = [ F ‾ i − 1 / 2 , j , k L O ] 5 + w ‾ i − 1 / 2 , j , k + α ; [ G ~ i , j + 1 / 2 , k L O ] 5 = [ G ‾ i , j + 1 / 2 , k L O ] 5 − w ‾ i , j + 1 / 2 , k α ; [ G ~ i , j − 1 / 2 , k L O ] 5 = [ G ‾ i , j − 1 / 2 , k L O ] 5 + w ‾ i , j − 1 / 2 , k + α ; [ H ~ i , j , k + 1 / 2 L O ] 5 = [ H ‾ i , j , k + 1 / 2 L O ] 5 − w ‾ i , j , k + 1 / 2 α ; [ H ~ i , j , k − 1 / 2 L O ] 5 = [ H ‾ i , j , k − 1 / 2 L O ] 5 + w ‾ i , j , k − 1 / 2 + α ; (36) \begin{aligned}
[\widetilde{\mathbf{F}}_{i+1/2,j,k}^{LO}]_5 &= [\overline{\mathbf{F}}_{i+1/2,j,k}^{LO}]_5-\overline{w}_{i+1/2,j,k}\alpha\ ;\quad[\widetilde{\mathbf{F}}_{i-1/2,j,k}^{LO}]_5=[\overline{\mathbf{F}}_{i-1/2,j,k}^{LO}]_5+\overline{w}_{i-1/2,j,k}^{+}\alpha\ ;\\
[\widetilde{\mathbf{G}}_{i,j+1/2,k}^{LO}]_5 &= [\overline{\mathbf{G}}_{i,j+1/2,k}^{LO}]_5-\overline{w}_{i,j+1/2,k}\alpha\ ;\quad[\widetilde{\mathbf{G}}_{i,j-1/2,k}^{LO}]_5=[\overline{\mathbf{G}}_{i,j-1/2,k}^{LO}]_5+\overline{w}_{i,j-1/2,k}^{+}\alpha\ ;\\
[\widetilde{\mathbf{H}}_{i,j,k+1/2}^{LO}]_5 &= [\overline{\mathbf{H}}_{i,j,k+1/2}^{LO}]_5-\overline{w}_{i,j,k+1/2}\alpha\ ;\quad[\widetilde{\mathbf{H}}_{i,j,k-1/2}^{LO}]_5=[\overline{\mathbf{H}}_{i,j,k-1/2}^{LO}]_5+\overline{w}_{i,j,k-1/2}^{+}\alpha\ ; \tag*{(36)}
\end{aligned} [ F i + 1/2 , j , k L O ] 5 [ G i , j + 1/2 , k L O ] 5 [ H i , j , k + 1/2 L O ] 5 = [ F i + 1/2 , j , k L O ] 5 − w i + 1/2 , j , k α ; [ F i − 1/2 , j , k L O ] 5 = [ F i − 1/2 , j , k L O ] 5 + w i − 1/2 , j , k + α ; = [ G i , j + 1/2 , k L O ] 5 − w i , j + 1/2 , k α ; [ G i , j − 1/2 , k L O ] 5 = [ G i , j − 1/2 , k L O ] 5 + w i , j − 1/2 , k + α ; = [ H i , j , k + 1/2 L O ] 5 − w i , j , k + 1/2 α ; [ H i , j , k − 1/2 L O ] 5 = [ H i , j , k − 1/2 L O ] 5 + w i , j , k − 1/2 + α ; (36)
The w ‾ \overline{w} w variables will be described shortly and they are just a measure of a neighboring zone’s ability to give enough energy to the troubled zone so that the troubled zone has a positive pressure. We can then quantify the variable “α \alpha α ” in the above equation by setting it by using the equation:-
1 8 π { ( B ‾ x ; i + 1 / 2 , j , k n + 1 ; L O + B ‾ x ; i − 1 / 2 , j , k n + 1 ; L O 2 ) 2 + ( B ‾ y ; i , j + 1 / 2 , k n + 1 ; L O + B ‾ y ; i , j − 1 / 2 , k n + 1 ; L O 2 ) 2 + ( B ‾ z ; i , j , k + 1 / 2 n + 1 ; L O + B ‾ z ; i , j , k − 1 / 2 n + 1 ; L O 2 ) 2 − ( [ U ~ i , j , k n + 1 ; L O ] 6 ) 2 − ( [ U ~ i , j , k n + 1 ; L O ] 7 ) 2 − ( [ U ~ i , j , k n + 1 ; L O ] 8 ) 2 } = α { Δ t Δ x ( w ‾ i + 1 / 2 , j , k + w ‾ i − 1 / 2 , j , k + ) + Δ t Δ y ( w ‾ i , j + 1 / 2 , k + w ‾ i , j − 1 / 2 , k + ) + Δ t Δ z ( w ‾ i , j , k + 1 / 2 + w ‾ i , j , k − 1 / 2 + ) } (37) \begin{aligned}
\frac{1}{8\pi}\Bigg\{&\left(\frac{\overline{B}_{x;i+1/2,j,k}^{n+1;LO}+\overline{B}_{x;i-1/2,j,k}^{n+1;LO}}{2}\right)^2+\left(\frac{\overline{B}_{y;i,j+1/2,k}^{n+1;LO}+\overline{B}_{y;i,j-1/2,k}^{n+1;LO}}{2}\right)^2\\
&+\left(\frac{\overline{B}_{z;i,j,k+1/2}^{n+1;LO}+\overline{B}_{z;i,j,k-1/2}^{n+1;LO}}{2}\right)^2-\left([\widetilde{U}_{i,j,k}^{n+1;LO}]_6\right)^2-\left([\widetilde{U}_{i,j,k}^{n+1;LO}]_7\right)^2-\left([\widetilde{U}_{i,j,k}^{n+1;LO}]_8\right)^2\Bigg\}\\
&=\alpha\left\{\frac{\Delta t}{\Delta x}\left(\overline{w}_{i+1/2,j,k}+\overline{w}_{i-1/2,j,k}^{+}\right)+\frac{\Delta t}{\Delta y}\left(\overline{w}_{i,j+1/2,k}+\overline{w}_{i,j-1/2,k}^{+}\right)+\frac{\Delta t}{\Delta z}\left(\overline{w}_{i,j,k+1/2}+\overline{w}_{i,j,k-1/2}^{+}\right)\right\} \tag*{(37)}
\end{aligned} 8 π 1 { 2 B x ; i + 1/2 , j , k n + 1 ; L O + B x ; i − 1/2 , j , k n + 1 ; L O 2 + 2 B y ; i , j + 1/2 , k n + 1 ; L O + B y ; i , j − 1/2 , k n + 1 ; L O 2 + 2 B z ; i , j , k + 1/2 n + 1 ; L O + B z ; i , j , k − 1/2 n + 1 ; L O 2 − ( [ U i , j , k n + 1 ; L O ] 6 ) 2 − ( [ U i , j , k n + 1 ; L O ] 7 ) 2 − ( [ U i , j , k n + 1 ; L O ] 8 ) 2 } = α { Δ x Δ t ( w i + 1/2 , j , k + w i − 1/2 , j , k + ) + Δ y Δ t ( w i , j + 1/2 , k + w i , j − 1/2 , k + ) + Δ z Δ t ( w i , j , k + 1/2 + w i , j , k − 1/2 + ) } (37)
Then we can set
w ˉ i + 1 / 2 , j , k − = ( max ( P i + 1 , j , k n ; L O − P min , 0 ) ) χ ; w ˉ i − 1 / 2 , j , k + = ( max ( P i − 1 , j , k n ; L O − P min , 0 ) ) χ ; w ˉ i , j + 1 / 2 , k − = ( max ( P i , j + 1 , k n ; L O − P min , 0 ) ) χ ; w ˉ i , j − 1 / 2 , k + = ( max ( P i , j − 1 , k n ; L O − P min , 0 ) ) χ ; w ˉ i , j , k + 1 / 2 − = ( max ( P i , j , k + 1 n ; L O − P min , 0 ) ) χ ; w ˉ i , j , k − 1 / 2 + = ( max ( P i , j , k − 1 n ; L O − P min , 0 ) ) χ . (38) \begin{aligned}
\bar{w}^{-}_{i+1/2,j,k} &= \left(\max\left(P^{n;LO}_{i+1,j,k}-P_{\min},0\right)\right)^{\chi}; &
\bar{w}^{+}_{i-1/2,j,k} &= \left(\max\left(P^{n;LO}_{i-1,j,k}-P_{\min},0\right)\right)^{\chi}; &
\bar{w}^{-}_{i,j+1/2,k} &= \left(\max\left(P^{n;LO}_{i,j+1,k}-P_{\min},0\right)\right)^{\chi};\\
\bar{w}^{+}_{i,j-1/2,k} &= \left(\max\left(P^{n;LO}_{i,j-1,k}-P_{\min},0\right)\right)^{\chi}; &
\bar{w}^{-}_{i,j,k+1/2} &= \left(\max\left(P^{n;LO}_{i,j,k+1}-P_{\min},0\right)\right)^{\chi}; &
\bar{w}^{+}_{i,j,k-1/2} &= \left(\max\left(P^{n;LO}_{i,j,k-1}-P_{\min},0\right)\right)^{\chi}. \tag*{(38)}
\end{aligned} w ˉ i + 1/2 , j , k − w ˉ i , j − 1/2 , k + = ( max ( P i + 1 , j , k n ; L O − P m i n , 0 ) ) χ ; = ( max ( P i , j − 1 , k n ; L O − P m i n , 0 ) ) χ ; w ˉ i − 1/2 , j , k + w ˉ i , j , k + 1/2 − = ( max ( P i − 1 , j , k n ; L O − P m i n , 0 ) ) χ ; = ( max ( P i , j , k + 1 n ; L O − P m i n , 0 ) ) χ ; w ˉ i , j + 1/2 , k − w ˉ i , j , k − 1/2 + = ( max ( P i , j + 1 , k n ; L O − P m i n , 0 ) ) χ ; = ( max ( P i , j , k − 1 n ; L O − P m i n , 0 ) ) χ . (38)
with χ ≥ 1 \chi\ge1 χ ≥ 1 . We use χ = 2 \chi= 2 χ = 2 and P min P_{\min} P m i n is a user-settable small parameter. (We have set P min = 10 − 3 P_{\min}=10^{-3} P m i n = 1 0 − 3 for all the tests reported here.) The pressures in the above equation stand as proxies for the thermal energy in those zones, but we can also use the actual thermal energy in those zones if we wish. The weights with overbars can then be normalized so that they add to unity in a WENO-style normalization that goes as follows
w ˉ i + 1 / 2 , j , k − = w ˉ i + 1 / 2 , j , k − / ( w ˉ i + 1 / 2 , j , k − + w ˉ i − 1 / 2 , j , k + + w ˉ i , j + 1 / 2 , k − + w ˉ i , j − 1 / 2 , k + + w ˉ i , j , k + 1 / 2 − + w ˉ i , j , k − 1 / 2 + ) , w ˉ i − 1 / 2 , j , k + = w ˉ i − 1 / 2 , j , k + / ( w ˉ i + 1 / 2 , j , k − + w ˉ i − 1 / 2 , j , k + + w ˉ i , j + 1 / 2 , k − + w ˉ i , j − 1 / 2 , k + + w ˉ i , j , k + 1 / 2 − + w ˉ i , j , k − 1 / 2 + ) , w ˉ i , j + 1 / 2 , k − = w ˉ i , j + 1 / 2 , k − / ( w ˉ i + 1 / 2 , j , k − + w ˉ i − 1 / 2 , j , k + + w ˉ i , j + 1 / 2 , k − + w ˉ i , j − 1 / 2 , k + + w ˉ i , j , k + 1 / 2 − + w ˉ i , j , k − 1 / 2 + ) , w ˉ i , j − 1 / 2 , k + = w ˉ i , j − 1 / 2 , k + / ( w ˉ i + 1 / 2 , j , k − + w ˉ i − 1 / 2 , j , k + + w ˉ i , j + 1 / 2 , k − + w ˉ i , j − 1 / 2 , k + + w ˉ i , j , k + 1 / 2 − + w ˉ i , j , k − 1 / 2 + ) , w ˉ i , j , k + 1 / 2 − = w ˉ i , j , k + 1 / 2 − / ( w ˉ i + 1 / 2 , j , k − + w ˉ i − 1 / 2 , j , k + + w ˉ i , j + 1 / 2 , k − + w ˉ i , j − 1 / 2 , k + + w ˉ i , j , k + 1 / 2 − + w ˉ i , j , k − 1 / 2 + ) , w ˉ i , j , k − 1 / 2 + = w ˉ i , j , k − 1 / 2 + / ( w ˉ i + 1 / 2 , j , k − + w ˉ i − 1 / 2 , j , k + + w ˉ i , j + 1 / 2 , k − + w ˉ i , j − 1 / 2 , k + + w ˉ i , j , k + 1 / 2 − + w ˉ i , j , k − 1 / 2 + ) . (39) \begin{aligned}
\bar{w}^{-}_{i+1/2,j,k} &= \bar{w}^{-}_{i+1/2,j,k}\big/\left(\bar{w}^{-}_{i+1/2,j,k}+\bar{w}^{+}_{i-1/2,j,k}+\bar{w}^{-}_{i,j+1/2,k}+\bar{w}^{+}_{i,j-1/2,k}+\bar{w}^{-}_{i,j,k+1/2}+\bar{w}^{+}_{i,j,k-1/2}\right),\\
\bar{w}^{+}_{i-1/2,j,k} &= \bar{w}^{+}_{i-1/2,j,k}\big/\left(\bar{w}^{-}_{i+1/2,j,k}+\bar{w}^{+}_{i-1/2,j,k}+\bar{w}^{-}_{i,j+1/2,k}+\bar{w}^{+}_{i,j-1/2,k}+\bar{w}^{-}_{i,j,k+1/2}+\bar{w}^{+}_{i,j,k-1/2}\right),\\
\bar{w}^{-}_{i,j+1/2,k} &= \bar{w}^{-}_{i,j+1/2,k}\big/\left(\bar{w}^{-}_{i+1/2,j,k}+\bar{w}^{+}_{i-1/2,j,k}+\bar{w}^{-}_{i,j+1/2,k}+\bar{w}^{+}_{i,j-1/2,k}+\bar{w}^{-}_{i,j,k+1/2}+\bar{w}^{+}_{i,j,k-1/2}\right),\\
\bar{w}^{+}_{i,j-1/2,k} &= \bar{w}^{+}_{i,j-1/2,k}\big/\left(\bar{w}^{-}_{i+1/2,j,k}+\bar{w}^{+}_{i-1/2,j,k}+\bar{w}^{-}_{i,j+1/2,k}+\bar{w}^{+}_{i,j-1/2,k}+\bar{w}^{-}_{i,j,k+1/2}+\bar{w}^{+}_{i,j,k-1/2}\right),\\
\bar{w}^{-}_{i,j,k+1/2} &= \bar{w}^{-}_{i,j,k+1/2}\big/\left(\bar{w}^{-}_{i+1/2,j,k}+\bar{w}^{+}_{i-1/2,j,k}+\bar{w}^{-}_{i,j+1/2,k}+\bar{w}^{+}_{i,j-1/2,k}+\bar{w}^{-}_{i,j,k+1/2}+\bar{w}^{+}_{i,j,k-1/2}\right),\\
\bar{w}^{+}_{i,j,k-1/2} &= \bar{w}^{+}_{i,j,k-1/2}\big/\left(\bar{w}^{-}_{i+1/2,j,k}+\bar{w}^{+}_{i-1/2,j,k}+\bar{w}^{-}_{i,j+1/2,k}+\bar{w}^{+}_{i,j-1/2,k}+\bar{w}^{-}_{i,j,k+1/2}+\bar{w}^{+}_{i,j,k-1/2}\right). \tag*{(39)}
\end{aligned} w ˉ i + 1/2 , j , k − w ˉ i − 1/2 , j , k + w ˉ i , j + 1/2 , k − w ˉ i , j − 1/2 , k + w ˉ i , j , k + 1/2 − w ˉ i , j , k − 1/2 + = w ˉ i + 1/2 , j , k − / ( w ˉ i + 1/2 , j , k − + w ˉ i − 1/2 , j , k + + w ˉ i , j + 1/2 , k − + w ˉ i , j − 1/2 , k + + w ˉ i , j , k + 1/2 − + w ˉ i , j , k − 1/2 + ) , = w ˉ i − 1/2 , j , k + / ( w ˉ i + 1/2 , j , k − + w ˉ i − 1/2 , j , k + + w ˉ i , j + 1/2 , k − + w ˉ i , j − 1/2 , k + + w ˉ i , j , k + 1/2 − + w ˉ i , j , k − 1/2 + ) , = w ˉ i , j + 1/2 , k − / ( w ˉ i + 1/2 , j , k − + w ˉ i − 1/2 , j , k + + w ˉ i , j + 1/2 , k − + w ˉ i , j − 1/2 , k + + w ˉ i , j , k + 1/2 − + w ˉ i , j , k − 1/2 + ) , = w ˉ i , j − 1/2 , k + / ( w ˉ i + 1/2 , j , k − + w ˉ i − 1/2 , j , k + + w ˉ i , j + 1/2 , k − + w ˉ i , j − 1/2 , k + + w ˉ i , j , k + 1/2 − + w ˉ i , j , k − 1/2 + ) , = w ˉ i , j , k + 1/2 − / ( w ˉ i + 1/2 , j , k − + w ˉ i − 1/2 , j , k + + w ˉ i , j + 1/2 , k − + w ˉ i , j − 1/2 , k + + w ˉ i , j , k + 1/2 − + w ˉ i , j , k − 1/2 + ) , = w ˉ i , j , k − 1/2 + / ( w ˉ i + 1/2 , j , k − + w ˉ i − 1/2 , j , k + + w ˉ i , j + 1/2 , k − + w ˉ i , j − 1/2 , k + + w ˉ i , j , k + 1/2 − + w ˉ i , j , k − 1/2 + ) . (39)
We see from this formulation that as long as a troubled zone has as at least one neighboring zone that can lend it some thermal energy, it will be able to obtain some extra energy to restore its positive pressure. This completes our description of the first fix, which is a fully conservative fix.
It is also possible that a zone may not have any von Neumann neighbors that have sufficient energy to lend it some thermal energy. Only in those rare occasions we take a different approach. Realize that U ~ i , j , k n + 1 ; L O \widetilde{U}^{n+1;LO}_{i,j,k} U i , j , k n + 1 ; L O is still PCP, so it still has positive pressure. Therefore, we already have a pressure in the troubled zone that is positive, except that it was obtained via the update in eqn. (5.1). We can reset the troubled zone to have that same positive pressure as follows:-
[ U ˉ i , j , k n + 1 ; L O ] 5 = [ U ~ i , j , k n + 1 ; L O ] 5 + [ S i , j , k L O ] 5 with the definition \left[\bar{U}^{n+1;LO}_{i,j,k}\right]_5=\left[\widetilde{U}^{n+1;LO}_{i,j,k}\right]_5+\left[S^{LO}_{i,j,k}\right]_5
\qquad\text{with the definition} [ U ˉ i , j , k n + 1 ; L O ] 5 = [ U i , j , k n + 1 ; L O ] 5 + [ S i , j , k L O ] 5 with the definition
[ S i , j , k L O ] 5 ≡ 1 8 π { ( [ B ˉ x ; i + 1 / 2 , j , k n + 1 ; L O + B ˉ x ; i − 1 / 2 , j , k n + 1 ; L O ] 2 ) 2 + ( [ B ˉ y ; i , j + 1 / 2 , k n + 1 ; L O + B ˉ y ; i , j − 1 / 2 , k n + 1 ; L O ] 2 ) 2 + ( [ B ˉ z ; i , j , k + 1 / 2 n + 1 ; L O + B ˉ z ; i , j , k − 1 / 2 n + 1 ; L O ] 2 ) 2 − ( [ U ~ i , j , k n + 1 ; L O ] 6 ) 2 − ( [ U ~ i , j , k n + 1 ; L O ] 7 ) 2 − ( [ U ~ i , j , k n + 1 ; L O ] 8 ) 2 } . (40) \left[S^{LO}_{i,j,k}\right]_5\equiv\frac{1}{8\pi}\left\{\left(\frac{\left[\bar{B}^{n+1;LO}_{x;i+1/2,j,k}+\bar{B}^{n+1;LO}_{x;i-1/2,j,k}\right]}{2}\right)^2+\left(\frac{\left[\bar{B}^{n+1;LO}_{y;i,j+1/2,k}+\bar{B}^{n+1;LO}_{y;i,j-1/2,k}\right]}{2}\right)^2+\left(\frac{\left[\bar{B}^{n+1;LO}_{z;i,j,k+1/2}+\bar{B}^{n+1;LO}_{z;i,j,k-1/2}\right]}{2}\right)^2-\left(\left[\widetilde{U}^{n+1;LO}_{i,j,k}\right]_6\right)^2-\left(\left[\widetilde{U}^{n+1;LO}_{i,j,k}\right]_7\right)^2-\left(\left[\widetilde{U}^{n+1;LO}_{i,j,k}\right]_8\right)^2\right\}. \tag*{(40)} [ S i , j , k L O ] 5 ≡ 8 π 1 ⎩ ⎨ ⎧ 2 [ B ˉ x ; i + 1/2 , j , k n + 1 ; L O + B ˉ x ; i − 1/2 , j , k n + 1 ; L O ] 2 + 2 [ B ˉ y ; i , j + 1/2 , k n + 1 ; L O + B ˉ y ; i , j − 1/2 , k n + 1 ; L O ] 2 + 2 [ B ˉ z ; i , j , k + 1/2 n + 1 ; L O + B ˉ z ; i , j , k − 1/2 n + 1 ; L O ] 2 − ( [ U i , j , k n + 1 ; L O ] 6 ) 2 − ( [ U i , j , k n + 1 ; L O ] 7 ) 2 − ( [ U i , j , k n + 1 ; L O ] 8 ) 2 ⎭ ⎬ ⎫ . (40)
The low order source term [ S i , j , k L O ] 5 \left[\mathbf{S}^{LO}_{i,j,k}\right]_5 [ S i , j , k L O ] 5 contributes only to the fifth component, which is the energy equation, for MHD. Only the 5th component of the source term vector S i , j , k L O \mathbf{S}^{LO}_{i,j,k} S i , j , k L O is non-zero and that too only for zones that have lost the PCP property in the first order update. Note that eqn. (5.9) constitutes a very slight loss of energy conservation. But we will document this loss of energy conservation for very stringent problems in the results Section and show that this loss of energy conservation is absolutely inconsequential. The really big advantage of this lower order formulation is that we always have a PCP formulation that is divergence-free which can be used to guide the higher order scheme so that it always remains divergence-free and PCP. In the next Sub-Section we will show how we do this in the most unobtrusive of ways so that for the most part we only use the high order scheme, only resorting to the lower order scheme from this Sub-Section in zones where the PCP property may be lost. Here we have only described the fix in the context of non-relativistic MHD, but the extension to RMHD is described in the Appendix.
Hybridizing the First Order PCP Scheme with the Higher Order Scheme
In each zone ( i , j , k ) (i,j,k) ( i , j , k ) we define a variable θ i , j , k \theta_{i,j,k} θ i , j , k . We will design a method such that when θ i , j , k = 1 \theta_{i,j,k}=1 θ i , j , k = 1 for all the zones, the scheme will exclusively be a high order scheme; this is the default when the astrophysical problem is not too stringent. When θ i , j , k = 0 \theta_{i,j,k}=0 θ i , j , k = 0 for all the zones, the scheme will exclusively be a first order scheme. Of course, it is not our intent to have θ i , j , k = 0 \theta_{i,j,k}=0 θ i , j , k = 0 in any of the zones, but for stringent problems, we might have θ i , j , k = 0 \theta_{i,j,k}=0 θ i , j , k = 0 in some of the zones. At each zone boundary we can define a flux by
F ‾ i + 1 / 2 , j , k θ = ( 1 − θ i + 1 / 2 , j , k f a c e ) F ‾ i + 1 / 2 , j , k L O + θ i + 1 / 2 , j , k f a c e F ‾ i + 1 / 2 , j , k H O with θ i + 1 / 2 , j , k f a c e ≡ min ( θ i , j , k , θ i + 1 , j , k ) ; G ‾ i , j + 1 / 2 , k θ = ( 1 − θ i , j + 1 / 2 , k f a c e ) G ‾ i , j + 1 / 2 , k L O + θ i , j + 1 / 2 , k f a c e G ‾ i , j + 1 / 2 , k H O with θ i , j + 1 / 2 , k f a c e ≡ min ( θ i , j , k , θ i , j + 1 , k ) ; H ‾ i , j , k + 1 / 2 θ = ( 1 − θ i , j , k + 1 / 2 f a c e ) H ‾ i , j , k + 1 / 2 L O + θ i , j , k + 1 / 2 f a c e H ‾ i , j , k + 1 / 2 H O with θ i , j , k + 1 / 2 f a c e ≡ min ( θ i , j , k , θ i , j , k + 1 ) (41) \begin{aligned}
\overline{\mathbf{F}}^{\theta}_{i+1/2,j,k} &= \left(1-\theta^{face}_{i+1/2,j,k}\right)\overline{\mathbf{F}}^{LO}_{i+1/2,j,k}+\theta^{face}_{i+1/2,j,k}\overline{\mathbf{F}}^{HO}_{i+1/2,j,k} \quad\text{with}\quad\theta^{face}_{i+1/2,j,k}\equiv\min\left(\theta_{i,j,k},\theta_{i+1,j,k}\right); \\
\overline{\mathbf{G}}^{\theta}_{i,j+1/2,k} &= \left(1-\theta^{face}_{i,j+1/2,k}\right)\overline{\mathbf{G}}^{LO}_{i,j+1/2,k}+\theta^{face}_{i,j+1/2,k}\overline{\mathbf{G}}^{HO}_{i,j+1/2,k} \quad\text{with}\quad\theta^{face}_{i,j+1/2,k}\equiv\min\left(\theta_{i,j,k},\theta_{i,j+1,k}\right); \\
\overline{\mathbf{H}}^{\theta}_{i,j,k+1/2} &= \left(1-\theta^{face}_{i,j,k+1/2}\right)\overline{\mathbf{H}}^{LO}_{i,j,k+1/2}+\theta^{face}_{i,j,k+1/2}\overline{\mathbf{H}}^{HO}_{i,j,k+1/2} \quad\text{with}\quad\theta^{face}_{i,j,k+1/2}\equiv\min\left(\theta_{i,j,k},\theta_{i,j,k+1}\right) \tag*{(41)}
\end{aligned} F i + 1/2 , j , k θ G i , j + 1/2 , k θ H i , j , k + 1/2 θ = ( 1 − θ i + 1/2 , j , k f a ce ) F i + 1/2 , j , k L O + θ i + 1/2 , j , k f a ce F i + 1/2 , j , k H O with θ i + 1/2 , j , k f a ce ≡ min ( θ i , j , k , θ i + 1 , j , k ) ; = ( 1 − θ i , j + 1/2 , k f a ce ) G i , j + 1/2 , k L O + θ i , j + 1/2 , k f a ce G i , j + 1/2 , k H O with θ i , j + 1/2 , k f a ce ≡ min ( θ i , j , k , θ i , j + 1 , k ) ; = ( 1 − θ i , j , k + 1/2 f a ce ) H i , j , k + 1/2 L O + θ i , j , k + 1/2 f a ce H i , j , k + 1/2 H O with θ i , j , k + 1/2 f a ce ≡ min ( θ i , j , k , θ i , j , k + 1 ) (41)
The left panel of Figure 6 shows how these facial values of θ \theta θ are collocated. Likewise, at each edge we can define
Figure 6. Figure 6 a and 6b are analogous to Figure 2 because they show four zones in the x y xy x y -plane that come together at the z z z -edge of a three-dimensional mesh. Figure 6 a shows the four zones that surround a z z z -edge. It shows how the “θ \theta θ ” variables that are evaluated at the x z xz x z - and y z yz y z -faces can be used to form an effective “θ \theta θ ” at the z z z -edge of the mesh. This effective “θ \theta θ ” at the z z z -edge can then be used to lower the order of the edge-centered z z z -component of the electric field that is used in the update of the facial magnetic fields in the x z xz x z - and y z yz y z -faces. Like Figure 2 , Figure 6 b shows the inputs that go into the evaluation of the z z z -component of the electric field. The only difference from Figure 2 is that we now have the option of making a high order evaluation (which uses all the high order WENO reconstructions and interpolations as described in the text) which is superscripted with “HO”; and a low order (first order) evaluation which is superscripted with “LO”.
E ˉ z ; i + 1 / 2 , j + 1 / 2 , k θ = ( 1 − θ i + 1 / 2 , j + 1 / 2 , k e d g e ) E ˉ z ; i + 1 / 2 , j + 1 / 2 , k L O + θ i + 1 / 2 , j + 1 / 2 , k e d g e E ˉ z ; i + 1 / 2 , j + 1 / 2 , k H O with θ i + 1 / 2 , j + 1 / 2 , k e d g e ≡ min ( θ i , j , k , θ i + 1 , j , k , θ i , j + 1 , k , θ i + 1 , j + 1 , k ) ; E ˉ y ; i + 1 / 2 , j , k + 1 / 2 θ = ( 1 − θ i + 1 / 2 , j , k + 1 / 2 e d g e ) E ˉ y ; i + 1 / 2 , j , k + 1 / 2 L O + θ i + 1 / 2 , j , k + 1 / 2 e d g e E ˉ y ; i + 1 / 2 , j , k + 1 / 2 H O with θ i + 1 / 2 , j , k + 1 / 2 e d g e ≡ min ( θ i , j , k , θ i + 1 , j , k , θ i , j , k + 1 , θ i + 1 , j , k + 1 ) ; E ˉ x ; i , j + 1 / 2 , k + 1 / 2 θ = ( 1 − θ i , j + 1 / 2 , k + 1 / 2 e d g e ) E ˉ x ; i , j + 1 / 2 , k + 1 / 2 L O + θ i , j + 1 / 2 , k + 1 / 2 e d g e E ˉ x ; i , j + 1 / 2 , k + 1 / 2 H O with θ i , j + 1 / 2 , k + 1 / 2 e d g e ≡ min ( θ i , j , k , θ i , j + 1 , k , θ i , j , k + 1 , θ i , j + 1 , k + 1 ) (42) \begin{aligned}
\bar{E}^{\theta}_{z;i+1/2,j+1/2,k} &= \left(1-\theta^{\mathrm{edge}}_{i+1/2,j+1/2,k}\right)\bar{E}^{\mathrm{LO}}_{z;i+1/2,j+1/2,k}+\theta^{\mathrm{edge}}_{i+1/2,j+1/2,k}\bar{E}^{\mathrm{HO}}_{z;i+1/2,j+1/2,k}\\
\text{with}\quad\theta^{\mathrm{edge}}_{i+1/2,j+1/2,k} &\equiv\min\left(\theta_{i,j,k},\theta_{i+1,j,k},\theta_{i,j+1,k},\theta_{i+1,j+1,k}\right);\\
\bar{E}^{\theta}_{y;i+1/2,j,k+1/2} &= \left(1-\theta^{\mathrm{edge}}_{i+1/2,j,k+1/2}\right)\bar{E}^{\mathrm{LO}}_{y;i+1/2,j,k+1/2}+\theta^{\mathrm{edge}}_{i+1/2,j,k+1/2}\bar{E}^{\mathrm{HO}}_{y;i+1/2,j,k+1/2}\\
\text{with}\quad\theta^{\mathrm{edge}}_{i+1/2,j,k+1/2} &\equiv\min\left(\theta_{i,j,k},\theta_{i+1,j,k},\theta_{i,j,k+1},\theta_{i+1,j,k+1}\right);\\
\bar{E}^{\theta}_{x;i,j+1/2,k+1/2} &= \left(1-\theta^{\mathrm{edge}}_{i,j+1/2,k+1/2}\right)\bar{E}^{\mathrm{LO}}_{x;i,j+1/2,k+1/2}+\theta^{\mathrm{edge}}_{i,j+1/2,k+1/2}\bar{E}^{\mathrm{HO}}_{x;i,j+1/2,k+1/2}\\
\text{with}\quad\theta^{\mathrm{edge}}_{i,j+1/2,k+1/2} &\equiv\min\left(\theta_{i,j,k},\theta_{i,j+1,k},\theta_{i,j,k+1},\theta_{i,j+1,k+1}\right) \tag*{(42)}
\end{aligned} E ˉ z ; i + 1/2 , j + 1/2 , k θ with θ i + 1/2 , j + 1/2 , k edge E ˉ y ; i + 1/2 , j , k + 1/2 θ with θ i + 1/2 , j , k + 1/2 edge E ˉ x ; i , j + 1/2 , k + 1/2 θ with θ i , j + 1/2 , k + 1/2 edge = ( 1 − θ i + 1/2 , j + 1/2 , k edge ) E ˉ z ; i + 1/2 , j + 1/2 , k LO + θ i + 1/2 , j + 1/2 , k edge E ˉ z ; i + 1/2 , j + 1/2 , k HO ≡ min ( θ i , j , k , θ i + 1 , j , k , θ i , j + 1 , k , θ i + 1 , j + 1 , k ) ; = ( 1 − θ i + 1/2 , j , k + 1/2 edge ) E ˉ y ; i + 1/2 , j , k + 1/2 LO + θ i + 1/2 , j , k + 1/2 edge E ˉ y ; i + 1/2 , j , k + 1/2 HO ≡ min ( θ i , j , k , θ i + 1 , j , k , θ i , j , k + 1 , θ i + 1 , j , k + 1 ) ; = ( 1 − θ i , j + 1/2 , k + 1/2 edge ) E ˉ x ; i , j + 1/2 , k + 1/2 LO + θ i , j + 1/2 , k + 1/2 edge E ˉ x ; i , j + 1/2 , k + 1/2 HO ≡ min ( θ i , j , k , θ i , j + 1 , k , θ i , j , k + 1 , θ i , j + 1 , k + 1 ) (42)
The left panel of Figure 6 shows how these edge values of θ \theta θ are collocated. The right panel of Figure 6 shows how these can be used to obtain electric fields at the edges. The above two equations show that the order of accuracy of the fluxes and electric fields can be locally lowered, as needed, to the point where the first order scheme always guarantees PCP behavior.
We now describe an iterative update strategy that does just that. We iterate over the whole mesh, starting the iteration process with θ i , j , k = 1 \theta_{i,j,k}=1 θ i , j , k = 1 for all the zones. This θ i , j , k \theta_{i,j,k} θ i , j , k will be sequentially lowered for any zone that is troubled; but realize that it will only be lowered for the few zones that are troubled. For each iteration, eqns. (4.7) to (4.10) can be modified to become
∂ t U ˉ i , j , k θ = − 1 Δ x ( F ˉ i + 1 / 2 , j , k θ − F ˉ i − 1 / 2 , j , k θ ) − 1 Δ y ( G ˉ i , j + 1 / 2 , k θ − G ˉ i , j − 1 / 2 , k θ ) − 1 Δ z ( H ˉ i , j , k + 1 / 2 θ − H ˉ i , j , k − 1 / 2 θ ) + 1 Δ t ( 1 − θ i , j , k ) S i , j , k L O (43) \begin{aligned}
\partial_t\bar{U}^{\theta}_{i,j,k}={}&-\frac{1}{\Delta x}\left(\bar{F}^{\theta}_{i+1/2,j,k}-\bar{F}^{\theta}_{i-1/2,j,k}\right)-\frac{1}{\Delta y}\left(\bar{G}^{\theta}_{i,j+1/2,k}-\bar{G}^{\theta}_{i,j-1/2,k}\right)\\
&-\frac{1}{\Delta z}\left(\bar{H}^{\theta}_{i,j,k+1/2}-\bar{H}^{\theta}_{i,j,k-1/2}\right)+\frac{1}{\Delta t}\left(1-\theta_{i,j,k}\right)S^{\mathrm{LO}}_{i,j,k} \tag*{(43)}
\end{aligned} ∂ t U ˉ i , j , k θ = − Δ x 1 ( F ˉ i + 1/2 , j , k θ − F ˉ i − 1/2 , j , k θ ) − Δ y 1 ( G ˉ i , j + 1/2 , k θ − G ˉ i , j − 1/2 , k θ ) − Δ z 1 ( H ˉ i , j , k + 1/2 θ − H ˉ i , j , k − 1/2 θ ) + Δ t 1 ( 1 − θ i , j , k ) S i , j , k LO (43)
∂ t B ˉ x ; i + 1 / 2 , j , k θ = − 1 Δ y Δ z ( Δ z E ˉ z ; i + 1 / 2 , j + 1 / 2 , k θ − Δ z E ˉ z ; i + 1 / 2 , j − 1 / 2 , k θ + Δ y E ˉ y ; i + 1 / 2 , j , k − 1 / 2 θ − Δ y E ˉ y ; i + 1 / 2 , j , k + 1 / 2 θ ) (44) \partial_t\bar{B}^{\theta}_{x;i+1/2,j,k}=-\frac{1}{\Delta y\Delta z}\left(\Delta z\bar{E}^{\theta}_{z;i+1/2,j+1/2,k}-\Delta z\bar{E}^{\theta}_{z;i+1/2,j-1/2,k}+\Delta y\bar{E}^{\theta}_{y;i+1/2,j,k-1/2}-\Delta y\bar{E}^{\theta}_{y;i+1/2,j,k+1/2}\right) \tag*{(44)} ∂ t B ˉ x ; i + 1/2 , j , k θ = − Δ y Δ z 1 ( Δ z E ˉ z ; i + 1/2 , j + 1/2 , k θ − Δ z E ˉ z ; i + 1/2 , j − 1/2 , k θ + Δ y E ˉ y ; i + 1/2 , j , k − 1/2 θ − Δ y E ˉ y ; i + 1/2 , j , k + 1/2 θ ) (44)
∂ t B ˉ y ; i , j − 1 / 2 , k θ = − 1 Δ x Δ z ( Δ x E ˉ x ; i , j − 1 / 2 , k + 1 / 2 θ − Δ x E ˉ x ; i , j − 1 / 2 , k − 1 / 2 θ + Δ z E ˉ z ; i − 1 / 2 , j − 1 / 2 , k θ − Δ z E ˉ z ; i + 1 / 2 , j − 1 / 2 , k θ ) (45) \partial_t\bar{B}^{\theta}_{y;i,j-1/2,k}=-\frac{1}{\Delta x\Delta z}\left(\Delta x\bar{E}^{\theta}_{x;i,j-1/2,k+1/2}-\Delta x\bar{E}^{\theta}_{x;i,j-1/2,k-1/2}+\Delta z\bar{E}^{\theta}_{z;i-1/2,j-1/2,k}-\Delta z\bar{E}^{\theta}_{z;i+1/2,j-1/2,k}\right) \tag*{(45)} ∂ t B ˉ y ; i , j − 1/2 , k θ = − Δ x Δ z 1 ( Δ x E ˉ x ; i , j − 1/2 , k + 1/2 θ − Δ x E ˉ x ; i , j − 1/2 , k − 1/2 θ + Δ z E ˉ z ; i − 1/2 , j − 1/2 , k θ − Δ z E ˉ z ; i + 1/2 , j − 1/2 , k θ ) (45)
∂ t B ˉ z ; i , j , k + 1 / 2 θ = − 1 Δ x Δ y ( Δ x E ˉ x ; i , j + 1 / 2 , k + 1 / 2 θ − Δ x E ˉ x ; i , j + 1 / 2 , k + 1 / 2 θ + Δ y E ˉ y ; i + 1 / 2 , j , k + 1 / 2 θ − Δ y E ˉ y ; i − 1 / 2 , j , k + 1 / 2 θ ) (46) \partial_t\bar{B}^{\theta}_{z;i,j,k+1/2}=-\frac{1}{\Delta x\Delta y}\left(\Delta x\bar{E}^{\theta}_{x;i,j+1/2,k+1/2}-\Delta x\bar{E}^{\theta}_{x;i,j+1/2,k+1/2}+\Delta y\bar{E}^{\theta}_{y;i+1/2,j,k+1/2}-\Delta y\bar{E}^{\theta}_{y;i-1/2,j,k+1/2}\right) \tag*{(46)} ∂ t B ˉ z ; i , j , k + 1/2 θ = − Δ x Δ y 1 ( Δ x E ˉ x ; i , j + 1/2 , k + 1/2 θ − Δ x E ˉ x ; i , j + 1/2 , k + 1/2 θ + Δ y E ˉ y ; i + 1/2 , j , k + 1/2 θ − Δ y E ˉ y ; i − 1/2 , j , k + 1/2 θ ) (46)
Figure 7 shows us schematically how our update strategy allows us to access any accuracy of update for the electric fields, going from the highest order accuracy to the lowest order accuracy. In this figure and the text that follows, the high order components are superscripted with “HO”; and low order components are superscripted with “LO”. Using these, the forward Euler approximants can be constructed in eqns. (4.11) to (4.13). If a zone in those forward Euler approximants is not within the PCP domain, its local θ i , j , k \theta_{i,j,k} θ i , j , k will be lowered even further in each successive iteration till it becomes PCP. Realize that this procedure is fully explicit; i.e. it does not require any fluxes or electric fields that are obtained through an implicit process. Realize too that this process is guaranteed to ensure that all zones are in the PCP domain.
Figure 7. Fig. 7 is analogous to Figure 1 because it shows the components of the magnetic field in the faces of the mesh. The difference from Figure 1 is that within each face we now have a high order component which is superscripted with “HO”; and a low order component which is superscripted with “LO”. Both components in each face have been advanced in time using a forward Euler scheme with a timestep Δ t \Delta t Δ t . Both the components within each face will be used for the PCP update.
Step by Step Description of the PCP Method
For the sake of simplicity, we describe the implementation in terms of the LLF Riemann solver. The method is implemented using the following steps:-
Step 1) The magnetic field components are reconstructed within the faces and the ADP algorithm from Balsara, Samantaray and Subramanian [24 ] is used to obtain a higher order reconstruction of the entire magnetic field within the entire volume each zone. This also enables us to evaluate the magnetic field at each zone center. The 6 th 6^{\text{th}} 6 th , 7 th 7^{\text{th}} 7 th and 8 th 8^{\text{th}} 8 th components of U ‾ i , j , k \overline{\mathbf{U}}_{i,j,k} U i , j , k are reset using the zone-averaged magnetic fields that were evaluated in this step.
Step 2) This is the transcription step. It is important because we make a sequence of transcriptions of the variables, going from U ‾ i , j , k \overline{\mathbf{U}}_{i,j,k} U i , j , k to U i , j , k \mathbf{U}_{i,j,k} U i , j , k to V i , j , k \mathbf{V}_{i,j,k} V i , j , k to V ‾ i , j , k \overline{\mathbf{V}}_{i,j,k} V i , j , k . At each step in the transcription we have to check that the states remain in the PCP domain. Using eqn. (19) or eqn. (21) , we go from zone-averaged values for the conserved variables U ‾ i , j , k \overline{\mathbf{U}}_{i,j,k} U i , j , k to zone-centered point values for the conserved variables U i , j , k \mathbf{U}_{i,j,k} U i , j , k . (Note too that if a higher order transcription from zone-averaged U ‾ i , j , k \overline{\mathbf{U}}_{i,j,k} U i , j , k to point value U i , j , k \mathbf{U}_{i,j,k} U i , j , k produces a U i , j , k \mathbf{U}_{i,j,k} U i , j , k that is not PCP, then we always check for this possibility and give ourselves the option to use a lower order transcription.) From U i , j , k \mathbf{U}_{i,j,k} U i , j , k , we can evaluate the vector of primitive variables V i , j , k \mathbf{V}_{i,j,k} V i , j , k as zone-centered point values. From V i , j , k \mathbf{V}_{i,j,k} V i , j , k , we use (20) and (22) to build the zone-averaged values for the primitive variables V ‾ i , j , k \overline{\mathbf{V}}_{i,j,k} V i , j , k . (Because we check at each stage in this transcription, V i , j , k \mathbf{V}_{i,j,k} V i , j , k and V ‾ i , j , k \overline{\mathbf{V}}_{i,j,k} V i , j , k are also kept within the PCP domain.) The point values of the primitive variables V i , j , k \mathbf{V}_{i,j,k} V i , j , k are also used to build the zone-centered point values for the electric field vector E i , j , k \mathbf{E}_{i,j,k} E i , j , k .
Step 3) The zone-centered point values for the electric field vector E i , j , k \mathbf{E}_{i,j,k} E i , j , k are then interpolated with high order using WENO interpolation with the appropriate order of accuracy. The zone-averaged V ‾ i , j , k \overline{\mathbf{V}}_{i,j,k} V i , j , k are reconstructed using WENO reconstruction with the appropriate order of accuracy. If needed, we use eqns. (4.5) and (4.6) to bring the higher order reconstructed primitive functions, V ^ i , j , k ( x , y , z ) \widehat{\mathbf{V}}_{i,j,k}(x,y,z) V i , j , k ( x , y , z ) , within the PCP domain. This ensures that Riemann solvers will always get physically realizable values.
Step 4) At each zone boundary, use the reconstructed primitive variables V ^ i , j , k ( x , y , z ) \widehat{\mathbf{V}}_{i,j,k}(x,y,z) V i , j , k ( x , y , z ) to build the extremal wave speeds at that zone boundary as well as the high order numerical fluxes at that zone boundary. In fact, the extremal wave speeds at a zone boundary are a natural corollary to invoking the Riemann solvers at that zone boundary in order to get the numerical fluxes. For example, at each x-boundary ( i + 1 / 2 , j , k ) (i+1/2,j,k) ( i + 1/2 , j , k ) we build S R ; i + 1 / 2 , j , k S_{R;i+1/2,j,k} S R ; i + 1/2 , j , k and S L ; i + 1 / 2 , j , k S_{L;i+1/2,j,k} S L ; i + 1/2 , j , k as well as the higher order x-flux F ‾ i + 1 / 2 , j , k H O \overline{\mathbf{F}}^{HO}_{i+1/2,j,k} F i + 1/2 , j , k H O . This also ensures that we can find extremal wave speeds at each edge. For example, for the z-edge ( i + 1 / 2 , j + 1 / 2 , k ) (i+1/2,j+1/2,k) ( i + 1/2 , j + 1/2 , k ) we can find S R ; i + 1 / 2 , j + 1 / 2 , k = max ( S R ; i + 1 / 2 , j , k , S R ; i + 1 / 2 , j + 1 , k ) S_{R;i+1/2,j+1/2,k}=\max\left(S_{R;i+1/2,j,k},S_{R;i+1/2,j+1,k}\right) S R ; i + 1/2 , j + 1/2 , k = max ( S R ; i + 1/2 , j , k , S R ; i + 1/2 , j + 1 , k ) , S L ; i + 1 / 2 , j + 1 / 2 , k = min ( S L ; i + 1 / 2 , j , k , S L ; i + 1 / 2 , j + 1 , k ) S_{L;i+1/2,j+1/2,k}=\min\left(S_{L;i+1/2,j,k},S_{L;i+1/2,j+1,k}\right) S L ; i + 1/2 , j + 1/2 , k = min ( S L ; i + 1/2 , j , k , S L ; i + 1/2 , j + 1 , k ) , S U ; i + 1 / 2 , j + 1 / 2 , k = max ( S U ; i + 1 / 2 , j + 1 / 2 , k , S U ; i + 1 , j + 1 / 2 , k ) S_{U;i+1/2,j+1/2,k}=\max\left(S_{U;i+1/2,j+1/2,k},S_{U;i+1,j+1/2,k}\right) S U ; i + 1/2 , j + 1/2 , k = max ( S U ; i + 1/2 , j + 1/2 , k , S U ; i + 1 , j + 1/2 , k ) and S D ; i + 1 / 2 , j + 1 / 2 , k = min ( S D ; i , j + 1 / 2 , k , S D ; i + 1 , j + 1 / 2 , k ) S_{D;i+1/2,j+1/2,k}=\min\left(S_{D;i,j+1/2,k},S_{D;i+1,j+1/2,k}\right) S D ; i + 1/2 , j + 1/2 , k = min ( S D ; i , j + 1/2 , k , S D ; i + 1 , j + 1/2 , k ) which will be useful for the construction of the z-component of the electric field at that edge.
Step 5) Now that we have the extremal wave speeds (in both the transverse directions) at each edge, we can use the facially reconstructed magnetic field components from Step 1, as well as the interpolated electric fields from Step 3 to build higher order numerical electric fields at that edge. For example, from eqn. (3.9), we can find a high order z-component of electric field, E ‾ z ; i + 1 / 2 , j + 1 / 2 , k H O \overline{E}^{HO}_{z;i+1/2,j+1/2,k} E z ; i + 1/2 , j + 1/2 , k H O , at the z-edge ( i + 1 / 2 , j + 1 / 2 , k ) (i+1/2,j+1/2,k) ( i + 1/2 , j + 1/2 , k ) . (Realize that if the only thing that we desire is a higher order scheme then eqns. (4.7) to (4.10), along with the update equations (4.11) or (4.12) or (4.13), are fully adequate for giving us a very competent higher order scheme.)
Step 6) If PCP methods are needed, it is important to realize that at each fractional step we will additionally need to run an inexpensive low order scheme. The philosophy of PCP is that we have one lower order scheme that is guaranteed to be PCP, which guides the higher order scheme so that it remains PCP. This means that at each fractional step we will also send in the same data to the lower order scheme that we use for the higher order scheme.
Step 7) If PCP methods are needed, obtain the low order fluxes and electric fields that are described in Section 5.1 by using the low order PCP scheme. This is done once for each Runge-Kutta stage in the time update.
Step 8) If PCP methods are needed, in each zone we start with a variable θ i , j , k = 1 \theta_{i,j,k}=1 θ i , j , k = 1 . We then begin a sequence of iterations over the entire mesh. Zones that are within the PCP domain are left alone within each iteration. Zones whose update takes them outside the PCP domain are given a lower value of θ i , j , k \theta_{i,j,k} θ i , j , k , as long as we retain θ i , j , k ≥ 0 \theta_{i,j,k}\ge0 θ i , j , k ≥ 0 . In this fashion, we let the numerical scheme itself decide where it needs to use elements of a lower order scheme and how much of the lower order scheme is needed to render the entire solution within the PCP domain. This is done for each Runge-Kutta stage in the time update. (In this paper we have shown only the most stringent MHD and RMHD problems that are known in the literature. In all cases, we were able to bring the solution within the PCP domain within 10 to 20 iterations.)
Accuracy Analysis and Dissipation
Accuracy Analysis for MHD and RMHD
In this Sub-section we consider the two-dimensional Magnetohydrodynamics (MHD) and Relativistic-Magnetohydrodynamics (RMHD) systems from § 3 and study the accuracy of the presented schemes for these systems.
For the MHD system, we consider the two-dimensional vortex problem from Balsara [11 ] . The problem consists of a smoothly varying and dynamically stable vortex that moves diagonally in a periodic domain. The explicit expressions for the setup have been provided in Balsara [11 ] . Therefore, we do not describe the setup details here. There is, however, one point of difference. In Balsara [11 ] we recommended doing this problem on a periodic domain ranging over [ − 5 , 5 ] × [ − 5 , 5 ] [-5,5]\times[-5,5] [ − 5 , 5 ] × [ − 5 , 5 ] and running to a final time of 10 units. That choice of domain is fine for second order schemes. But it is important to realize that a smooth idealized vortex has, in principle, an infinite extent. To carry out an accuracy analysis, we have to truncate the problem and use periodic boundaries. For lower order schemes, this truncation of the vortex at the periodic boundaries does not have a substantial impact on the accuracy. But higher order schemes are very sensitive and can pick up differences from the boundary conditions if the boundary is not set far enough away. As a result, we now recommend doing this problem on a periodic domain that ranges over [ − 10 , 10 ] × [ − 10 , 10 ] [-10,10]\times[-10,10] [ − 10 , 10 ] × [ − 10 , 10 ] and running to a final time of 20 units. In Figure 8 we show the L 1 L_1 L 1 and L ∞ L_\infty L ∞ errors for schemes ranging from second order accurate to sixth order accurate. The slopes in the left upper corner of this figure also show the theoretical accuracies. The top row of Figure 8 shows the error in the x-momentum and the x-magnetic field for non-relativistic MHD. We observe that the schemes we have presented are able to reach their design accuracy. Indeed, we see from Figure 8 that the fourth and fifth order schemes are quite close because such problems sometimes show serendipitous increase in order. So the fourth order scheme has almost the same accuracy as the fifth order scheme. But it is useful to realize that this serendipitous increase in order is problem-specific.
Figure 8. We present order of accuracy plots for the MHD and RMHD Vortex problems. We show L 1 L_1 L 1 and L ∞ L_\infty L ∞ errors for the x x x -momentum and x x x -magnetic field on a log scale versus the zone size. The top panel shows the accuracy plots for the MHD Vortex, and the bottom panel shows the accuracy plots for the RMHD Vortex problem. Both the MHD and RMHD vortex problems were run on a periodic domain that spans [ − 10 , 10 ] × [ − 10 , 10 ] [-10,10]\times[-10,10] [ − 10 , 10 ] × [ − 10 , 10 ] . To facilitate comparison with Balsara [11 ] , the MHD vortex was run on 100 2 100^2 10 0 2 , 200 2 200^2 20 0 2 and 400 2 400^2 40 0 2 zone meshes. The RMHD vortex was run on 64 2 64^2 6 4 2 , 128 2 128^2 12 8 2 , 256 2 256^2 25 6 2 and 512 2 512^2 51 2 2 zone meshes to facilitate comparison with Balsara and Kim [22 ] . The top-left corner shows the slopes for different orders.
For the RMHD system, Balsara and Kim [20 ] have presented a two-dimensional vortex problem with detailed derivation and setup expressions. Because they were displaying some fourth order schemes, they already recommended using a domain that ranges over [ − 10 , 10 ] × [ − 10 , 10 ] [-10,10]\times[-10,10] [ − 10 , 10 ] × [ − 10 , 10 ] . That set-up is intrinsically based on using a larger domain. We consider the same setup here to study the accuracy of the presented schemes. The lower row of Figure 8 shows the error in the x-momentum and the x-magnetic field for the RMHD vortex. Observe that the schemes we present here are able to reach their design accuracy for the RMHD system at all the orders in the L 1 L_1 L 1 and L ∞ L_\infty L ∞ norms. For the L 1 L_1 L 1 and L ∞ L_\infty L ∞ errors in the Bx variable for the RMHD vortex, the kinks in the red and purple curves show that the higher order accuracy is asymptotically reached only at the highest resolutions. This is a well-known fact for all higher order schemes:- The theory for hyperbolic system scheme design only says that the schemes reach their design accuracies in the L 1 L_1 L 1 norm and that too at the highest resolutions [46 ] . As one can see from the last two panels in the lower row of Figure 8 , one might have to go to rather high resolutions before the design accuracy of the scheme is achieved. In the RMHD vortex we find that the fifth order scheme is substantially more accurate compared to the fourth order scheme. This illustrates that the accuracy improvement that we found for the MHD vortex is indeed serendipitous.
Controlling Dissipation
For numerous astrophysical problems it is very useful to control the dissipation. This is especially so for the magnetic field in such areas as turbulence simulations and dynamo studies. Appendix § 13 explains why the dissipation shows a strong dependence on the quality of the Riemann solver, especially when a lower order scheme is used. Leidi et al. (2022) have repurposed the magnetized vortex problem from Balsara [11 ] and used it as a way of showing the dissipation of the magnetic field. If the magnetic field in the magnetized vortex retains most of its strength at the end of one periodic propagation, then that is taken as an indication that dissipation is properly controlled by the scheme. The top row of Figure 9 shows the magnetic energy after one complete propagation across the domain when the multidimensional LLF Riemann solver is used. The bottom row of Figure 9 shows the magnetic energy after one complete propagation across the domain when the multidimensional HLL Riemann solver is used. In Figure 9 , we normalize the obtained magnetic energy by the maximum initial magnetic energy. At low orders, say second and third order, there is a substantial difference between the magnetic energy that is retained on the mesh when the LLF Riemann solver is used compared to when the HLL Riemann solver is used. Therefore, at lower orders, the quality of the multidimensional Riemann solver does substantially affect the retention of magnetic energy on the mesh. Indeed, Balsara and Nkonga [22 ] have even presented a multidimensional Riemann solver that retains all the contributions from Alfven wave propagation (and indeed from all the MHD waves) in a truly multidimensional sense. However, we also see from Figure 9 that when one goes to fourth and higher orders, the difference between the multidimensional LLF Riemann solver and the multidimensional HLL Riemann solver is absolutely minuscular. This is because the higher order reconstruction does an excellent job of minimizing the jumps in the states that are fed into the Riemann solver. Minimizing the jumps in the magnetic field components also minimizes the dissipation. This might be a new insight that might not have been appreciated in the MHD literature.
Figure 9. We show plots of the magnetic energy distribution for the MHD-Vortex problem (obtained after one advection time). Following Leidi et al. (2022) we used 64 2 64^{2} 6 4 2 zone mesh on a periodic domain that spans [ − 5 , 5 ] × [ − 5 , 5 ] [-5,5] \times[-5,5] [ − 5 , 5 ] × [ − 5 , 5 ] . It is not useful to double the domain because we only focus on the maximum value of the magnetic energy. We normalize the obtained magnetic energy by the maximum initial magnetic energy. The top panel shows the distribution obtained from the multidimensional LLF Riemann solver version of the scheme, and the bottom panel shows the results obtained from the multidimensional HLL Riemann solver version of the scheme. Second to sixth order simulations have been presented.
Stringent Test Problems
We present several two-dimensional stringent test problems for the MHD and RMHD systems. For each of the problems, we take a CFL number of 0.4 unless stated otherwise.
Stringent Blast-Wave problem for the MHD system
In this Sub-Section, we consider the blast-wave problem for the MHD system. The blast problem with a moderate magnetized magnetic field is described in Balsara & Spicer (1999), and the strongly magnetized blast problem is described in Wu & Shu (2018). Here, we only consider the strongly magnetized, very stringent test problem from Wu & Shu (2018) because it corresponds to a very low value of plasma beta (β = 2.51 × 10 − 6 \beta= 2.51 \times10^{-6} β = 2.51 × 1 0 − 6 ). The problem was set up on a two-dimensional domain that spans [ − 0.6 , 0.6 ] × [ − 0.6 , 0.6 ] [-0.6,0.6] \times[-0.6,0.6] [ − 0.6 , 0.6 ] × [ − 0.6 , 0.6 ] . We use the same setup as described in Wu & Shu (2018). Initially, the density is uniformly set to unity and the velocity is set to zero. The pressure is uniformly set to 0.1 except within a central circle of radius 0.1, where it is elevated to 10000. Additionally, a magnetic field with a magnitude of 1000 is initialized along the x x x -direction that makes the problem very challenging for numerical schemes. We simulate the problem on a 2D grid consisting of 400 × 400 400 \times400 400 × 400 zones until a final time of t = 0.001 t = 0.001 t = 0.001 . We use the fourth-order scheme and show results for the density profile, pressure profile, magnitude-squared of the velocity vector, and magnitude-squared of the magnetic field vector in Figure 10a to Figure 10d respectively. Figure 10e also shows the value of the θ \theta θ -variable at the final time. For this problem, there is no energy fed in from the boundaries, so any energy violation can only come from the source term in eqn. (40) . Therefore, the total energy in the simulation as a function of time is also shown in Figure 10e . Notice that the original magnetic field is so strong in this problem that the magnetic pressure at late times has only a 17.5% variation in Figure 10d despite the intense blast wave that is set off. The results obtained are consistent with those reported in Wu & Shu (2018), highlighting the performance of the presented schemes.
Stringent Astrophysical jet problem for the MHD system
We now consider the astrophysical jet problem (with Mach number of 800) from Balsara (2012). Following Wu & Shu (2018), a magnetic field is added to this problem to simulate the MHD jet flows. The presence of a magnetic field makes this test problem even more extreme. We only consider the extremely strong magnetized case, where we have B a = 20000 B_a = \sqrt{20000} B a = 20000 (corresponding β a = 10 − 4 \beta_a = 10^{-4} β a = 1 0 − 4 ). The problem was set up on a two-dimensional domain that spans [ − 0.5 , 0.5 ] × [ 0.0 , 1.5 ] [-0.5,0.5] \times[0.0,1.5] [ − 0.5 , 0.5 ] × [ 0.0 , 1.5 ] . We refer the readers to Wu & Shu (2018) for the detailed setup of the problem. We run the test case on a 2D grid consisting of 400 × 600 400 \times600 400 × 600 zones until a stopping time of t = 0.002 t=0.002 t = 0.002 . A sixth-order accurate scheme was used for the run. Figures 11a and 11b show the resulting density and pressure profiles on logarithmic scales; Figure 11c shows the square of the magnitude of the magnetic field vector; Figure 11d shows the θ \theta θ -variable at the final time. We observe that the working surface of the jet and the cocoon are well captured for this extreme test; hence showing the robust performance of the proposed methods.
Stringent Blast-Wave problem for the RMHD system
In this Sub-Section, we consider the blast problem for the RMHD system. The non-relativistic version of this test problem was first presented in Balsara and Spicer (1999) and was extended to RMHD system by Komissarov [52 ] . Several extreme variants of this test problem have been presented in Wu & Shu (2021). We focus on one of the variants presented in Wu & Shu (2021), characterized by a plasma beta β = 2.5 × 10 − 6 \beta= 2.5 \times10^{-6} β = 2.5 × 1 0 − 6 . The test problem is set up on a two-dimensional square domain that spans [ − 6 , 6 ] × [ − 6 , 6 ] [-6,6]\times[-6,6] [ − 6 , 6 ] × [ − 6 , 6 ] . Within a radius of 0.8, the explosion zone has a density of 10 − 2 10^{-2} 1 0 − 2 and a pressure of 1. Outside a radius of 1 unit, the ambient medium has a density of 10 − 4 10^{-4} 1 0 − 4 and a pressure of 5 × 10 − 4 5\times10^{-4} 5 × 1 0 − 4 . A linear taper is applied to the density and pressure from a radius of 0.8 to 1. Accordingly, both the density and pressure linearly decrease with increasing radius in that range of radii. The magnetic field is initialized in the x-direction and has a magnitude of 20. The corresponding plasma beta is very low (β = 2.5 × 10 − 6 \beta= 2.5\times10^{-6} β = 2.5 × 1 0 − 6 ), which makes the test case stringent. The polytropic index of Γ = 4 / 3 \Gamma= 4/3 Γ = 4/3 is used in this problem. The simulation is run to a final time of 4 using a fifth-order accurate scheme on a grid consisting of 400 × 400 400\times400 400 × 400 zones. The results have been presented in Figure 12 . Figure 12 a shows the resulting density profile, Figure 12 b shows the pressure profile, and Figure 12 c shows the normed-squared value of the variable γ v \gamma v γ v , and Figure 12 d shows the magnitude-squared of the magnetic field at time t = 4 t=4 t = 4 . Figure 12 e shows the value of the θ \theta θ -variable at the final time, and Figure 12 f shows the total energy in the simulation as a function of time. Notice that the original magnetic field is so strong in this problem that the magnetic pressure at late times has less than 1% variation in Figure 12 d. We see a close resemblance between the results we obtained and the results presented in Wu & Shu (2021).
Figure 12. RMHD Blast Problem: Figure 12 a shows the density profile, Figure 12 b shows the pressure profile, Figure 12 c shows the magnitude-squared of the Lorentz-velocity vector, Figure 12 d shows the magnitude-squared of the magnetic field vector and Figure 12 e shows the value of the zone-centered θ \theta θ that controls the amount of hybridization between high and low order schemes to obtain the PCP results. The profiles were obtained using a fifth-order scheme at time t = 4 t=4 t = 4 on a two-dimensional grid that consists of 400 × 400 400 \times400 400 × 400 zones. The plasma beta for this problem is β = 2.5 × 10 − 6 \beta=2.5 \times10^{-6} β = 2.5 × 1 0 − 6 . Finally, Figure 12 f shows the time evolution of the relative error in the total energy at three different mesh sizes: 400 2 400^2 40 0 2 , 800 2 800^2 80 0 2 , and 1600 2 1600^2 160 0 2 .
Stringent Astrophysical jet problem for the RMHD system
In this Sub-Section, we focus on the supersonic astrophysical jet problem from Wu & Shu (2021) for the RMHD system. The problem is initialized on a two-dimensional domain that spans [ − 12 , 12 ] × [ 0 , 25 ] [-12,12]\times[0,25] [ − 12 , 12 ] × [ 0 , 25 ] . The domain is filled with a uniform medium, where the density, velocity, and pressure are given by ρ = 1 \rho=1 ρ = 1 , v = 0 \mathbf{v}=0 v = 0 , and p = 2.3536241 × 10 − 5 p=2.3536241\times10^{-5} p = 2.3536241 × 1 0 − 5 , respectively. Along the y y y -direction, a magnetic field B = ( 0 , 2000 p , 0 ) \mathbf{B}=(0,\sqrt{2000p},0) B = ( 0 , 2000 p , 0 ) is initialized. The corresponding initial Lorentz factor is γ ≈ 7.09 \gamma\approx7.09 γ ≈ 7.09 and the corresponding relativistic Mach number is M r ≈ 354.37 M_r\approx354.37 M r ≈ 354.37 . The very high Mach number and substantial Lorentz factor make the simulation of this problem highly challenging. At the bottom boundary (y = 0 y=0 y = 0 ), a dense jet is injected through the inlet part ∣ x ∣ < 0.5 |x|<0.5 ∣ x ∣ < 0.5 with the states ( ρ , v x , v y , v z , p , B x , B y , B z ) = ( 0.1 , 0 , 0.99 , 0 , 2.3536241 × 10 − 5 , 0 , 2000 p , 0 ) (\rho,v_x,v_y,v_z,p,B_x,B_y,B_z)=(0.1,0,0.99,0,2.3536241\times10^{-5},0,\sqrt{2000p},0) ( ρ , v x , v y , v z , p , B x , B y , B z ) = ( 0.1 , 0 , 0.99 , 0 , 2.3536241 × 1 0 − 5 , 0 , 2000 p , 0 ) . Outflow boundary conditions are employed at all the other boundaries. The adiabatic constant is set as Γ = 5 / 3 \Gamma=5/3 Γ = 5/3 . The corresponding plasma beta is β = 10 − 3 \beta=10^{-3} β = 1 0 − 3 , which makes the simulation even more challenging. We run the test case on a 2D grid consisting of 720× \times × 750 zones until a stopping time of t = 30 t=30 t = 30 . A fourth-order accurate scheme was used for the run. Figure 13 a and Figure 13 b show the resulting density and pressure profiles on logarithmic scales; Figure 13 c shows the square of the magnitude of the magnetic field vector, Figure 13 d shows the θ \theta θ -variable at the final time. We see that the Mach shock wave and interfaces are well captured for this extreme case and the results closely match the results presented in Wu & Shu (2021). This demonstrates the robust performance of the proposed methods.
Figure 13. RMHD Jet Problem: Figure 13 a shows the log 10 \log_{10} log 10 of the density, Figure 13 b shows the log 10 \log_{10} log 10 of the pressure, Figure 13 c shows the square of the magnitude of the magnetic field vector and Figure 13 d shows the value of the zone-centered θ \theta θ that controls the amount of hybridization between high and low order schemes to obtain the PCP results. The profiles were obtained at time t = 30 t=30 t = 30 using a fourth-order scheme on a two-dimensional grid that consists of 720 × 750 720 \times750 720 × 750 zones. The plasma beta for this problem is β = 10 − 3 \beta=10^{-3} β = 1 0 − 3 .
Energy Conservation
From the source term in eqn. (40) we see that the energy may indeed not be exactly conserved when a zone that is updated with a higher order scheme takes a correction from the first order code. In such circumstances, we want the energy correction to be minimal. We would also like to demonstrate that when the same problem is solved on meshes with increasing resolution, the higher resolution meshes take smaller amounts of energy correction. For jet problems, there is energy injection from the base of the jet. This makes the jet problems unsuitable for demonstrating energy conservation. However, for both the blast test problems, there is no energy input from the boundaries. As a result, we should be able to evaluate energy conservation for such problems. We solve the same problems that were described in Sub-sections 8.1 and 8.3, but this time we solve them on a domain that is four times larger and run them for a time that is also four times longer. Thus we have a sequence of meshes with 400× \times × 400 zones, 800× \times × 800 zones and 1600× \times × 1600 zones. Figure 10f shows the percent energy violation for the non-relativistic blast wave problem on this sequence of meshes. We see that the loss of energy conservation is of the order of 0.005% on the coarsest mesh and decreases as the mesh becomes more refined. Figure 12 f shows the percent energy violation for the relativistic blast wave problem on this sequence of meshes. We see that the loss of energy conservation is of the order of 0.00008% on the coarsest mesh and decreases as the mesh becomes more refined. This shows that even for the most stringent of problems, the energy tends towards near perfect conservation as the resolution of the problem is increased. We also recall, that if the problem is not extremely stringent, i.e. if there are no troubled zones, then the energy conservation is exact.
Conclusions
While second order schemes have been the mainstay of computational astrophysics in the past, there is an emerging drive to carry out astrophysical simulations with very high order of accuracy. All of these schemes, including of course the second order ones, can produce unphysical flow variables. This almost inevitably happens in problems with large Mach numbers, unusually large Lorentz factors and very strong magnetic fields. Code crashes, and a concomitant sense of frustration, are the inevitable result when that happens. The present paper is designed to rectify this situation.
In this paper an extremely inexpensive form of multidimensional Riemann solver is presented in § 4 . (Appendix § 13 shows why the multidimensional Riemann solver is needed in MHD using a physically-motivated explanation.) In Section 4 we show the novel result that very high order reconstruction can be done in the primitive variables. In that Section, we also show that this reconstruction can always be modified to ensure that the values fed to a Riemann solver are always within the PCP domain. This eliminates one source of failure, i.e. situations where Riemann solvers are fed unphysical values resulting in a code crash. However, it does not ensure that the time update that results will keep the solution within the PCP domain.
We present a very lightweight first order scheme in Section 5.1 that will always keep the solution within the PCP domain. In Section 5.2 we show how this first order scheme can be nonlinearly hybridized with the higher order scheme to ensure that the overall time update is in the PCP domain. This nonlinear hybridization is also lightweight. § 7 provides a point by point implementation strategy. § 8 shows that the method is perfectly unobtrusive for higher order simulations that do not violate the PCP condition. § 9 shows the results of some of the most stringent test problems – i.e. the ones that are known in the literature to cause code crashes. We show that our method successfully overcomes all those situations while running with a robust CFL number.
Acknowledgements
DSB acknowledges support via NSF grants NSF-AST-2434532 and NASA grant 80NSSC22K0628.
RK acknowledges support via SNSF grant 10001228. We also acknowledge a travel grant for CS by Notre Dame International that made this collaboration possible.
Positivity fix for the RMHD system
In Sub-Section 5.1 we described a positivity fix for non-relativistic magnetohydrodynamics. Here, we describe a positivity fix for the relativistic magnetohydrodynamics (RMHD) system. Let us recall some mathematical terms from Sub-Section 5.1. We have U ‾ i , j , k n ; L O \overline{U}_{i,j,k}^{n;LO} U i , j , k n ; L O where the sixth, seventh and eighth components of U ‾ i , j , k n ; L O \overline{U}_{i,j,k}^{n;LO} U i , j , k n ; L O replaced by ( B ‾ x ; i + 1 / 2 , j , k n ; L O + B ‾ x ; i − 1 / 2 , j , k n ; L O ) / 2 (\overline{B}_{x;i+1/2,j,k}^{n;LO}+\overline{B}_{x;i-1/2,j,k}^{n;LO})/2 ( B x ; i + 1/2 , j , k n ; L O + B x ; i − 1/2 , j , k n ; L O ) /2 , ( B ‾ y ; i , j + 1 / 2 , k n ; L O + B ‾ y ; i , j − 1 / 2 , k n ; L O ) / 2 (\overline{B}_{y;i,j+1/2,k}^{n;LO}+\overline{B}_{y;i,j-1/2,k}^{n;LO})/2 ( B y ; i , j + 1/2 , k n ; L O + B y ; i , j − 1/2 , k n ; L O ) /2 and ( B ‾ z ; i , j , k + 1 / 2 n ; L O + B ‾ z ; i , j , k − 1 / 2 n ; L O ) / 2 (\overline{B}_{z;i,j,k+1/2}^{n;LO}+\overline{B}_{z;i,j,k-1/2}^{n;LO})/2 ( B z ; i , j , k + 1/2 n ; L O + B z ; i , j , k − 1/2 n ; L O ) /2 . We start by assuming that U ‾ i , j , k n ; L O \overline{U}_{i,j,k}^{n;LO} U i , j , k n ; L O is PCP. Similar to Sub-Section 5.1, we then make the update of this first order scheme by using eqns. (5.1) to (5.4). Now realize that because U ‾ i , j , k n ; L O \overline{U}_{i,j,k}^{n;LO} U i , j , k n ; L O started off PCP, and because eqn. (5.1) is a first order update with a PCP-preserving flux, we are guaranteed that the updated zone-centered variable U ~ i , j , k n + 1 ; L O \widetilde{U}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O will be PCP. It is only when the sixth, seventh and eighth components of U ~ i , j , k n + 1 ; L O \widetilde{U}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O are replaced with ( B ‾ x ; i + 1 / 2 , j , k n + 1 ; L O + B ‾ x ; i − 1 / 2 , j , k n + 1 ; L O ) / 2 (\overline{B}_{x;i+1/2,j,k}^{n+1;LO}+\overline{B}_{x;i-1/2,j,k}^{n+1;LO})/2 ( B x ; i + 1/2 , j , k n + 1 ; L O + B x ; i − 1/2 , j , k n + 1 ; L O ) /2 , ( B ‾ y ; i , j + 1 / 2 , k n + 1 ; L O + B ‾ y ; i , j − 1 / 2 , k n + 1 ; L O ) / 2 (\overline{B}_{y;i,j+1/2,k}^{n+1;LO}+\overline{B}_{y;i,j-1/2,k}^{n+1;LO})/2 ( B y ; i , j + 1/2 , k n + 1 ; L O + B y ; i , j − 1/2 , k n + 1 ; L O ) /2 and ( B ‾ z ; i , j , k + 1 / 2 n + 1 ; L O + B ‾ z ; i , j , k − 1 / 2 n + 1 ; L O ) / 2 (\overline{B}_{z;i,j,k+1/2}^{n+1;LO}+\overline{B}_{z;i,j,k-1/2}^{n+1;LO})/2 ( B z ; i , j , k + 1/2 n + 1 ; L O + B z ; i , j , k − 1/2 n + 1 ; L O ) /2 that we have the possibility of losing the PCP property in a few rare zones! After the replacement of the sixth, seventh and eighth components of U ~ i , j , k n + 1 ; L O \widetilde{U}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O by the facial averages, let us call the zone-centered variables U ‾ i , j , k n + 1 ; L O \overline{U}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O . So it is this replacement by the facial averages that may, in rare occasions, turn U ~ i , j , k n + 1 ; L O \widetilde{U}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O (which is PCP) into U ‾ i , j , k n + 1 ; L O \overline{U}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O (which may not be PCP in a few rare zones). Our task is to fix this situation.
Realize that U ~ i , j , k n + 1 ; L O \widetilde{U}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O is PCP, therefore it has positive density, positive pressure and bounded velocity vector (∣ v ~ ∣ < 1 |\widetilde{\boldsymbol{v}}|<1 ∣ v ∣ < 1 ). We denote the corresponding primitives by [ ρ ~ , v ~ , p ~ ] i , j , k [\widetilde{\rho},\widetilde{\boldsymbol{v}},\widetilde{p}]_{i,j,k} [ ρ , v , p ] i , j , k . Therefore, we already have primitives [ ρ ~ , v ~ , p ~ ] i , j , k [\widetilde{\rho},\widetilde{\boldsymbol{v}},\widetilde{p}]_{i,j,k} [ ρ , v , p ] i , j , k in the troubled zone that are PCP, except that they were obtained via the update in eqn. (5.1). We define a new 8 component vector V ^ i , j , k n + 1 ; L O \widehat{\boldsymbol{V}}_{i,j,k}^{n+1;LO} V i , j , k n + 1 ; L O that has first 5 components same as the primitives [ ρ ~ , v ~ , p ~ ] i , j , k [\widetilde{\rho},\widetilde{\boldsymbol{v}},\widetilde{p}]_{i,j,k} [ ρ , v , p ] i , j , k . The sixth, seventh and eighth components of V ^ i , j , k n + 1 ; L O \widehat{\boldsymbol{V}}_{i,j,k}^{n+1;LO} V i , j , k n + 1 ; L O are assigned the values ( B ‾ x ; i + 1 / 2 , j , k n + 1 ; L O + B ‾ x ; i − 1 / 2 , j , k n + 1 ; L O ) / 2 \left(\overline{B}_{x;i+1/2,j,k}^{n+1;LO}+\overline{B}_{x;i-1/2,j,k}^{n+1;LO}\right)/2 ( B x ; i + 1/2 , j , k n + 1 ; L O + B x ; i − 1/2 , j , k n + 1 ; L O ) /2 , ( B ‾ y ; i , j + 1 / 2 , k n + 1 ; L O + B ‾ y ; i , j − 1 / 2 , k n + 1 ; L O ) / 2 \left(\overline{B}_{y;i,j+1/2,k}^{n+1;LO}+\overline{B}_{y;i,j-1/2,k}^{n+1;LO}\right)/2 ( B y ; i , j + 1/2 , k n + 1 ; L O + B y ; i , j − 1/2 , k n + 1 ; L O ) /2 and ( B ‾ z ; i , j , k + 1 / 2 n + 1 ; L O + B ‾ z ; i , j , k − 1 / 2 n + 1 ; L O ) / 2 \left(\overline{B}_{z;i,j,k+1/2}^{n+1;LO}+\overline{B}_{z;i,j,k-1/2}^{n+1;LO}\right)/2 ( B z ; i , j , k + 1/2 n + 1 ; L O + B z ; i , j , k − 1/2 n + 1 ; L O ) /2 respectively. From the primitives V ^ i , j , k n + 1 ; L O \widehat{\boldsymbol{V}}_{i,j,k}^{n+1;LO} V i , j , k n + 1 ; L O we obtain the corresponding conservative variables in U ^ i , j , k n + 1 ; L O \widehat{\boldsymbol{U}}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O . Realize that, just by the definition, U ^ i , j , k n + 1 ; L O \widehat{\boldsymbol{U}}_{i,j,k}^{n+1;LO} U i , j , k n + 1 ; L O is PCP. Therefore, to obtain the PCP states in a troubled zone, we reset the states in the troubled zone as follows:-
[ U ‾ i , j , k n + 1 ; L O ] m = [ U ^ i , j , k n + 1 ; L O ] m for m = 1 , 2 , … , 5. (47) \left[\overline{\boldsymbol{U}}_{i,j,k}^{n+1;LO}\right]_{m}=\left[\widehat{\boldsymbol{U}}_{i,j,k}^{n+1;LO}\right]_{m}\quad\text{for }m=1,2,\ldots,5. \tag*{(47)} [ U i , j , k n + 1 ; L O ] m = [ U i , j , k n + 1 ; L O ] m for m = 1 , 2 , … , 5. (47)
This completes the description of a low order PCP strategy for the RMHD system. It is integrated into the higher order scheme as described in the text.
Why do 1D and 2D Riemann Solvers Work?
Since this is an astrophysics paper, it is possible to give the reader a physics-based argument as to why 1D and 2D Riemann solvers work. We can also explain the physics-driven connection between 1D and 2D Riemann solvers. To see that physics-motivated perspective, we will focus on the LLF Riemann solver. Consider the x-velocity equation for 1D isothermal flow. To keep the discussion very simple, say that the flow even has constant density. Then the evolutionary equation with a viscosity “μ \mu μ ” is given by:
∂ v x ∂ t + ∂ ∂ x ( v x 2 − μ ∂ v x ∂ x ) = 0. \frac{\partial v_x}{\partial t}+\frac{\partial}{\partial x}\left(v_x^2-\mu\frac{\partial v_x}{\partial x}\right)=0. ∂ t ∂ v x + ∂ x ∂ ( v x 2 − μ ∂ x ∂ v x ) = 0.
The form of the viscosity term in the above equation is the only tensorially invariant form that would guarantee conservation while allowing a dissipative term to operate. Since the above equation has a parabolic term, it is always expected to have a smooth solution on a fine mesh where the viscous terms are well-resolved. But we want the solution to be free of oscillations on coarser meshes even when the viscous terms are not well-resolved. This requires enhancing the dissipation term. The above equation will be numerically stabilized on a mesh with zones of any size if we use a numerical flux that is given by
F L L F ∗ = 1 2 ( v x R 2 + v x L 2 ) − μ ( v x R − v x L ) . F^{*}_{LLF} = \frac{1}{2}\left(v_{xR}^{2}+v_{xL}^{2}\right)-\mu\left(v_{xR}-v_{xL}\right). F LL F ∗ = 2 1 ( v x R 2 + v xL 2 ) − μ ( v x R − v xL ) .
The genesis of the above LLF flux stems from the realization that with μ → S / 2 \mu\to S/2 μ → S /2 we will get this desired stabilization on any mesh as long as “S S S ” is the largest local signal speed in the problem! In that limit, we can clearly see the centered part of the numerical flux as well as the dissipation terms that are needed for its numerical stabilization. (Of course, if one is working on a fine mesh that is fine enough to capture viscous scales, one would want “η \eta η ” to be the smaller value between the physical viscosity and the numerically motivated one.) This preamble enables us to understand the stabilization in the 2D LLF Riemann solver that is described in the next paragraph.
The induction equation for resistive MHD with a resistivity “η \eta η ” can now be written as:
∂ B ∂ t + ∇ × ( − v × B + η ∇ × B ) = 0. \frac{\partial\mathbf{B}}{\partial t}+\nabla\times\left(-\mathbf{v}\times\mathbf{B}+\eta\nabla\times\mathbf{B}\right)=0. ∂ t ∂ B + ∇ × ( − v × B + η ∇ × B ) = 0.
The form of the resistivity term in the above equation is the only tensorially invariant form that would guarantee divergence-free evolution while allowing a dissipative term to operate. Since the above equation also has a parabolic term ( ∇ × ( η ∇ × B ) = − η ∇ 2 B ) \left(\nabla\times\left(\eta\nabla\times\mathbf{B}\right)=-\eta\nabla^{2}\mathbf{B}\right) ( ∇ × ( η ∇ × B ) = − η ∇ 2 B ) , it is always expected to have a smooth solution on a fine mesh where the resistive terms are well-resolved. But we want the solution to be free of oscillations on coarser meshes even when the resistive terms are not well-resolved. This requires enhancing the dissipation term. The above equation will be numerically stabilized on a mesh with zones of any size if we use a numerical electric field that is given by
E z ∗ ∗ = ( E z R U + E z L U + E z L D + E z R D ) / 4 + η [ B x D − B x U + B y R − B y L ] . E_{z}^{**}=\left(E_{zRU}+E_{zLU}+E_{zLD}+E_{zRD}\right)/4+\eta\left[B_{xD}-B_{xU}+B_{yR}-B_{yL}\right]. E z ∗∗ = ( E z R U + E z LU + E z L D + E z R D ) /4 + η [ B x D − B xU + B y R − B y L ] .
By setting E z R U → ( − v × B ) z R U E_{zRU}\to(-\mathbf{v}\times\mathbf{B})_{zRU} E z R U → ( − v × B ) z R U , E z L U → ( − v × B ) z L U E_{zLU}\to(-\mathbf{v}\times\mathbf{B})_{zLU} E z LU → ( − v × B ) z LU , E z L D → ( − v × B ) z L D E_{zLD}\to(-\mathbf{v}\times\mathbf{B})_{zLD} E z L D → ( − v × B ) z L D and E z R D → ( − v × B ) z R D E_{zRD}\to(-\mathbf{v}\times\mathbf{B})_{zRD} E z R D → ( − v × B ) z R D we can clearly identify the centered part of the numerical electric field that is to be used; please see Figure 2 . We can also see that the solution is stabilized on any mesh if η → S / 2 \eta\to S/2 η → S /2 . A von Neumann stability analysis of the multidimensional induction equation by Balsara and Käppeli [22 ] shows that η → S / 2 \eta\to S/2 η → S /2 is indeed the right setting for numerical stability. It is easy to see that the discrete part of the curl is approximated as ∇ × B → [ B x D − B x U + B y R − B y L ] \nabla\times\mathbf{B} \to\left[B_{xD}-B_{xU}+B_{yR}-B_{yL}\right] ∇ × B → [ B x D − B xU + B y R − B y L ] ; please see Figure 2 . (Of course, if one is working on a fine mesh that is fine enough to capture resistive scales, one would want “η \eta η ” to be the smaller value between the physical resistivity and the numerically motivated one.)
In production codes, one goes through many more details to produce much better Riemann solvers with more desirable properties. The multidimensional HLL Riemann solver presented in this paper is a case in point because it permits the multidimensional upwinding to be maintained. A better Riemann solver provides a larger advantage to a numerical scheme especially when the order of accuracy of the numerical scheme is low. As the order of accuracy of the reconstruction improves, the jumps in the reconstructed variables that contribute to the dissipation terms become progressively smaller (as long as the problem is appropriately smooth). Therefore, very high order schemes can usually operate without much increase in the numerical dissipation even when a lower grade Riemann solver is used. This trend is clearly visible in Figure 9 of this paper.
References
Figure 1 Most astrophysics and space physics use the Yee discretization shown here. The figure shows that the primal variables of the magnetic field, given by the normal components of the magnetic field, are facially-collocated. The components of the primal magnetic field vector are shown by the thick arrows. The overbars on the magnetic field components indicate that these are facially averaged. They undergo an update from the induction equation. The edge-collocated electric fields, which are used for updating the facial magnetic induction components, are shown by the thin arrows close to the appropriate edge. They too have overbars to indicate that they are edge-averaged. The superscript “num” for the electric field components indicates that they are multidimensionally stabilized and, therefore, suitable for use in a numerical scheme.
Figure 2 shows four zones in the x y xy x y -plane that come together at the z z z -edge of a three-dimensional mesh. Since the mesh is viewed from the top in plan view, the z z z -edge is shown by the black dot and the four abutting zones are shown as four squares. The four incoming states have subscripts given by “RU” for right-upper; “LU” for left-upper; “LD” for left-down and “RD” for right-down. Figure 2 shows the situation before the states start interacting via four one-dimensional and one multidimensional Riemann problems. The thin oblique arrows indicate that higher-order interpolation can eventually be used to obtain the centered part of the electric field at the z z z -edge. The thick horizontal and vertical arrows denote the normal components of the magnetic field at the zone faces. Owing to the divergence constraint, these field components are continuous across zone faces. They can, therefore, be obtained from the higher order facial reconstruction of the normal component of the magnetic field within each face. This provides higher order values of the x x x - and y y y -components of the magnetic field at the z z z -edge that minimize the dissipation terms.
Figure 3 shows the same situation as in Figure 2 . However, it shows the situation after the four incoming states have interacted with each other. Four one-dimensional Riemann problems, shown by dashed lines, develop between the four pairs of incoming states. The resolved states from the one-dimensional HLL Riemann problems are shown by a superscript with a single star. The shaded region depicts the strongly interacting state that arises when the four one-dimensional Riemann problems interact with one another. The strongly interacting state is shown by a superscript with a double star. We want to find the z z z -component of the electric field in the strongly interacting state. This gives us the z z z -component of the electric field at the z z z -edge, which is shown by the dot in this two-dimensional projection.
Figs. 4a to 4d show the four cases that are fully supersonic in both directions. The axes, in similarity variables, are shown in blue. The wave model is shown in black.
Figure 4a (PDF p. 52) to Figure 4d (PDF p. 52) show the four cases that are fully supersonic in only one of the two directions. The axes, in similarity variables, are shown in blue. The wave model is shown in black.
Figure 5 shows the arrangement of the spatial nodes in the fourth order accurate RK-WENO algorithm for two space dimensions. The nodes within four abutting spatial zones are shown by the black dots. At fourth order, one-dimensional Gaussian quadrature requires the use of three quadrature points; we, therefore, see three nodes within each face. The red, double-sided arrows indicate the application of 1D Riemann solvers at the nodal points in the x x x -direction. The blue, double-sided arrows indicate the application of 1D Riemann solvers at the nodal points in the y y y -direction. The green dashed square at the right-upper vertex of zone ( i , j ) (i,j) ( i , j ) indicates the application of a 2D Riemann solver at the vertices of the mesh.
Figure 6 a and Figure 6 b are analogous to Figure 2 because they show four zones in the x y xy x y -plane that come together at the z z z -edge of a three-dimensional mesh. Figure 6 a shows the four zones that surround a z z z -edge. It shows how the “θ \theta θ ” variables that are evaluated at the x z xz x z - and y z yz y z -faces can be used to form an effective “θ \theta θ ” at the z z z -edge of the mesh. This effective “θ \theta θ ” at the z z z -edge can then be used to lower the order of the edge-centered z z z -component of the electric field that is used in the update of the facial magnetic fields in the x z xz x z - and y z yz y z -faces. Like Figure 2 , Figure 6 b shows the inputs that go into the evaluation of the z z z -component of the electric field. The only difference from Figure 2 is that we now have the option of making a high order evaluation (which uses all the high order WENO reconstructions and interpolations as described in the text) which is superscripted with “HO ”; and a low order (first order) evaluation which is superscripted with “LO ”.
Figure 7 is analogous to Figure 1 because it shows the components of the magnetic field in the faces of the mesh. The difference from Figure 1 is that within each face we now have a high order component which is superscripted with “HO ”; and a low order component which is superscripted with “LO ”. Both components in each face have been advanced in time using a forward Euler scheme with a timestep Δ t \Delta t Δ t . Both the components within each face will be used for the PCP update.
Figure 8 ) We present order of accuracy plots for the MHD and RMHD Vortex problems. We show L 1 L_1 L 1 and L ∞ L_\infty L ∞ errors for the x-momentum and x-magnetic field on a log scale versus the zone size. The top panel shows the accuracy plots for the MHD Vortex, and the bottom panel shows the accuracy plots for the RMHD Vortex problem. Both the MHD and RMHD vortex problems were run on a periodic domain that spans [ − 10 , 10 ] × [ − 10 , 10 ] [-10,10]\times[-10,10] [ − 10 , 10 ] × [ − 10 , 10 ] . To facilitate comparison with Balsara [11 ] , the MHD vortex was run on 100 2 100^2 10 0 2 , 200 2 200^2 20 0 2 and 400 2 400^2 40 0 2 zone meshes. The RMHD vortex was run on 64 2 64^2 6 4 2 , 128 2 128^2 12 8 2 , 256 2 256^2 25 6 2 and 512 2 512^2 51 2 2 zone meshes to facilitate comparison with Balsara and Kim [22 ] . The top-left corner shows the slopes for different orders.
Figure 9 ) We show plots of the magnetic energy distribution for the MHD-Vortex problem (obtained after one advection time). Following (Leidi et al. 2022) we used 64 2 64^2 6 4 2 zone mesh on a periodic domain that spans [ − 5 , 5 ] × [ − 5 , 5 ] [-5,5]\times[-5,5] [ − 5 , 5 ] × [ − 5 , 5 ] . It is not useful to double the domain because we only focus on the maximum value of the magnetic energy. We normalize the obtained magnetic energy by the maximum initial magnetic energy. The top panel shows the distribution obtained from the multidimensional LLF Riemann solver version of the scheme, and the bottom panel shows the results obtained from the multidimensional HLL Riemann solver version of the scheme. Second to sixth order simulations have been presented.
Figure 10 MHD Blast Problem: Figure 10a shows the density profile, Figure 10b shows the pressure profile, Figure 10c shows the square of the magnitude of the velocity field vector, Figure 10d shows the square of the magnitude of the magnetic field vector and Figure 10e shows the value of the zone-centered θ \theta θ that controls the amount of hybridization between high and low order schemes to obtain the PCP results. The profiles were obtained using a fourth-order scheme at time t = 0.001 t=0.001 t = 0.001 on a two-dimensional grid that consists of 400 × 400 400 \times400 400 × 400 zones. The plasma beta for this problem is β = 2.51 × 10 − 6 \beta=2.51 \times10^{-6} β = 2.51 × 1 0 − 6 . Finally, Figure 10f shows the time evolution of the relative error in the total energy at three different mesh sizes: 400 2 400^2 40 0 2 , 800 2 800^2 80 0 2 , and 1600 2 1600^2 160 0 2 .
Figure 10. MHD Blast Problem: Figure 10a shows the density profile, Figure 10b shows the pressure profile, Figure 10c shows the square of the magnitude of the velocity field vector, Figure 10d shows the square of the magnitude of the magnetic field vector and Figure 10e shows the value of the zone-centered θ \theta θ that controls the amount of hybridization between high and low order schemes to obtain the PCP results. The profiles were obtained using a fourth-order scheme at time t = 0.001 t=0.001 t = 0.001 on a two-dimensional grid that consists of 400 × 400 400 \times400 400 × 400 zones. The plasma beta for this problem is β = 2.51 × 10 − 6 \beta=2.51 \times10^{-6} β = 2.51 × 1 0 − 6 . Finally, Figure 10f shows the time evolution of the relative error in the total energy at three different mesh sizes: 400 2 400^2 40 0 2 , 800 2 800^2 80 0 2 , and 1600 2 1600^2 160 0 2 .
Figure 11 MHD Jet Problem: Figure 11a shows the log 10 \log_{10} log 10 of the density, Figure 11b shows the log 10 \log_{10} log 10 of the pressure, Figure 11c shows the square of the magnitude of the magnetic field vector, and Figure 11d shows the value of the zone-centered θ \theta θ that controls the amount of hybridization between high and low order schemes to obtain the PCP results. The profiles were obtained at time t = 0.002 t=0.002 t = 0.002 using a sixth-order scheme on a two-dimensional grid that consists of 400 × 600 400 \times600 400 × 600 zones. The plasma beta for this problem is β = 10 − 4 \beta=10^{-4} β = 1 0 − 4 .
Figure 11. MHD Jet Problem: Figure 11a shows the log 10 \log_{10} log 10 of the density, Figure 11b shows the log 10 \log_{10} log 10 of the pressure, Figure 11c shows the square of the magnitude of the magnetic field vector, and Figure 11d shows the value of the zone-centered θ \theta θ that controls the amount of hybridization between high and low order schemes to obtain the PCP results. The profiles were obtained at time t = 0.002 t=0.002 t = 0.002 using a sixth-order scheme on a two-dimensional grid that consists of 400 × 600 400 \times600 400 × 600 zones. The plasma beta for this problem is β = 10 − 4 \beta=10^{-4} β = 1 0 − 4 .
Figure 12 RMHD Blast Problem: Figure 12 a shows the density profile, Figure 12 b shows the pressure profile, Figure 12 c shows the magnitude-squared of the Lorentz-velocity vector, Figure 12 d shows the magnitude-squared of the magnetic field vector and Figure 12 e shows the value of the zone-centered θ \theta θ that controls the amount of hybridization between high and low order schemes to obtain the PCP results. The profiles were obtained using a fifth-order scheme at time t = 4 t=4 t = 4 on a two-dimensional grid that consists of 400 × 400 400 \times400 400 × 400 zones. The plasma beta for this problem is β = 2.5 × 10 − 6 \beta=2.5 \times10^{-6} β = 2.5 × 1 0 − 6 . Finally, Figure 12 f shows the time evolution of the relative error in the total energy at three different mesh sizes: 400 2 400^2 40 0 2 , 800 2 800^2 80 0 2 , and 1600 2 1600^2 160 0 2 .
Figure 13 RMHD Jet Problem: Figure 13 a shows the log 10 \log_{10} log 10 of the density, Figure 13 b shows the log 10 \log_{10} log 10 of the pressure, Figure 13 c shows the square of the magnitude of the magnetic field vector and Figure 13 d shows the value of the zone-centered θ \theta θ that controls the amount of hybridization between high and low order schemes to obtain the PCP results. The profiles were obtained at time t = 30 t=30 t = 30 using a fourth-order scheme on a two-dimensional grid that consists of 720 × 750 720 \times750 720 × 750 zones. The plasma beta for this problem is β = 10 − 3 \beta=10^{-3} β = 1 0 − 3 .
All_Figs_FV_WENO_MHD_RMHD_PCP.pdf
Slide Number 1
Slide Number 2
Slide Number 3
Slide Number 4
Figure 4. Figs. 4a to 4d show the four cases that are fully supersonic in both directions. The axes, in similarity variables, are shown in blue. The wave model is shown in black.
Slide Number 5
Figure 4 (PDF p. 52). Figure 4a (PDF p. 52) to Figure 4d (PDF p. 52) show the four cases that are fully supersonic in only one of the two directions. The axes, in similarity variables, are shown in blue. The wave model is shown in black.
Slide Number 6
Slide Number 7
Slide Number 8
Slide Number 9
Slide Number 10
Slide Number 11
Slide Number 12
Slide Number 13
Slide Number 14