Skip to main content
Log in

Constraint Preserving Discontinuous Galerkin Method for Ideal Compressible MHD on 2-D Cartesian Grids

  • Published:
Journal of Scientific Computing Aims and scope Submit manuscript

Abstract

We propose a constraint preserving discontinuous Galerkin method for ideal compressible MHD in two dimensions and using Cartesian grids, which automatically maintains the global divergence-free property. The approximation of the magnetic field is achieved using Raviart–Thomas polynomials and the DG scheme is based on evolving certain moments of these polynomials which automatically guarantees divergence-free property. We also develop HLL-type multi-dimensional Riemann solvers to estimate the electric field at vertices which are consistent with the 1-D Riemann solvers. When limiters are used, the divergence-free property may be lost and it is recovered by a divergence-free reconstruction step. We show the performance of the method on a range of test cases up to fourth order of accuracy.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21
Fig. 22
Fig. 23
Fig. 24

Similar content being viewed by others

Notes

  1. Here the indices ij denote the solution modes and not the cell indices.

  2. Code taken from https://github.com/PrincetonUniversity/athena-public-version at git version 273e451e16d3a5af594dd0a.

References

  1. Balsara, D.S.: Divergence-free adaptive mesh refinement for magnetohydrodynamics. J. Comput. Phys. 174, 614–648 (2001)

    MATH  Google Scholar 

  2. Balsara, D.S.: Second-order-accurate schemes for magnetohydrodynamics with divergence-free reconstruction. Astrophys. J. Suppl. Ser. 151, 149–184 (2004)

    Google Scholar 

  3. Balsara, D.S.: Divergence-free reconstruction of magnetic fields and WENO schemes for magnetohydrodynamics. J. Comput. Phys. 228, 5040–5056 (2009)

    MathSciNet  MATH  Google Scholar 

  4. Balsara, D.S.: Multidimensional HLLE Riemann solver: application to Euler and magnetohydrodynamic flows. J. Comput. Phys. 229, 1970–1993 (2010)

    MathSciNet  MATH  Google Scholar 

  5. Balsara, D.S.: Multidimensional Riemann problem with self-similar internal structure. Part I—application to hyperbolic conservation laws on structured meshes. J. Comput. Phys. 277, 163–200 (2014)

    MathSciNet  MATH  Google Scholar 

  6. Balsara, D.S., Käppeli, R.: Von Neumann stability analysis of globally divergence-free RKDG schemes for the induction equation using multidimensional Riemann solvers. J. Comput. Phys. 336, 104–127 (2017)

    MathSciNet  MATH  Google Scholar 

  7. Balsara, D.S., Spicer, D.S.: A staggered mesh algorithm using high order Godunov fluxes to ensure solenoidal magnetic fields in magnetohydrodynamic simulations. J. Comput. Phys. 149, 270–292 (1999)

    MathSciNet  MATH  Google Scholar 

  8. Batten, P., Clarke, N., Lambert, C., Causon, D.M.: On the choice of wavespeeds for the HLLC Riemann solver. SIAM J. Sci. Comput. 18, 1553–1570 (1997)

    MathSciNet  MATH  Google Scholar 

  9. Bohm, M., Winters, A.R., Gassner, G.J., Derigs, D., Hindenlang, F., Saur, J.: An entropy stable nodal discontinuous Galerkin method for the resistive MHD equations. Part I: theory and numerical verification. J. Comput. Phys. 108076 (2018). https://doi.org/10.1016/j.jcp.2018.06.027

  10. Bouchut, F., Klingenberg, C., Waagan, K.: A multiwave approximate Riemann solver for ideal MHD based on relaxation. I: Theoretical framework. Numer. Math. 108, 7–42 (2007)

    MathSciNet  MATH  Google Scholar 

  11. Brackbill, J., Barnes, D.: The effect of nonzero \(\nabla \)\(\cdot \) B on the numerical solution of the magnetohydrodynamic equations. J. Comput. Phys. 35, 426–430 (1980)

    MathSciNet  MATH  Google Scholar 

  12. Brezzi, F., Fortin, M.: Mixed and Hybrid Finite Element Methods. Springer Series in Computational Mathematics, vol. 15. Springer, New York (1991)

    MATH  Google Scholar 

  13. Brio, M., Wu, C.: An upwind differencing scheme for the equations of ideal magnetohydrodynamics. J. Comput. Phys. 75, 400–422 (1988)

    MathSciNet  MATH  Google Scholar 

  14. Chandrashekar, P.: A Global Divergence Conforming DG Method for Hyperbolic Conservation laws with divergence constraint. J. Sci. Comput. 79, 79–102 (2019)

    MathSciNet  MATH  Google Scholar 

  15. Chandrashekar, P., Klingenberg, C.: Entropy stable finite volume scheme for ideal compressible MHD on 2-D Cartesian meshes. SIAM J. Numer. Anal. 54, 1313–1340 (2016)

    MathSciNet  MATH  Google Scholar 

  16. Cheng, Y., Li, F., Qiu, J., Xu, L.: Positivity-preserving DG and central DG methods for ideal MHD equations. J. Comput. Phys. 238, 255–280 (2013)

    MathSciNet  MATH  Google Scholar 

  17. Cockburn, B., Hou, S., Shu, C.-W.: The Runge–Kutta local projection discontinuous Galerkin finite element method for conservation laws. IV: the multidimensional case. Math. Comput. 54, 545 (1990)

    MathSciNet  MATH  Google Scholar 

  18. Cockburn, B., Li, F., Shu, C.-W.: Locally divergence-free discontinuous Galerkin methods for the Maxwell equations. J. Comput. Phys. 194, 588–610 (2004)

    MathSciNet  MATH  Google Scholar 

  19. Cockburn, B., Lin, S.-Y., Shu, C.-W.: TVB Runge–Kutta local projection discontinuous Galerkin finite element method for conservation laws III: one-dimensional systems. J. Comput. Phys. 84, 90–113 (1989)

    MathSciNet  MATH  Google Scholar 

  20. Dedner, A., Kemm, F., Kröner, D., Munz, C.-D., Schnitzer, T., Wesenberg, M.: Hyperbolic divergence cleaning for the MHD equations. J. Comput. Phys. 175, 645–673 (2002)

    MathSciNet  MATH  Google Scholar 

  21. Derigs, D., Winters, A.R., Gassner, G.J., Walch, S., Bohm, M.: Ideal GLM-MHD: about the entropy consistent nine-wave magnetic field divergence diminishing ideal magnetohydrodynamics equations. J. Comput. Phys. 364, 420–467 (2018)

    MathSciNet  MATH  Google Scholar 

  22. Evans, C.R., Hawley, J.F.: Simulation of magnetohydrodynamic flows—a constrained transport method. Astrophys. J. 332, 659 (1988)

    Google Scholar 

  23. Fu, G., Shu, C.-W.: A new troubled-cell indicator for discontinuous Galerkin methods for hyperbolic conservation laws. J. Comput. Phys. 347, 305–327 (2017)

    MathSciNet  MATH  Google Scholar 

  24. Fu, P., Li, F., Xu, Y.: Globally divergence-free discontinuous Galerkin methods for ideal magnetohydrodynamic equations. J. Sci. Comput. 77, 1621–1659 (2018)

    MathSciNet  MATH  Google Scholar 

  25. Gardiner, T.A., Stone, J.M.: An unsplit Godunov method for ideal MHD via constrained transport. J. Comput. Phys. 205, 509–539 (2005)

    MathSciNet  MATH  Google Scholar 

  26. Godunov, S.: Symmetric form of the magnetohydrodynamic equation. Chislennye Metody Mekh. Sploshnoi Sredy 3, 26–34 (1972)

    Google Scholar 

  27. Guillet, T., Pakmor, R., Springel, V., Chandrashekar, P., Klingenberg, C.: High-order magnetohydrodynamics for astrophysics with an adaptive mesh refinement discontinuous Galerkin scheme. Mon. Not. R. Astron. Soc. 485, 4209–4246 (2019)

    Google Scholar 

  28. Gurski, K.F.: An HLLC-type approximate Riemann solver for ideal magnetohydrodynamics. SIAM J. Sci. Comput. 25, 2165–2187 (2004)

    MathSciNet  MATH  Google Scholar 

  29. Harten, A., Lax, P.D., van Leer, B.: On Upstream Differencing and Godunov-Type Schemes for Hyperbolic conservation laws. SIAM Rev. 25, 35–61 (1983)

    MathSciNet  MATH  Google Scholar 

  30. Hazra, A., Chandrashekar, P., Balsara, D.S.: Globally constraint-preserving FR/DG scheme for Maxwell’s equations at all orders. J. Comput. Phys. 394, 298–328 (2019)

    MathSciNet  Google Scholar 

  31. Janhunen, P.: A positive conservative method for magnetohydrodynamics based on HLL and Roe methods. J. Comput. Phys. 160, 649–661 (2000)

    MathSciNet  MATH  Google Scholar 

  32. Kraaijevanger, J.F.B.M.: Contractivity of Runge–Kutta methods. BIT Numer. Math. 31, 482–528 (1991)

    MathSciNet  MATH  Google Scholar 

  33. Li, F., Shu, C.-W.: Locally divergence-free discontinuous Galerkin methods for MHD equations. J. Sci. Comput. 22–23, 413–442 (2005)

    MathSciNet  MATH  Google Scholar 

  34. Li, F., Xu, L.: Arbitrary order exactly divergence-free central discontinuous Galerkin methods for ideal MHD equations. J. Comput. Phys. 231, 2655–2675 (2012)

    MathSciNet  MATH  Google Scholar 

  35. Li, F., Xu, L., Yakovlev, S.: Central discontinuous Galerkin methods for ideal MHD equations with the exactly divergence-free magnetic field. J. Comput. Phys. 230, 4828–4847 (2011)

    MathSciNet  MATH  Google Scholar 

  36. Li, S.: An HLLC Riemann solver for magneto-hydrodynamics. J. Comput. Phys. 203, 344–357 (2005)

    MathSciNet  MATH  Google Scholar 

  37. Liu, Y., Shu, C.-W., Zhang, M.: Entropy stable high order discontinuous Galerkin methods for ideal compressible MHD on structured meshes. J. Comput. Phys. 354, 163–178 (2018)

    MathSciNet  MATH  Google Scholar 

  38. Orszag, S.A., Tang, C.-M.: Small-scale structure of two-dimensional magnetohydrodynamic turbulence. J. Fluid Mech. 90, 129 (1979)

    Google Scholar 

  39. Powell, K.G., Roe, P.L., Linde, T.J., Gombosi, T.I., De Zeeuw, D.L.: A solution-adaptive upwind scheme for ideal magnetohydrodynamics. J. Comput. Phys. 154, 284–309 (1999)

    MathSciNet  MATH  Google Scholar 

  40. Raviart, P.A., Thomas, J.M.: A mixed finite element method for 2-nd order elliptic problems. In: Galligani, I., Magenes, E. (eds.) Mathematical Aspects of Finite Element Methods, vol. 606, pp. 292–315. Springer, Berlin (1977)

    Google Scholar 

  41. Rusanov, V.: The calculation of the interaction of non-stationary shock waves and obstacles. USSR Comput. Math. Math. Phys. 1, 304–320 (1962)

    Google Scholar 

  42. Shu, C.-W., Osher, S.: Efficient implementation of essentially non-oscillatory shock-capturing schemes. J. Comput. Phys. 77, 439–471 (1988)

    MathSciNet  MATH  Google Scholar 

  43. Spiteri, R.J., Ruuth, S.J.: A New Class of Optimal High-Order Strong-Stability-Preserving Time Discretization methods. SIAM J. Numer. Anal. 40, 469–491 (2002)

    MathSciNet  MATH  Google Scholar 

  44. Toro, E.F.: Riemann Solvers and Numerical Methods for Fluid Dynamics. Springer, Berlin (2009)

    MATH  Google Scholar 

  45. Toro, E.F., Spruce, M., Speares, W.: Restoration of the contact surface in the HLL-Riemann solver. Shock Waves 4, 25–34 (1994)

    MATH  Google Scholar 

  46. Tóth, G.: The \(\nabla \)\(\cdot \) B constraint in shock-capturing magnetohydrodynamics codes. J. Comput. Phys. 161, 605–652 (2000)

    MathSciNet  MATH  Google Scholar 

  47. Vides, J., Nkonga, B., Audit, E.: A simple two-dimensional extension of the HLL Riemann solver for hyperbolic systems of conservation laws. J. Comput. Phys. 280, 643–675 (2015)

    MathSciNet  MATH  Google Scholar 

  48. Winters, A.R., Gassner, G.J.: Affordable, entropy conserving and entropy stable flux functions for the ideal MHD equations. J. Comput. Phys. 304, 72–108 (2016)

    MathSciNet  MATH  Google Scholar 

  49. Wu, K.: Positivity-preserving analysis of numerical schemes for ideal magnetohydrodynamics. SIAM J. Numer. Anal. 56, 2124–2147 (2018)

    MathSciNet  MATH  Google Scholar 

  50. Wu, K., Shu, C.-W.: A Provably Positive Discontinuous Galerkin Method for Multidimensional ideal magnetohydrodynamics. SIAM J. Sci. Comput. 40, B1302–B1329 (2018)

    MathSciNet  MATH  Google Scholar 

  51. Zhang, X., Shu, C.-W.: On maximum-principle-satisfying high order schemes for scalar conservation laws. J. Comput. Phys. 229, 3091–3120 (2010)

    MathSciNet  MATH  Google Scholar 

  52. Zhang, X., Shu, C.-W.: On positivity-preserving high order discontinuous Galerkin schemes for compressible Euler equations on rectangular meshes. J. Comput. Phys. 229, 8918–8934 (2010)

    MathSciNet  MATH  Google Scholar 

