# Divergence-Free \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-Conforming Hierarchical Bases for Magnetohydrodynamics (MHD)

## Abstract

In order to solve the magnetohydrodynamics (MHD) equations with a \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming element, a novel approach is proposed to ensure the exact divergence-free condition on the magnetic field. The idea is to add on each element an extra interior bubble function from a higher order hierarchical \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming basis. Four such hierarchical bases for the \(\boldsymbol{\mathcal{H}} (\mathbf{div})\)-conforming quadrilateral, triangular, hexahedral, and tetrahedral elements are either proposed (in the case of tetrahedral) or reviewed. Numerical results have been presented to show the linear independence of the basis functions for the two simplicial elements. Good matrix conditioning has been confirmed numerically up to the fourth order for the triangular element and up to the third order for the tetrahedral element.

### Keywords

Hierarchical bases \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming elements Divergence-free condition### Mathematics Subject Classification (2010)

65N30 65F35 65F15## 1 Introduction

The magnetohydrodynamics (MHD) equations describe the dynamics of a charged system under the interaction with a magnetic field and the conservation of the mass, momentum, and energy for the plasma system. Such a dynamics is considered constrained as the magnetic field of the system is evolved with the constraint of zero divergence, namely, ∇⋅**B**=0. Numerical modeling of plasmas has shown that the observance of the zero divergence of the magnetic field plays an important role in reproducing the correct physics in the plasma fluid [1]. Various numerical techniques have been devised to ensure the computed magnetic field to maintain divergence-free [2]. In the original work of [1] a projection approach was used to correct the magnetic field to have a zero divergence.

A more natural way to satisfy this constraint is through a class of the so-called constrained transport (CT) numerical methods based on the ideas in [3]. As noted in [4], a piecewise \(\boldsymbol{\mathcal{H}}(\mathbf{div})\) vector field on a finite element triangulation of a spatial domain can be a global \(\boldsymbol{\mathcal{H}}(\mathbf{div})\) field if and only if the normal components on the interface of adjacent elements are continuous. Thus, in most of the CT algorithms for the MHD, the surface averaged magnetic flux over the surface of a 3-D element is used to represent the magnetic field while the volume averaged conserved quantities (mass, momentum, and energy) are used.

In the two seminal papers [5, 6], Nédélec proposed to use quantities (moments of normal and tangential components of vector fields) on edges and faces to define the finite dimensional space in \(\boldsymbol{\mathcal{H} }(\mathbf{div})\) and \(\boldsymbol{\mathcal{H}}(\mathbf{curl})\), respectively. The specific construction of the basis functions in both spaces, specifically in \(\boldsymbol{\mathcal{H}}(\mathbf{div})\), can be done in various ways such as the hierarchical type of basis proposed in [7] for both \(\boldsymbol{\mathcal{H}}(\mathbf{div})\) and \(\boldsymbol{\mathcal{H}}(\mathbf{curl})\). Unfortunately, the proposed hierarchical basis for \(\boldsymbol{\mathcal{H}}(\mathbf{div})\) in [7] turns out to be erroneous as can be easily checked; for the quadratic polynomial approximation of the proposed edge-based basis functions happen to be linearly dependent.

In this paper, we will first present a new hierarchical basis functions in \(\boldsymbol{\mathcal{H}}(\mathbf{div})\) in the tetrahedral case, for completeness, together with a review of the hierarchical basis of \(\boldsymbol{\mathcal{H}}(\mathbf{div})\) for rectangles in 2-D and for a cube in 3-D. An important common feature of the hierarchical basis functions is the fact that for order *p*≥4 in the case of simplexes, the basis functions will include interior bubble basis functions which have zero normal components on the whole boundary of the element. Therefore, a simple way to enforce the property of being divergence-free can be easily accomplished by adding one single (*p*+1)th order (any *q*th order, *q*≥max(*m*,*p*+1),*m*=4 for tetrahedral element, *m*=3 for triangular element, and *m*=2 for quadrilateral or hexahedral element) interior bubble function on each element to a *p*th order \(\boldsymbol{\mathcal{H}}(\mathbf{div})\) basis. This extra bubble basis will be able to satisfy the local divergence-free condition. Due to the fact of normal continuity of the *p*th order basis across the element interface and zero normal component of the added-in *q*th order interior bubble functions, the augmented function space satisfies the divergence-free condition globally. The \(\boldsymbol{\mathcal{H}}(\mathbf{div})\) basis on general meshes other than the reference elements mentioned above are usually constructed by a Piola transform [8] and more recent studies of the \(\boldsymbol{\mathcal{H}}(\mathbf{div})\) basis functions on general quadrilateral and hexahedral elements can be found in [8, 9, 10], however, they will not be discussed further in this paper.

The rest of the paper is organized as follows. The constructions of the \(\boldsymbol{\mathcal{H}}(\mathbf{div})\) bases are given in Sects. 2–5 for rectangular and triangular elements in 2-D, and cubic and tetrahedral elements in 3-D. The divergence-free condition is discussed in Sect. 6. Numerical results on the matrix conditioning are given in Sect. 7. Concluding remarks are given in Sect. 8.

## 2 Basis Functions for the Quadrilateral Element

In [11], Zaglmayr gave a hierarchical basis for quadrilateral \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming element. In this section we summarize the result in [11].

*V*

_{1}(0,0),

*V*

_{2}(1,0),

*V*

_{3}(1,1) and

*V*

_{4}(0,1). The coordinate system for the reference element is in terms of the variables (

*ξ*,

*η*). A bilinear function

*λ*

_{i}, which is associated with a specific vertex

*V*

_{i}, has been utilized for the construction. The multiplicative factors of the bilinear function

*λ*

_{i}have been used to form the linear function

*σ*

_{i}, viz.

*δ*

_{ij}is the Kronecker delta. The edge

*e*:=[

*V*

_{i},

*V*

_{j}], which points from vertex

*V*

_{i}to vertex

*V*

_{j}, is parameterized by

*e*:=[

*V*

_{i},

*V*

_{j}] and 0 on the opposite edge. Note that the unit tangential vector

*τ*

_{e}and the outward unit normal vector

**n**

_{e}can be deduced as

### 2.1 Edge-Based Functions

These functions are further grouped into two categories: the lowest-order and higher-order functions.

### Lowest-Order Functions

### Higher-Order Functions

*L*

_{n}(•) is the so-called integrated Legendre polynomial of degree

*n*(as given in (29) with

*t*=1) [11]. The obvious property is

### 2.2 Interior Functions

The interior functions are classified into three categories.

### Type 1 (Curl Field)

### Type 2

### Type 3

*Q*

_{p+1,p}×

*Q*

_{p,p+1}for the \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming quadrilateral element.

Decomposition of the space *Q*_{p+1,p}×*Q*_{p,p+1} for the \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming quadrilateral element

Decomposition | Dimension |
---|---|