Download references

Acknowledgements

Praveen Chandrashekar would like to acknowledge support from SERB-DST, India, under the MATRICS grant (MTR/2018/000006) and Department of Atomic Energy, Government of India, under project no. 12-R&D-TFR-5.01-0520. Rakesh Kumar would like to acknowledge funding support from the National Post-doctoral Fellowship (PDF/2018/002621) administered by SERB-DST, India.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Praveen Chandrashekar.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

A Limiting and Divergence-Free Reconstruction

When the solution on the faces \(b_x\), \(b_y\) is limited as explained in Sect. 7, we lose the divergence-free property of the magnetic field. To recover this property, we have to perform a divergence-free reconstruction step. We explain this reconstruction process for second, third and fourth order accuracy. The fifth order version is given in [30] together with more details on the reconstruction idea. The resulting polynomial has the structure of the BDM polynomial on rectangles, see [12], Equation (3.29). Here we explain how the RT polynomial can be modified to recover divergence-free property. In two dimensions, the BDM polynomial has \((k+1)(k+2)+2\) degrees of freedom while its divergence has \({\frac{1}{2}}k(k+1)\) coefficients. Up to third order accuracy, the reconstruction can be performed using only the solution on the faces \((b_x, b_y)\), but at fourth order and higher, we need additional information which is supplied in the form of the curl of the magnetic field. This additional information is available to us via the cell moments \(\alpha , \beta \).

For example, at fourth order, the BDM polynomial has \((3+1)(3+2)+2 =22\) degrees of freedom, while the face solution \((b_x,b_y)\), which are polynomials of degree 3, provide \((4+4+4+4)-1=15\) degrees of freedom, where one piece of information is redundant since the face solution satisfies \(\int _{\partial K} \varvec{B}\cdot \varvec{n}\text{ d }s = 0\) on each cell K. The divergence-free condition on the BDM polynomial yields \({\frac{1}{2}}(3)(3+1)=6\) conditions. So we have a total of \(15+6 = 21\) equations but 22 coefficients to be determined. Hence we need to supply one additional piece of information to completely determine the BDM polynomial.

We have the following inclusions \(\mathbb {P}_k^2 \subset \text {BDM}(k) \subset \text {RT}(k)\) and the RT polynomial has many more basis functions than the BDM polynomial. In the reconstruction process, we set some of the coefficients \(\{a,b\}\) in the RT polynomial to zero but this does not affect the accuracy since only coefficients \(a_{ij}, b_{ij}\) with \(i+j > k\) are set to zero, and we retain the \(\mathbb {P}_k\) part of the solution.

1.1 A.1 Degree \(k=1\)

The divergence of the vector field \(\varvec{B}\in \text {RT}(1)\) is given by