Edge-based functions | 4( |

Interior functions | 2 |

Total | 2( |

## 3 Basis Functions for the Hexahedral Element

*V*

_{1}(0,0,0),

*V*

_{2}(1,0,0),

*V*

_{3}(1,1,0),

*V*

_{4}(0,1,0),

*V*

_{5}(0,0,1),

*V*

_{6}(1,0,1),

*V*

_{7}(1,1,1), and

*V*

_{8}(0,1,1). The basis functions are expressed in terms of the trilinear function

*λ*

_{j}, which is 1 at the vertex

*V*

_{j}and 0 at all other vertexes. Along with the linear function

*σ*

_{j}and in terms of the coordinates variables (

*ξ*,

*η*,

*ζ*) they are given as

*e*:=[

*V*

_{i},

*V*

_{j}], which points from vertex

*V*

_{i}to vertex

*V*

_{j}, is parameterized by

*e*is given by \(\vec{\tau}_{e} = \frac{1}{2}\nabla\mu_{e}\). The edge extension parameter

*λ*

_{e}:=

*λ*

_{i}+

*λ*

_{j}∈[0,1] is 1 on the edge

*e*and 0 on all other edges that are parallel to the edge

*e*. The face

*f*=[

*V*

_{i},

*V*

_{j},

*V*

_{k},

*V*

_{ℓ}] where the vertexes

*V*

_{i}and

*V*

_{k}are not connected by an edge can be parameterized by

*λ*

_{f}=

*λ*

_{i}+

*λ*

_{j}+

*λ*

_{k}+

*λ*

_{ℓ}is equal to 1 on the face

*f*and 0 on the opposite face. The outward unit normal vector of face

*f*can be obtained by

**n**

_{f}=∇

*λ*

_{f}.

### 3.1 Face-Based Functions

In this subsection we record the results in [11]. We have also fixed one error in [11]. These functions are associated with the six faces whose formulas are classified into two groups.

### Lowest-Order Raviart–Thomas Functions

### Higher-Order Functions (Divergence-Free)

### 3.2 Interior Functions

The interior functions are further classified into three categories. The triplet (*ξ*_{1},*η*_{2},*ζ*_{3}):=(2*ξ*−1,2*η*−1,2*ζ*−1) is used in the formulas. The function *ℓ*_{n}(•) is the classical un-normalized Legendre polynomial of degree *n*. While we here record the results in [11], we have implemented the correction of a number of mistakes in [11] as well.

### Type 1 (Divergence-Free)

### Type 2

### Type 3

All the interior basis functions are linearly independent, which can be verified easily.

The normal traces of these interior functions vanish on the boundary \(\partial\mathcal{H}\) of the reference hexahedral element. This is due to the fact that on a certain face

*f*either one of the standard unit vectors is perpendicular to the normal vector of the face**n**_{f}or to the fact that the integrated Legendre polynomials are evaluated at 1 or −1, which leads to 0.

*Q*

_{p+1,p,p}×

*Q*

_{p,p+1,p}×

*Q*

_{p,p,p+1}for the \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming hexahedral element.

Decomposition of the space \((\mathbb{Q}_{n}(K))^{3}\) for the \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming hexahedral element

Decomposition | Dimension |
---|---|

Face-based face functions (lowest order RT) | 6 |

Face-based face functions (higher order) | 6 |

Interior functions | 3 |

Total | 3( |

## 4 Basis Functions for the Triangular Element

The result on the basis construction has been reported in [12]. For the completeness of the current study, we record the basis functions in this section.

*K*

^{2}is uniquely located in terms of the local coordinate system (

*ξ*,

*η*). The vertexes are numbered as

**v**

_{0}(0,0),

**v**

_{1}(1,0),

**v**

_{2}(0,1). The barycentric coordinates are given as

**e**

_{j}=[

*j*

_{1},

*j*

_{2}] is similarly defined as in (40) for the 3-dimensional case. In the same manner the edge is also parameterized as in (41). A generic edge can be uniquely identified with

*ℓ*

_{n}(

*x*) is the

*n*th order Legender polynomial.

### 4.1 Edge Functions

### 4.2 Interior Functions

*K*

^{2}, viz.

**e**

_{j}.

### Edge-Based Interior Functions

**e**

_{k}:=[

*k*

_{1},

*k*

_{2}] but vanishes on the other two edges, viz.

**e**

_{j}:=[

*j*

_{1},

*j*

_{2}]. The following basis functions are proposed here:

*i*with a single variable [13], and the scaling coefficient is given by

### Interior Bubble Functions

*∂K*

^{2}of the reference 2-simplex

*K*

^{2}. The formulas of these functions are given as where

Decomposition of the space \(( \mathbb{P}_{p}(K))^{2}\) for the \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming triangular element

Decomposition | Dimension |
---|---|

Edge functions | 3( |

Edge-based interior functions | 3( |

Interior bubble functions | ( |

Total | ( |

## 5 Basis Functions for the Tetrahedral Element

Our constructions are motivated by the work on the construction of \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming hierarchical bases for tetrahedral elements [7]. We construct shape functions for the \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming tetrahedral element on the canonical reference 3-simplex. The shape functions are grouped into several categories based upon their geometrical entities on the reference 3-simplex [7]. The basis functions in each category are constructed so that they are orthonormal on the reference element.

*K*

^{3}is uniquely located in terms of the local coordinate system (

*ξ*,

*η*,

*ζ*). The vertexes are numbered as

**v**

_{0}(0,0,0),

**v**

_{1}(1,0,0),

**v**

_{2}(0,1,0),

**v**

_{3}(0,0,1). The barycentric coordinates are given as

**e**

_{j}=[

*j*

_{1},

*j*

_{2}] is defined as

The standard bases in \(\mathbb{R}^{n}\) are noted as \(\vec{e}_{i}\), *i*=1,…,*n*, and *n*={2,3}.

### 5.1 Face Functions

The face functions are further grouped into two categories: edge-based face functions and face bubble functions.

### Edge-Based Face Functions

**v**

_{0}(0,0,0),

**f**

_{0}:=[1,2,3], the face functions related to edge

**e**[1,2] are given by

*p*=2 (as the sum of the 12 basis functions given in (45) for

*p*=2 on all six faces in fact equals 0, which can be easily verified by the symbolic Maple program—the Maple code is available from the first author) and thus the proposed basis function is not complete. To remedy this degeneracy, two kinds of construction of hierarchical high-order independent edge-based face functions will be presented here, for which the first one was first reported in [12] while the second kind is proposed here below in (51).

First kind high-order independent edge-based face functions

*δ*

_{mn}is the Kronecker delta. Note that, with this construction, the edge-based face functions are all linearly independent, which is also verified by the fact that in the spectrum of the mass (Gram) matrix, none of the eigenvalues is 0.

Second kind high-order independent edge-based face functions

An alternative approach using the idea of recursion from [7] can also be used to construct independent edge-based face functions as follows.

*p*=1, for each edge we have one face function for this edge as proposed in [7],

*p*=2, one additional new basis function can be constructed as

*p*≥3, the basis functions are given by It can be shown again numerically that there are exactly

*p*functions that are independent and whose normal component is non-zero only on the associated edge

**e**

_{k}.

### Face Bubble Functions

*K*

^{3}, and the normal components of which vanish on other three faces, viz.

*K*

^{3}:

### 5.2 Interior Functions

*K*

^{3}, viz.

### Edge-Based Interior Functions

**e**

_{k}:=[

*k*

_{1},

*k*

_{2}] but vanishes on all other five edges, viz.

**e**

_{j}:=[

*j*

_{1},

*j*

_{2}]. The shape functions are given as

### Face-Based Interior Functions

*K*

^{3}, viz.

*ι*is given in (54) and 0≤{

*m*,

*n*},

*m*+

*n*≤

*p*−3. The face-based interior functions enjoy the orthonormal property on the reference 3-simplex

*K*

^{3}:

### Interior Bubble Functions

*∂K*

^{3}of the reference 3-simplex

*K*

^{3}. The formulas of these functions are given as where

Decomposition of the space \(( \mathbb{P}_{p}(K))^{3}\) for the \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming tetrahedral element

Decomposition | Dimension |
---|---|

Edge-based face functions | 12 |

Face bubble functions | 2( |

Edge-based interior functions | 6( |

Face-based interior functions | 4( |

Interior bubble functions | ( |

Total | ( |

## 6 The Divergence-Free Condition

*p*th order polynomial approximation, in order to ensure the divergence-free condition, the idea is to include a higher-order interior bubble function

*χ*

_{b}, say \(\chi_{b}^{p+1}\) or \(\chi_{b}^{q} ,q=\max(m,p+1)\) for the simplexes (

*m*=3 for triangular element and

*m*=4 for tetrahedral element) and

*q*=max(2,

*p*+1) for rectangular and hexahedral elements, as an extra basis function. To satisfy the condition

*C*

_{χ}. For the triangular element, the interior bubble function for degree

*p*is given in (37). For the tetrahedral element, the interior bubble function of degree

*p*is given in (66). For the quadrilateral element, one can construct the interior bubble function of degree

*p*as

*p*as

## 7 Conditioning of Matrices

The purpose of this section is twofold. Firstly, we check numerically that the newly constructed basis functions for \(\boldsymbol{\mathcal{H}}(\mathbf{div} )\)-conforming triangular and tetrahedral elements are linearly independent, which is manifested by the fact that, for each particular approximation order up to degree four, the condition number of the corresponding mass matrix is finite. Secondly, we want to show that for the approximation up to order three both the mass and the stiffness matrices are reasonably well-conditioned.

*M*is symmetric and positive definite, and therefore has real positive eigenvalues. The condition number of a real symmetric positive definite matrix

*A*is calculated by the formula

*λ*

_{max}and

*λ*

_{min}are the maximum and minimum eigenvalues of the matrix

*A*, respectively. For the incompressible fluid flows, e.g., governed by the Navier–Stokes equations [14] or by the magnetohydrodynamics equations [15], the authors [14, 15] have applied the mixed finite element for the spatial discretization. In particular, they [14, 15] have used the \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming element for the Laplacian Δ

**u**of the velocity

**u**. In this case, we have the stiffness matrix

*S*, which is defined component-wise as

*S*is symmetric and semi-positive definite, and therefore has real non-negative eigenvalues. The condition number of the stiffness matrix

*S*is calculated by the formula (73) with the 0 eigenvalue excluded.

*p*={1,2,3,4}, the conditioning is summarized in Table 5.

Condition numbers of the mass matrix *M* and stiffness matrix *S* from the basis for the \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming triangular element

Order | Mass | Stiffness |
---|---|---|

1 | 2.016e1 | 1.040e1 |

2 | 8.804e1 | 5.959e1 |

3 | 9.847e2 | 4.197e2 |

4 | 1.286e4 | 8.843e3 |

From the table we can see that the condition number is bounded for each order of approximation. Moreover, up to the fourth order, the mass and stiffness matrices are both well conditioned.

*p*={1,2,3,4}, the condition numbers of the mass matrix are shown in Table 6.

Condition numbers of the mass matrix *M* and stiffness matrix *S* from the bases with two different kinds of edge-based face function for the \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming tetrahedral element

Order | Mass | Stiffness | Ratio | |||
---|---|---|---|---|---|---|

First kind | Second kind | First kind | Second kind | Mass | Stiff. | |

1 | 3.084e1 | 3.084e1 | 1.989e1 | 1.989e1 | 1.000e0 | 1.000e0 |

2 | 6.987e3 | 7.733e4 | 3.395e3 | 5.917e4 | 0.090e0 | 0.057e0 |

3 | 3.412e6 | 2.289e6 | 1.094e6 | 1.191e6 | 1.491e0 | 0.919e0 |

4 | 5.972e9 | 2.717e7 | 2.883e9 | 2.372e7 | 2.198e2 | 1.215e2 |

Again, from this table we see that the condition number is finite for each order of approximation. Further up to the third order, both the mass and the stiffness matrices are well conditioned. For order *p*=2 the conditioning is better with the first kind edge-based face basis, while for *p*=4, the conditioning is better with the second kind edge-based face basis. For the third order *p*=3, the performance with both kinds of edge-based face basis is about the same.

## 8 Concluding Remarks

In this paper we focus our attention on hierarchical \(\boldsymbol{\mathcal{H}}(\mathbf{div})\) basis functions for solving the magnetohydrodynamics (MHD) equations numerically so that the divergence-free condition on the magnetic field is rigorously guaranteed. The idea is to use an interior bubble function from the proposed high-order hierarchical basis as the additional freedom to impose the divergence-free Gauge condition for the magnetic field. We have summarized four bases for the \(\boldsymbol{\mathcal{H} }(\mathbf{div})\)-conforming elements, viz. the quadrilateral and triangular elements for 2-D and the hexahedral and tetrahedral elements for 3-D. The linear independence of the basis functions for the two simplicial elements has numerically been checked. Good matrix (mass and stiffness) conditioning has also been shown up to the fourth order for 2-D and up to the third order for 3-D. Further work will include the implementation of the proposed divergence-free basis to solve the magnetohydrodynamics (MHD) equations in 2-D and 3-D.

## Notes

### Acknowledgements

This research is supported in part by a DOE grant DEFG0205ER25678 and a NSF grant DMS-1005441.

### References

- 1.Brackbill, J.U., Barnes, D.C.: The effect of nonzero product of magnetic gradient and
**B**on the numerical solution of the magnetohydrodynamic equations. J. Comput. Phys.**35**, 426–430 (1980) CrossRefMATHMathSciNetGoogle Scholar - 2.Tóth, G.: The ∇⋅
**B**=0 constraint in shock-capturing magnetohydrodynamics codes. J. Comput. Phys.**161**, 605–652 (2000) CrossRefMATHMathSciNetGoogle Scholar - 3.Evans, C.R., Hawley, J.F.: Simulation of magnetohydrodynamic flows: a constrained transport method. Astrophys. J.
**332**, 659–677 (1988) CrossRefGoogle Scholar - 4.Monk, P.: Finite Element Methods for Maxwell Equations. Oxford University Press, Oxford (2003) CrossRefMATHGoogle Scholar
- 5.Nédélec, J.C.: Mixed finite elements in \(\mathbb{R}^{3}\). Numer. Math.
**35**, 315–341 (1980) CrossRefMATHMathSciNetGoogle Scholar - 6.Nédélec, J.C.: A new family of mixed finite elements in \(\mathbb{R}^{3}\). Numer. Math.
**50**, 57–81 (1986) CrossRefMATHMathSciNetGoogle Scholar - 7.Ainsworth, M., Coyle, J.: Hierarchic finite element bases on unstructured tetrahedral meshes. Int. J. Numer. Methods Eng.
**58**, 2103–2130 (2003) CrossRefMATHMathSciNetGoogle Scholar - 8.Falk, R., Gatto, P., Monk, P.: Hexahedral H (div) and H (curl) finite elements. Modél. Math. Anal. Numér.
**45**(1), 115–143 (2011) CrossRefMATHMathSciNetGoogle Scholar - 9.Kwak, D., Pyo, H.C.: Mixed finite element methods for general quadrilateral grids. Appl. Math. Comput.
**217**(14), 6556–6565 (2011) CrossRefMATHMathSciNetGoogle Scholar - 10.Wheeler, M., Xue, G., Yotov, I.: A multipoint flux mixed finite element method on distorted quadrilaterals and hexahedra. Numer. Math.
**121**(1), 165–204 (2012) CrossRefMATHMathSciNetGoogle Scholar - 11.Zaglmayr, S.: High order finite element methods for electromagnetic field computation. Ph.D. Dissertation, Johannes Kepler Universität, Linz (2006) Google Scholar
- 12.Xin, J., Cai, W., Guo, N.: On the construction of well-conditioned hierarchical bases for \(\boldsymbol{\mathcal{H}}(\mathbf{div})\)-conforming \(\mathbb{R}^{n}\) simplicial elements. Commun. Comput. Phys.
**14**(3), 621–638 (2013) MathSciNetGoogle Scholar - 13.Magnus, W., Oberhettinger, F., Soni, R.P.: Formulas and Theorems for the Special Functions of Mathematical Physics, 3rd enlarged edn. Die Grundlehren der mathematischen Wissenschaften, vol. 52. Springer, New York (1966) MATHGoogle Scholar
- 14.Cockburn, B., Kanschat, G., Schötzau, D.: A note on discontinuous Galerkin divergence-free solutions for the Navier–Stokes equations. J. Sci. Comput.
**31**, 61–73 (2007) CrossRefMATHMathSciNetGoogle Scholar - 15.Greif, C., Li, D., Schötzau, D., Wei, X.: A mixed finite element method with exactly divergence-free velocities for incompressible magnetohydrodynamics. Comput. Methods Appl. Mech. Eng.
**199**, 2840–2855 (2010) CrossRefMATHGoogle Scholar