$$\begin{aligned} \begin{aligned} \nabla \cdot \varvec{B}&= \frac{a_{10}}{\Delta x} + \frac{b_{01}}{\Delta y} + \left( \frac{2 a_{20}}{\Delta x} + \frac{b_{11}}{\Delta y} \right) \phi _1(\xi ) + \left( \frac{a_{11}}{\Delta x} + \frac{2 b_{02}}{\Delta y} \right) \phi _1(\eta ) \\&\quad + 2 \left( \frac{a_{21}}{\Delta x} + \frac{b_{12}}{\Delta y} \right) \phi _1(\xi ) \phi _1(\eta ) \end{aligned} \end{aligned}$$

The coefficients \(a_{ij}, b_{ij}\) are related to the face solution and cell moments according to Table 1. The constant term is already zero. The linear terms can be made zero by setting

$$\begin{aligned} \alpha _{00}= & {} {\frac{1}{2}}(a_0^- + a_0^+) + \frac{1}{12} (b_1^+ - b_1^-) \frac{\Delta x}{\Delta y}\\ \beta _{00}= & {} {\frac{1}{2}}(b_0^- + b_0^+) + \frac{1}{12} (a_1^+ - a_1^-) \frac{\Delta y}{\Delta x} \end{aligned}$$

This will however destroy the conservation property since \(\alpha _{00}\), \(\beta _{00}\) are cell averages of \(B_x\), \(B_y\) respectively. The bilinear term can be made zero by individually setting \(a_{21} = b_{12} = 0\) which yields

$$\begin{aligned} \alpha _{01} = {\frac{1}{2}}(a_1^- + a_1^+), \qquad \beta _{10} = {\frac{1}{2}}(b_1^- + b_1^+) \end{aligned}$$

By this process we would have modified all the cell moments and the resulting reconstruction coincides with that of Balsara.

1.2 A.2 Degree \(k=2\)

The divergence of the vector field \(\varvec{B}\in \text {RT}(2)\) is given by

$$\begin{aligned} \nabla \cdot \varvec{B}&= \left[ \frac{1}{\Delta x}\left( a_{10}+\frac{a_{30}}{10}\right) + \frac{1}{\Delta y}\left( b_{01} + \frac{b_{03}}{10}\right) \right] + \left[ \frac{2}{\Delta x}a_{20} +\frac{1}{\Delta y}\left( b_{11}+\frac{b_{13}}{10}\right) \right] \phi _1(\xi ) \\&+ \left[ \frac{1}{\Delta x}\left( a_{11}+\frac{a_{31}}{10}\right) +\frac{2}{\Delta y}b_{02}\right] \phi _1(\eta ) + \left[ \frac{3}{\Delta x}a_{30}+\frac{1}{\Delta y}\left( b_{21}+\frac{b_{23}}{10}\right) \right] \phi _2(\xi ) \\&+ 2\left[ \frac{a_{21}}{\Delta x}+\frac{b_{12}}{\Delta y}\right] \phi _1(\xi ) \phi _1(\eta ) + \left[ \frac{1}{\Delta x}\left( a_{12}+\frac{a_{32}}{10}\right) +\frac{3}{\Delta y}b_{03}\right] \phi _2(\eta ) \\&+ \left[ \frac{2}{\Delta x} a_{22} +\frac{3}{\Delta y}b_{13}\right] \phi _1(\xi )\phi _2(\eta )+\left[ \frac{3}{\Delta x}a_{31}+\frac{2}{\Delta y}b_{22} \right] \phi _2(\xi )\phi _1(\eta )\\&+ 3\left[ \frac{a_{32}}{\Delta x} + \frac{b_{23}}{\Delta y}\right] \phi _2(\xi )\phi _2(\eta ) \end{aligned}$$

The constant term is already zero. The linear terms can be made zero by setting

$$\begin{aligned} \alpha _{00} = {\frac{1}{2}}(a_0^- + a_0^+) + \frac{1}{12} (b_1^+ - b_1^-) \frac{\Delta x}{\Delta y}, \qquad \beta _{00} = {\frac{1}{2}}(b_0^- + b_0^+) + \frac{1}{12} (a_1^+ - a_1^-) \frac{\Delta y}{\Delta x} \end{aligned}$$

The quadratic terms are zero by choosing

$$\begin{aligned} \alpha _{10} = a_0^+ - a_0^- + \frac{1}{30}(b_2^+ - b_2^-) \frac{\Delta x}{\Delta y}, \qquad \beta _{01} = b_0^+ - b_0^- + \frac{1}{30}(a_2^+ - a_2^-) \frac{\Delta y}{\Delta x} \end{aligned}$$

and also setting \(a_{21} = b_{12} = 0\) which yields

$$\begin{aligned} \alpha _{01} = {\tfrac{1}{2}}(a_1^- + a_1^+), \qquad \beta _{10} = {\tfrac{1}{2}}(b_1^- + b_1^+) \end{aligned}$$

In the cubic terms, we set each coefficient to zero, \(a_{22} = a_{31} = a_{32} = b_{22} = b_{13} = b_{23} = 0\), which yields

$$\begin{aligned} \begin{array}{ll} \alpha _{02} = {\tfrac{1}{2}}(a_2^- + a_2^+) &{} \qquad \qquad \beta _{20} = {\tfrac{1}{2}}(b_2^- + b_2^+) \\ \alpha _{11} = a_1^+ - a_1^- &{} \qquad \qquad \beta _{11} = b_1^+ - b_1^- \\ \end{array} \end{aligned}$$

Finally, in the biquadratic term, we set \(a_{32} = b_{23} = 0\) to obtain

$$\begin{aligned} \alpha _{12} = a_2^+ - a_2^-, \qquad \beta _{21} = b_2^+ - b_2^- \end{aligned}$$

1.3 A.3 Degree \(k=3\)

The divergence of the vector field \(\varvec{B}\in \text {RT}(3)\) is given by

$$\begin{aligned} \nabla \cdot \varvec{B}=&\left[ \frac{1}{\Delta x}\left( a_{10}+\frac{a_{30}}{10}\right) + \frac{1}{\Delta y}\left( b_{01} + \frac{b_{03}}{10}\right) \right] \\ +&\left[ \frac{1}{\Delta x}\left( 2a_{20}+\frac{6}{35}a_{40}\right) +\frac{1}{\Delta y}\left( b_{11}+\frac{b_{13}}{10}\right) \right] \phi _1(\xi ) \\ +&\left[ \frac{1}{\Delta x}\left( a_{11}+\frac{a_{31}}{10}\right) +\frac{1}{\Delta y}\left( 2b_{02}+\frac{6}{35}b_{04}\right) \right] \phi _1(\eta )\\ +&\left[ \frac{3}{\Delta x}a_{30}+\frac{1}{\Delta y}\left( b_{21}+\frac{b_{23}}{10}\right) \right] \phi _2(\xi )+ \left[ \frac{1}{\Delta x}\left( a_{12}+\frac{a_{32}}{10}\right) +\frac{3}{\Delta y}b_{03}\right] \phi _2(\eta ) \\ +&\left[ \frac{1}{\Delta x}\left( 2a_{21}+\frac{6}{35}a_{41}\right) +\frac{1}{\Delta y}\left( 2b_{12}+\frac{6}{35}b_{14}\right) \right] \phi _1(\xi ) \phi _1(\eta ) \\ +&\left[ \frac{4}{\Delta x}a_{40} + \frac{1}{\Delta y}\left( b_{31}+\frac{b_{33}}{10}\right) \right] \phi _3(\xi )+\left[ \frac{1}{\Delta x}\left( 2 a_{22}+\frac{6}{35}a_{42}\right) +\frac{3}{\Delta y}b_{13}\right] \phi _1(\xi )\phi _2(\eta )\\ +&\left[ \frac{3}{\Delta x}a_{31}+\frac{1}{\Delta y}\left( 2b_{22}+\frac{6}{35}b_{24}\right) \right] \phi _2(\xi )\phi _1(\eta ) + \left[ \frac{1}{\Delta x}\left( a_{13}+\frac{a_{33}}{10}\right) +\frac{4}{\Delta y} b_{04}\right] \phi _3(\eta )\\ +\,&3\left[ \frac{a_{32}}{\Delta x} + \frac{b_{23}}{\Delta y}\right] \phi _2(\xi )\phi _2(\eta ) + \left[ \frac{1}{\Delta x}\left( 2 a_{23}+\frac{6}{35}a_{43}\right) +\frac{4}{\Delta y} b_{14}\right] \phi _1(\xi ) \phi _3(\eta ) \\ +&\left[ \frac{4}{\Delta x}a_{41} +\frac{1}{\Delta y}\left( 2b_{32} +\frac{6}{35}b_{34} \right) \right] \phi _3(\xi )\phi _1(\eta ) \\ +&\left[ \frac{3}{\Delta x} a_{33} +\frac{4}{\Delta y}b_{24}\right] \phi _2(\xi ) \phi _3(\eta ) +\left[ \frac{4}{\Delta x}a_{42} + \frac{3}{\Delta y}b_{33}\right] \phi _3(\xi ) \phi _2(\eta ) \\ +&\left[ \frac{4}{\Delta x} a_{43}+\frac{4}{\Delta y}b_{34} \right] \phi _3(\xi ) \phi _3(\eta ) \end{aligned}$$

The constant term is already zero. The linear terms can be made zero by setting

$$\begin{aligned} \alpha _{00} = {\frac{1}{2}}(a_0^- + a_0^+) + \frac{1}{12} (b_1^+ - b_1^-) \frac{\Delta x}{\Delta y}, \qquad \beta _{00} = {\frac{1}{2}}(b_0^- + b_0^+) + \frac{1}{12} (a_1^+ - a_1^-) \frac{\Delta y}{\Delta x} \end{aligned}$$

The quadratic terms which are coefficients of \(\phi _2(\xi )\), \(\phi _2(\eta )\) become zero by choosing

$$\begin{aligned} \alpha _{10} = a_0^+ - a_0^- + \frac{1}{30}(b_2^+ - b_2^-) \frac{\Delta x}{\Delta y}, \qquad \beta _{01} = b_0^+ - b_0^- + \frac{1}{30}(a_2^+ - a_2^-) \frac{\Delta y}{\Delta x} \end{aligned}$$

The coefficient of \(\phi _1(\xi )\phi _1(\eta )\) gives only one equation but there are two unknowns; adding an extra equation \(\omega = \beta _{10}-\alpha _{01}\), we can solve for the two coefficients

$$\begin{aligned} \alpha _{01} = \frac{1}{\left( 1+\frac{\Delta y}{\Delta x}\right) }\left( r_2-\omega +r_1\frac{\Delta y}{\Delta x}\right) , \qquad \beta _{10} = \omega +\alpha _{01} \end{aligned}$$

where \(r_1={\frac{1}{2}}(a_1^{-}+a_1^{+})\) and \(r_2={\frac{1}{2}}(b_1^{-}+b_1^{+})\). The cubic terms are zeros by choosing

$$\begin{aligned}&\alpha _{20} = -{\frac{1}{2}}(b_1^{+}-b_1^{-})\frac{\Delta x}{\Delta y}+\frac{3}{140}(b_3^{+}-b_3^{-})\frac{\Delta x}{\Delta y},\\&\beta _{02}=-\frac{1}{2}(a_1^{+}-a_1^{-})\frac{\Delta y}{\Delta x}+\frac{3}{140}(a_3^{+}-a_3^{-})\frac{\Delta y}{\Delta x} \end{aligned}$$

and setting \(2 a_{22}+\frac{6}{35}a_{42} = 2b_{22}+\frac{6}{35}b_{24} = a_{31} = b_{13} = 0\), which yields

$$\begin{aligned} \begin{array}{ll} \alpha _{02} = {\tfrac{1}{2}}(a_2^- + a_2^+) &{} \qquad \qquad \beta _{20} = {\tfrac{1}{2}}(b_2^- + b_2^+) \\ \alpha _{11} = a_1^+ - a_1^- &{} \qquad \qquad \beta _{11} = b_1^+ - b_1^- \\ \end{array} \end{aligned}$$

In the higher order term greater then three, we set each coefficient to zero, \(a_{32}=b_{23} = 2a_{23}+\frac{6}{35}a_{43} = b_{14}=a_{41} = 2b_{32}+\frac{6}{35}b_{34} = a_{33}=b_{24}=a_{42}=b_{33}=a_{43}=b_{34}=0\), which yields

$$\begin{aligned} \begin{array}{ll} \alpha _{12} = a_2^+ - a_2^- &{} \qquad \qquad \beta _{21} = b_2^+ - b_2^-\\ \alpha _{03} = {\tfrac{1}{2}}(a_3^+ +a_3^-) &{} \qquad \qquad \beta _{12} = 6(r_2-\beta _{10})\\ \alpha _{21} = 6(r_1-\alpha _{01}) &{}\qquad \qquad \beta _{30} = {\tfrac{1}{2}}(b_3^+ +b_3^-)\\ \alpha _{13} = \alpha _3^+ -\alpha _3^- &{}\qquad \qquad \beta _{22} = 0\\ \alpha _{22} = 0 &{}\qquad \qquad \beta _{31} = b_3^+-b_3^-\\ \alpha _{23} = 0 &{} \qquad \qquad \beta _{32} = 0 \end{array} \end{aligned}$$

We see that at fourth order, we need an extra information which we took in the form of the quantity \(\omega \) in order to complete the divergence-free reconstruction. Note \(\omega \) gives us information about the curl of the magnetic field.

B Setting the Initial Condition

Let \(\psi _h \in \mathbb {Q}_{k+1,k+1}\) be a continuous interpolation of the magnetic potential \(\psi \) which can be achieved using \((k+2)\times (k+2)\) GLL nodes. Then we can set the magnetic field as \(B_x = \frac{\partial \psi _h}{\partial y}\), \(B_y = -\frac{\partial \psi _h}{\partial x}\) which will be exactly divergence-free. But in our work, we want to set the initial condition in terms of the polynomials \(b_x,b_y\) and the moments \(\alpha ,\beta \). We can perform an \(L^2\) projection of \(\nabla \times (\psi _h e_z)\) to initialize \(b_x,b_y\) which will be exact, and the moments can be computed using the same GLL nodes for quadrature as are used to define \(\psi _h\). Let \(\xi _i, i=1,2,\ldots ,k+2\) denote the GLL nodes and let \(\ell _i(\xi ), i=1,2,\ldots ,k+2\) be the Lagrange polynomials. Define the barycentric weights

$$\begin{aligned} w_j = \frac{1}{\prod _{i=1, i\ne j}^{k+2} (\xi _j - \xi _i)} \end{aligned}$$

Then the derivatives of Lagrange polynomials at the GLL nodes are given by

$$\begin{aligned} D_{ij} = \ell _j'(\xi _i) = \frac{w_j}{w_i} \frac{1}{\xi _i - \xi _j}, \quad i \ne j, \qquad D_{ii} = \ell _i'(\xi _i) = -\sum _{j=1, j \ne i}^{k+2} D_{ij} \end{aligned}$$

The derivatives of the potential at the GLL nodes are given by

$$\begin{aligned} \frac{\partial \psi _h}{\partial x}(\xi _i,\xi _j) = \frac{1}{\Delta x} [D \cdot \psi (:,j)]_i, \qquad \frac{\partial \psi _h}{\partial y}(\xi _i,\xi _j) = \frac{1}{\Delta y} [D \cdot \psi (i,:)]_j \end{aligned}$$

The cell moments are initialized as \(\alpha = \alpha ^h(\partial _y \psi _h)\) and \(\beta = \beta ^h(-\partial _x\psi _h)\) where the superscript h denotes that we compute the integrals using \((k+2)^2\)-point GLL quadrature which is exact for the integrands involved in the cell moments.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Chandrashekar, P., Kumar, R. Constraint Preserving Discontinuous Galerkin Method for Ideal Compressible MHD on 2-D Cartesian Grids. J Sci Comput 84, 39 (2020). https://doi.org/10.1007/s10915-020-01289-8

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s10915-020-01289-8

Keywords

Navigation