1 Introduction

Incompressible two-phase flows exist in a wide variety of natural processes and industrial applications, e.g., geophysical flows, water waves, biomechanics and many others. Numerical simulations of such flows are difficult because the interface separating different fluids must be accurately tracked or captured simultaneously with the evolution of the flow field [1, 2]. Many methods have been developed for this purpose in literature. Among them, the level set (LS) method enjoys considerable popularity for its simplicity and flexibility [3,4,5]. In order to avoid potential numerical oscillations around discontinuities, a smeared-out Heaviside function which is bounded on [0, 1] is usually chosen as the LS function [6,7,8]. Under this case, the LS function takes zero in one fluid and one in the other, and it varies smoothly over the interface.

The LS method includes an advection equation that describes the evolution of the interface and a re-initialization equation that retains the profile and thickness of the interface. Numerical methods which are able to solve the advection equation with minimum numerical dissipation and dispersion for a nearly discontinuous solution are ideal candidates for the LS method. In this work, the discontinuous Galerkin (DG) method [9,10,11] is employed for the spatial discretization of the LS equation. However, it is well known that using high-order approximations in the DG discretization is prone to monotonicity violations. While small oscillations might be acceptable in some cases, in many others they can lead to unphysical values, e.g., values of the LS function outside of [0, 1] may produce negative density in the context of incompressible two-phase simulations with large density ratio. Therefore, a high-order accurate scheme satisfying a strict maximum principle [12] in the sense that the numerical solution never goes out of the admissible set should be used in the computing.

In the simulations of incompressible two-phase flows, the LS function is advected by the velocity field \(\mathbf {u}\) obtained from the incompressible Navier-Stokes (INS) equations. In the incompressible limit, i.e., \(\nabla \cdot \mathbf {u}=0\), the advection equation for the LS function can be written in conservative form. Various maximum-principle-satisfying (MPS) numerical methods have been developed for solving such conservation laws. One important breakthrough was made by Zhang and Shu [13, 14] who proposed a uniformly high-order accurate MPS DG and weighted essentially non-oscillatory (WENO) schemes for scalar conservation laws. These high-order schemes achieve the strict maximum principle by applying a linear scaling limiter [15] at each stage of an explicit Runge-Kutta (RK) method or at each step of a multistep method. This technique was later generalized to positivity preserving high-order DG method for compressible Euler equations [16]. Another class of high-order parametrized maximum-principle-preserving (MPP) flux limiters was proposed by Xu et al. [17, 18] under a finite volume framework, which limits a high-order numerical flux towards a first-order monotone flux. In [19], Xiong et al. generalized the parametrized high-order MPP flux limiters for finite difference RK-WENO schemes with applications in inviscid incompressible flows. Extensions of the high-order MPS or MPP methods for solving convection-diffusion equations were also considered by many researchers, see for example [20,21,22,23,24].

For solutions containing discontinuities, in general, it is preferable to solve the conservative form of the advection equation rather than the non-conservative one. However, due to numerical errors, the velocity field obtained by solving the INS equations will slightly deviate from the divergence-free field. Under this case, the advection equation in conservation form does not imply the maximum principle [13] and this is the main difficulty in developing a high-order MPS method for solving the incompressible two-phase flows. In order to maintain a divergence-free velocity field, in [13, 14], a high-order DG method was developed for solving two-dimensional incompressible flows in the vorticity stream-function formulation [25].

The main object of this work is to construct a high-order MPS DG method for solving the LS problem in a given non-divergence-free velocity field such that the numerical solution never goes out of the range of the admissible set. First, by carefully constructing the numerical flux, we develop a high-order DG method, termed as non-conservative DG method, to directly solve the advection equation for the LS function in non-conservative form. Then, following the idea in [13, 14], we prove that by applying a linear scaling limiter, this non-conservative DG method together with a strong stability preserving (SSP) time discretization scheme can satisfy the maximum principle under a suitable CFL condition. Generally, it needs to consider the following two steps:

  1. 1.

    To maintain the solution average in [0, 1] during the temporal evolution;

  2. 2.

    To maintain the whole polynomial solution in [0, 1] without losing accuracy.

The main challenge lies in retaining the cell averages in the next time step bounded in [0, 1]. As for the second step, the linear scaling limiter introduced in [15] can be applied to control the maximum/minimum of the original polynomial solutions. Numerical simulations of several well-known benchmark problems, including the application to incompressible two-phase flows, are presented to demonstrate the high-order accuracy and MPS property of the proposed non-conservative DG method.

This paper is organized as follows. Section 2 gives a brief introduction of the LS method. In Sect. 3, we develop a high-order DG method for solving the advection equation in non-conservative form and prove that the proposed method satisfies the maximum principle with arbitrary order accuracy. The high-order MPS DG method for solving the re-initialization equation is given in Sect. 4. Numerical tests for the proposed method, including examples from the incompressible two-phase flows, are shown in Sect. 5. Concluding remarks are given in Sect. 6.

2 Level Set Method

The LS method has been first developed by Osher and Sethian for computing the motion of two-phase flow [3]. In the standard LS method, the interface \(\phi (\mathbf {x},t)\) is defined to be a signed distance function, i.e.,

$$\begin{aligned} |\phi (\mathbf {x},t)|=d(\mathbf {x},t)=\min \limits _{\mathbf {x}_I\in \varGamma (t)}|\mathbf {x}-\mathbf {x}_I|, \end{aligned}$$
(1)

where t is time, \(\varGamma (t)\) is the interface and \(\mathbf {x}_I\) is the location on the interface that is closest to the point \(\mathbf {x}\). In practice, however, in order to avoid discontinuities at interface, the signed distance function \(\phi (\mathbf {x},t)\) is usually replaced with a smeared-out Heaviside function \(\varphi (\mathbf {x},t)\) defined as follows

$$\begin{aligned} \varphi (\mathbf {x},t)=\frac{1}{2}\big (\tanh (\frac{\phi (\mathbf {x},t)}{2\varepsilon })+1\big ), \end{aligned}$$
(2)

where \(\varepsilon \) is a parameter that represents the thickness of the profile. Then, \(\varphi (\mathbf {x},t)\) takes the value 0 on one side of the interface and the value 1 on the other. The interface \(\varGamma (t)\) is defined by the location of the \(\varphi (\mathbf {x},t)=0.5\) iso-surface, i.e.,

$$\begin{aligned} \varGamma (t)=\{\mathbf {x}|\varphi (\mathbf {x},t)=0.5\}. \end{aligned}$$
(3)

Consider a moving interface \(\varGamma (t)\) in two dimensional that bounds a region \(\Omega \in {\mathbb {R}}^2\), see Fig. 1. Motion of the interface is achieved by solving the following advection equation

$$\begin{aligned} \begin{aligned}&\frac{\partial \varphi }{\partial t}+\mathbf {u}\cdot \nabla \varphi =0, \quad \forall (\mathbf {x}, t)\in \Omega \times [0,T],\\&\varphi (\mathbf {x},0)=\varphi _0(\mathbf {x}), \quad \quad \forall \mathbf {x}\in \Omega , \end{aligned} \end{aligned}$$
(4)

where \(0<T<{\mathbb {R}}\) is the final time, \(\varphi : \Omega \times [0,T]\rightarrow {\mathbb {R}}\) is the LS function, \(\mathbf {u}=(u,v): \Omega \times [0,T]\rightarrow {\mathbb {R}}^2\) is the velocity field and \(\varphi _0: \Omega \rightarrow {\mathbb {R}}\) is the initial condition. Due to the existence of inevitable numerical errors or artificial diffusions together with velocity variations, the shape of \(\varphi (\mathbf {x},t)\) across the interface will be distorted when \(\varphi (\mathbf {x},t)\) is advected. As a result, a re-initialization step is necessary to retain the profile and thickness of the interface. This is performed by solving the following advection-diffusion equation [6]

$$\begin{aligned} \frac{\partial \varphi }{\partial \tau }+\nabla \cdot (\varphi (1-\varphi )\widehat{\mathbf {n}}|_{\tau =0})=\nabla \cdot (\varepsilon \nabla \varphi ). \end{aligned}$$
(5)

Here, \(\tau \) is the pseudo-time and \(\widehat{\mathbf {n}}=(\widehat{n}_x,\widehat{n}_y)={\nabla \varphi }/{|\!|\nabla \varphi |\!|}\) is the interface normal vector. The term \(\varphi (1-\varphi )\widehat{\mathbf {n}}|_{\tau =0}\) is the compressive flux that aims at sharpening the profile, while \(\varepsilon \nabla \varphi \) is the diffusion flux that maintains characteristic thickness \(\varepsilon \) and avoids discontinuities at the interface.

Fig. 1
figure 1

Explanation of the level set method

3 Maximum-Principle-Satisfying DG Method for the Advection Equation

3.1 Preliminaries

Before introducing the MPS DG method for the advection equation, we first introduce some notations that will help us to obtain the primal formulation. Let \({\Omega }_h\) be an approximation of the solution domain \(\Omega \) and for simplicity we partition \({\Omega }_h\) by uniform rectangular cells such that \({\Omega }_h=\cup _{i=1}^{N_x}\cup _{j=1}^{N_y}I_{i,j}\) with \(I_{i,j}=[x_{i-\frac{1}{2}},x_{i+\frac{1}{2}}]\times [y_{j-\frac{1}{2}},y_{j+\frac{1}{2}}]\), \(\varDelta x=(x_{i+\frac{1}{2}}-x_{i-\frac{1}{2}})\), \(\varDelta y=(y_{j+\frac{1}{2}}-y_{j-\frac{1}{2}})\) and \(|I_{i,j}|=\varDelta x\varDelta y\). We define \(\partial I_{i,j}\) as the cell interfaces of \(I_{i,j}\) and we permanently associate it with a unit normal vector \(\mathbf {n}_e\) outward from the cell \(I_{i,j}\).

We seek numerical solutions in the discontinuous piecewise polynomial space given as

$$\begin{aligned} V_h^k\overset{def}{=}\{\psi \in L^2({\Omega }): \psi |_{I_{i,j}}\in P^k(I_{i,j}), \forall I_{i,j}\in {\Omega }_h\}, \end{aligned}$$
(6)

where \(P^k\) is the set of two-variable polynomials of degree equal or less than k. At each cell \(I_{i,j}\), we have an approximate polynomial solution \(\varphi _h(x,y)\in P^k\) with the cell average \({\overline{\varphi }}_{i,j}\) defined as

$$\begin{aligned} {\overline{\varphi }}_{i,j}=\frac{1}{|I_{i,j}|}\int _{I_{i,j}}\varphi _h(x,y)d\mathbf {x}. \end{aligned}$$
(7)

Note that the functions in \(V_h^k\) can be double-valued on the cell interfaces \(\partial I_{i,j}\). Hence, we denote \(\varphi _h^-\) and \(\varphi _h^+\) as the left and right limits of \(\varphi _h\), respectively, and denote the traces of \(\varphi _h\) on the four edges of \(I_{i,j}\) as \(\varphi _{i-\frac{1}{2},j}^+(y)\), \(\varphi _{i+\frac{1}{2},j}^-(y)\), \(\varphi _{i,j-\frac{1}{2}}^+(x)\) and \(\varphi _{i,j+\frac{1}{2}}^-(x)\), respectively, as illustrated in Fig. 2(a). Then, all of the traces are single-variable polynomials of degree k.

The integrals in the DG formulation are approximated by quadratures with sufficient accuracy. In this work, we need to use two quadrature rules, namely the L-point Gauss-Legendre quadrature rule and the N-point Gauss-Lobatto quadrature rule. Specifically, the Gauss-Legendre quadrature points on \([x_{i-\frac{1}{2}},x_{i+\frac{1}{2}}]\) and \([y_{j-\frac{1}{2}},y_{j+\frac{1}{2}}]\) are denoted as

$$\begin{aligned} S_i^x=\{x_i^\alpha : \alpha =1,\cdots ,L\}, \quad S_j^y=\{y_j^\alpha : \alpha =1,\cdots ,L\}, \end{aligned}$$
(8)

respectively, with quadrature weights \(w_\alpha \) on interval \([-\frac{1}{2},\frac{1}{2}]\) satisfying \(\sum \limits _{\alpha =1}^Lw_\alpha =1\). While the Gauss-Lobatto quadrature points are denoted as

$$\begin{aligned} \widehat{S}_i^x=\{\widehat{x}_i^\beta : \beta =1,\cdots ,N\}, \quad \widehat{S}_j^y=\{\widehat{y}_j^\beta : \beta =1,\cdots ,N\}, \end{aligned}$$
(9)

with quadrature weights \(\widehat{w}_\beta \) on interval \([-\frac{1}{2},\frac{1}{2}]\) satisfying \(\sum \limits _{\beta =1}^N\widehat{w}_\beta =1\). For example, for \(k=2\), we use a three-point Gauss quadrature, i.e., \(S^x=S^y=\{-\frac{\sqrt{15}}{10},0,\frac{\sqrt{15}}{10}\}\) with \(w=\{\frac{5}{18},\frac{8}{18},\frac{5}{18}\}\) and \(\widehat{S}^x=\widehat{S}^y=\{-\frac{1}{2},0,\frac{1}{2}\}\) with \(\widehat{w}=\{\frac{1}{6},\frac{4}{6},\frac{1}{6}\}\). Then, by introducing the tensor product \(\otimes \) and defining the following points set \(S_{i,j}\) [13]

$$\begin{aligned} S_{i,j}=(S_i^x\otimes \widehat{S}_j^y)\bigcup (\widehat{S}_{i}^x\otimes S_j^y), \end{aligned}$$
(10)

see Fig. 2(b) for an illustration, the cell average \({\overline{\varphi }}_{i,j}\) can be approximated by

$$\begin{aligned} {\overline{\varphi }}_{i,j}=\sum \limits _{\alpha =1}^L\sum \limits _{\beta =1}^Nw_\alpha \widehat{w}_\beta \varphi _h(x_i^\alpha ,\widehat{y}_j^\beta ). \end{aligned}$$
(11)

Similarly, we also have

$$\begin{aligned} {\overline{\varphi }}_{i,j}=\sum \limits _{\alpha =1}^L\sum \limits _{\beta =1}^Nw_\alpha \widehat{w}_\beta \varphi _h(\widehat{x}_i^\beta ,y_j^\alpha ). \end{aligned}$$
(12)

In the following, unless otherwise specified, subscripts \(\alpha \) and \(\beta , \gamma \) will be used for Gauss-Legendre and Gauss-Lobatto quadrature points, respectively.

Fig. 2
figure 2

The traces of solution and integral points in cell \(I_{i,j}\)

3.2 Advection Equation with a Divergence-Free Velocity Field

In the context of a divergence-free velocity field, i.e., \(\nabla \cdot \mathbf {u}=0\), the advection equation for the LS function Eq. (4) can be written in conservative form

$$\begin{aligned} \frac{\partial \varphi }{\partial t}+\nabla \cdot (\mathbf {u}\varphi )=0. \end{aligned}$$
(13)

Under this case, the exact solution of Eq. (13) is equivalent to that of Eq. (4) which satisfies a strict maximum principle, i.e., if

$$\begin{aligned} m=\min _{\mathbf {x}}\varphi _0(\mathbf {x}), \quad M=\max _{\mathbf {x}}\varphi _0(\mathbf {x}), \end{aligned}$$
(14)

then \(\varphi (\mathbf {x},t)\in [m,M]\) for any \(\mathbf {x}\) and t. Here, \(m=0\) and \(M=1\) for the LS function Eq. (2). This property is also desired for numerical schemes solving Eq. (4) and Eq. (13), since the violation of this property can lead to instability and breakdown during the simulation [26].

Multiplying Eq. (13) by any test function \(\psi \in V_h^k\), integrating over any cell \(I_{i,j}\in {\Omega }_h\) and integrating by parts, we obtain the standard DG(\(P^k\)) method, i.e., we seek \(\varphi _h\in V_h^k\) such that

$$\begin{aligned} \int _{I_{i,j}}(\partial _t\varphi _h)\psi d\mathbf {x}-\int _{I_{i,j}}\mathbf {F}_c(\varphi _h)\cdot \nabla \psi d\mathbf {x}+\int _{\partial I_{i,j}}\mathbf {n}_e\cdot \widehat{\mathbf {F}}_c(\varphi _h^-,\varphi _h^+)\psi ds=0 \end{aligned}$$
(15)

holds for any \(\psi \in V_h^k\). Here, \(\mathbf {F}_c(\varphi )\overset{def}{=}[f_c(\varphi ), g_c(\varphi )]=\mathbf {u}\varphi \) and \(\widehat{\mathbf {F}}_c(\cdot ,\cdot )\) is any Lipschitz continuous monotone flux as defined in [27], e.g., the global Lax-Friedrichs flux defined by

$$\begin{aligned} \mathbf {n}_e\cdot \widehat{\mathbf {F}}_c(\varphi _h^-,\varphi _h^+)=\frac{1}{2}\big [\mathbf {n}_e\cdot \big (\mathbf {F}_c(\varphi _h^-)+\mathbf {F}_c(\varphi _h^+)\big )-a (\varphi _h^+-\varphi _h^-)\big ], \end{aligned}$$
(16)

where \(a=\max \limits _{\mathbf {x}}|\mathbf {n}_e\cdot \mathbf {F}_c'(\varphi _h)|=\max \limits _{\mathbf {x}}|\mathbf {n}_e\cdot \mathbf {u}_h|\) and \(\mathbf {u}_h\) is the given exact or approximate solution of the velocity field \(\mathbf {u}\).

It is not natural for the DG method Eq. (15) to achieve a strict maximum principle in the sense that the numerical solution \(\varphi _h\) never goes out of the range [mM]. To overcome this problem, Zhang and Shu [13, 14] developed a uniformly high-order accurate DG method for the conservation laws satisfying a strict maximum principle which needs to consider the following two steps:

First, maintenance of the polynomial solution averages staying inside [mM]. According to Eq. (15), the scheme satisfied by cell averages with the Euler forward time discretization can be written as

$$\begin{aligned} \begin{aligned} {\overline{\varphi }}_{i,j}^{n+1}={\overline{\varphi }}_{i,j}^{n}&-\frac{\lambda _x}{\varDelta y}\int _{y_{j-\frac{1}{2}}}^{y_{j+\frac{1}{2}}}\widehat{f}_c\big (\varphi _{i+\frac{1}{2},j}^-(y), \varphi _{i+\frac{1}{2},j}^+(y)\big )-\widehat{f}_c\big (\varphi _{i-\frac{1}{2},j}^-(y), \varphi _{i-\frac{1}{2},j}^+(y)\big )dy\\&-\frac{\lambda _y}{\varDelta x}\int _{x_{i-\frac{1}{2}}}^{x_{i+\frac{1}{2}}}\widehat{g}_c\big (\varphi _{i,j+\frac{1}{2}}^-(x), \varphi _{i,j+\frac{1}{2}}^+(x)\big )-\widehat{g}_c\big (\varphi _{i,j-\frac{1}{2}}^-(x), \varphi _{i,j-\frac{1}{2}}^+(x)\big )dx, \end{aligned} \end{aligned}$$
(17)

where the superscript n is the time level, \(\lambda _x=\varDelta t/{\varDelta x}\), \(\lambda _y=\varDelta t/{\varDelta y}\) and \(\widehat{f}_c(\cdot ,\cdot )\), \(\widehat{g}_c(\cdot ,\cdot )\) are the one-dimensional numerical fluxes. Then, we have [13, 14].

Lemma 1

Consider the scheme satisfied by the cell averages of the DG(\(P^k\)) method Eq. (17) for the advection equation in conservative form with a locally divergence-free velocity field. If the approximate polynomials satisfy \(\varphi _h^n(x,y)\in [m,M]\) for any \((x,y)\in S_{i,j}\), then \({\overline{\varphi }}_{i,j}^{n+1}\in [m,M]\) under the CFL condition

$$\begin{aligned} a_x\lambda _x+a_y\lambda _y\le \min \{\widehat{w}_1, \frac{1}{2k+1}\}. \end{aligned}$$
(18)

Here, \(a_x=\max |f'_c(\varphi )|=|\!|u|\!|_\infty \), \(a_y=\max |g'_c(\varphi )|=|\!|v|\!|_\infty \) and \({1}/{(2k+1)}\) is the requirement of linear stability for the DG(\(P^k\)) method [10].

Remark 1

Notice that the establishment of Lemma 1 relies on the fact that the incompressibility \(\nabla \cdot \mathbf {u}_h=0\) holds everywhere inside the cell \(I_{i,j}\), otherwise the conservative form Eq. (13) itself does not imply the maximum principle.

Second, maintenance of the whole polynomial solution staying inside [mM] without losing accuracy. To enforce this condition which is required by Lemma 1, we can employ a linear scaling limiter [15] to the original polynomial \(\varphi _h^n(x,y)\) such that the modified polynomial \(\widetilde{\varphi }_h^n(x,y)\in [m,M]\) for all \((x,y)\in S_{i,j}\), i.e.,

Lemma 2

For any cell \(I_{i,j}\in {\Omega }_h\) with the cell average \({\overline{\varphi }}_{i,j}^n\in [m,M]\), by applying the following linear scaling limiter to the polynomial solution \(\varphi _h^n(x,y)\)

$$\begin{aligned} \widetilde{\varphi }_h^n(x,y)=\theta \big (\varphi _h^n(x,y)-{\overline{\varphi }}_{i,j}^n\big )+{\overline{\varphi }}_{i,j}^n, \quad \theta =\min \{|\frac{M-{\overline{\varphi }}_{i,j}^n}{M_{i,j}-{\overline{\varphi }}_{i,j}^n}|, |\frac{m-{\overline{\varphi }}_{i,j}^n}{m_{i,j}-{\overline{\varphi }}_{i,j}^n}|, 1\}, \end{aligned}$$
(19)

where

$$\begin{aligned} M_{i,j}=\max _{(x,y)\in S_{i,j}}\varphi _h^n(x,y), \quad m_{i,j}=\min _{(x,y)\in S_{i,j}}\varphi _h^n(x,y), \end{aligned}$$
(20)

then \(\widetilde{\varphi }_h^n(x,y)\in [m,M]\) approximates \(\varphi _h^n(x,y)\) with a \((k+1)\)-th order accuracy.

This completes the construction of the high-order MPS DG method for the advection equation in conservative form Eq. (13). Following a similar approach, we will develop a high-order MPS DG method for the advection equation in non-conservative form Eq. (4).

3.3 Advection Equation with a Non-Divergence-Free Velocity Field

In the simulation of incompressible two-phase flows, the velocity field is obtained by solving the INS equations. Although the exact solution of the INS equations is always divergence free, unfortunately, this is generally not strictly satisfied by the numerical solution due to the existence of numerical errors. In this situation, the advection equation in non-conservative form, i.e.,

$$\begin{aligned} \frac{\partial \varphi }{\partial t}+\mathbf {u}\cdot \nabla \varphi =0 \end{aligned}$$
(21)

is used and discretized in this work.

Similarly, multiplying Eq. (21) by any test function \(\psi \in V_h^k\), integrating over any cell \(I_{i,j}\in {\Omega }_h\) and then performing a formal integration by parts, we have

$$\begin{aligned} \int _{I_{i,j}}(\partial _t\varphi _h)\psi d\mathbf {x}-\int _{I_{i,j}}\varphi _h\nabla \cdot (\mathbf {u}_h\psi )d\mathbf {x}+\int _{\partial I_{i,j}}\mathbf {n}_e\cdot \widehat{(\mathbf {u}\varphi )}\psi ds=0, \end{aligned}$$
(22)

where \(\mathbf {n}_e\cdot \widehat{(\mathbf {u}\varphi )}\) is the numerical flux defined at the cell interfaces \(\partial I_{i,j}\). In order to avoid computing the spatial derivatives with respective to \(\mathbf {u}_h\), we perform an extra element-wise integration by parts locally in \(I_{i,j}\) to arrive at

$$\begin{aligned} \int _{I_{i,j}}(\partial _t\varphi _h)\psi d\mathbf {x}+\int _{I_{i,j}}(\mathbf {u}_h\cdot \nabla \varphi _h)\psi d\mathbf {x}-\int _{\partial I_{i,j}}\mathbf {n}_e\cdot \widetilde{(\mathbf {u}\varphi )}\psi ds+\int _{\partial I_{i,j}}\mathbf {n}_e\cdot \widehat{(\mathbf {u}\varphi )}\psi ds=0.\nonumber \\ \end{aligned}$$
(23)

It should be noted that the second integration by parts is different from the first one since it is performed based on the local discretized DG polynomial solution within the cell \(I_{i,j}\), i.e., no numerical flux is entailed which leads to

$$\begin{aligned} \mathbf {n}_e\cdot \widetilde{(\mathbf {u}\varphi )}= \left\{ \begin{aligned}&\mathbf {n}_e\cdot (\mathbf {u}_h^-\varphi _h^-), \quad \text {in cell } I_L,\\&\mathbf {n}_e\cdot (\mathbf {u}_h^+\varphi _h^+), \quad \text {in cell } I_R. \end{aligned} \right. \nonumber \\ \end{aligned}$$
(24)

Here, \(I_L\) and \(I_R\) are the left and right cells of \(\partial I_{i,j}\), respectively. Therefore, to fulfill the DG discretization Eq. (23), we only need to specify the formulation of the numerical flux \(\mathbf {n}_e\cdot \widehat{(\mathbf {u}\varphi )}\) which is crucial to the successful implementation of the DG method.

By taking \(\varphi =1\) in Eq. (23), it gives that the numerical flux \(\mathbf {n}_e\cdot \widehat{(\mathbf {u}\varphi )}\) should be coincide with \(\mathbf {n}_e\cdot \widetilde{(\mathbf {u}\varphi )}\) [28, 29]. Thus, we define the numerical flux as follows

$$\begin{aligned} \mathbf {n}_{e}\cdot \widehat{(\mathbf {u}\varphi )}\overset{def}{=}\mathbf {n}_{e}\cdot \widehat{\mathbf {F}}(\varphi _h^-,\varphi _h^+)= \left\{ \begin{aligned}&\frac{1}{2}\big [(\mathbf {n}_{e}\cdot \mathbf {u}_h^-)(\varphi _h^-+\varphi _h^+)-a(\varphi _h^+-\varphi _h^-)\big ], \quad \text {in cell } I_L,\\&\frac{1}{2}\big [(\mathbf {n}_{e}\cdot \mathbf {u}_h^+)(\varphi _h^-+\varphi _h^+)-a(\varphi _h^+-\varphi _h^-)\big ], \quad \text {in cell } I_R. \end{aligned} \right. \nonumber \\ \end{aligned}$$
(25)

Similarly, a is the global maximum value of \(|\mathbf {n}_e\cdot \mathbf {u}_h|\). With this choice, the numerical flux Eq. (25) satisfies the following monotonicity property

$$\begin{aligned} \frac{\partial (\mathbf {n}_e\cdot \widehat{\mathbf {F}}(\varphi _h^-,\varphi _h^+))}{\partial \varphi _h^-}\ge 0, \quad \frac{\partial (\mathbf {n}_e\cdot \widehat{\mathbf {F}}(\varphi _h^-,\varphi _h^+))}{\partial \varphi _h^+}\le 0. \end{aligned}$$
(26)

Remark 2

When a continuous interfacial normal velocity is applied, the proposed method Eqs. (2325) is coincided with the one given in [30] which was constructed for the Hamilton-Jacobi equation. Moreover, if the velocity field is also locally divergence-free, the proposed method is same as the standard DG method Eq. (15) associated with the flux Eq. (16).

Plugging Eq. (24) and Eq. (25) into Eq. (23), we can obtain the scheme satisfied by the cell averages of the DG(\(P^k\)) method with the Euler forward scheme

$$\begin{aligned} \begin{aligned} {\overline{\varphi }}_{i,j}^{n+1}&={\overline{\varphi }}_{i,j}^n-\frac{\varDelta t}{|I_{i,j}|}\int _{I_{i,j}}\mathbf {u}_h\cdot \nabla \varphi _hd\mathbf {x}\\&\quad +\frac{\lambda _x}{\varDelta y}\int _{y_{j-\frac{1}{2}}}^{y_{j+\frac{1}{2}}}[u_{i+\frac{1}{2},j}^-(y)\varphi _{i+\frac{1}{2},j}^-(y)-u_{i-\frac{1}{2},j}^+(y)\varphi _{i-\frac{1}{2},j}^+(y)]\\&\quad -\big [\widehat{f}\big (\varphi _{i+\frac{1}{2},j}^-(y),\varphi _{i+\frac{1}{2},j}^+(y)\big )-\widehat{f}\big (\varphi _{i-\frac{1}{2},j}^-(y),\varphi _{i-\frac{1}{2},j}^+(y)\big )\big ]dy\\&\quad +\frac{\lambda _y}{\varDelta x}\int _{x_{i-\frac{1}{2}}}^{x_{i+\frac{1}{2}}}[v_{i,j+\frac{1}{2}}^-(x)\varphi _{i,j+\frac{1}{2}}^-(x)-v_{i,j-\frac{1}{2}}^+(x)\varphi _{i,j-\frac{1}{2}}^+(x)]\\&\quad -\big [\widehat{g}\big (\varphi _{i,j+\frac{1}{2}}^-(x),\varphi _{i,j+\frac{1}{2}}^+(x)\big )-\widehat{g}\big (\varphi _{i,j-\frac{1}{2}}^-(x),\varphi _{i,j-\frac{1}{2}}^+(x)\big )\big ]dx. \end{aligned} \end{aligned}$$
(27)

Here,

$$\begin{aligned} \widehat{f}(\cdot ,\cdot )=(1,0)\cdot \widehat{\mathbf {F}}(\cdot ,\cdot ), \quad \widehat{g}(\cdot ,\cdot )=(0,1)\cdot \widehat{\mathbf {F}}(\cdot ,\cdot ) \end{aligned}$$
(28)

are the one-dimensional numerical fluxes in the x- and y- directions, respectively.

Then, for a piecewise-linear DG approximation, we have the following theorem

Theorem 1

Consider the scheme satisfied by the cell averages of the DG(\(P^1\)) method Eq. (27) for solving the advection equation in non-conservative form Eq. (21). If the approximate polynomials satisfy \(\varphi _h^n(x,y)\in [m,M]\) for any \((x,y)\in S_{i,j}\), then \({\overline{\varphi }}_{i,j}^{n+1}\in [m,M]\) under the CFL condition

$$\begin{aligned} a_x\lambda _x+a_y\lambda _y\le \min \{\widehat{w}_1, \frac{1}{3}\}. \end{aligned}$$
(29)

Here, \(a_x=\max |f'(\varphi )|=|\!|u|\!|_\infty \) and \(a_y=\max |g'(\varphi )|=|\!|v|\!|_\infty \).

Proof

When using \(P^1\) approximation, i.e., \(k=1\), the solution \(\varphi _h^n(x,y)\) is a polynomial of degree no more than one with respect to its two variables. Thus, the surface integral in Eq. (27) can be expressed as

$$\begin{aligned} \int _{I_{i,j}}\mathbf {u}_h\cdot \nabla \varphi _hd\mathbf {x}=\int _{I_{i,j}}\big [u_h\frac{\varphi _{i+\frac{1}{2},j}^-(y)-\varphi _{i-\frac{1}{2},j}^+(y)}{\varDelta x}+v_h\frac{\varphi _{i,j+\frac{1}{2}}^-(x)-\varphi _{i,j-\frac{1}{2}}^+(x)}{\varDelta y}\big ]d\mathbf {x}.\nonumber \\ \end{aligned}$$
(30)

Substituting Eq. (30) into Eq. (27) and then using an L-point Gauss-Legendre quadrature rule and an N-point (\(N=2\)) Gauss-Lobatto quadrature rule that are exact for polynomials of degree one, we have

$$\begin{aligned} \begin{aligned} {\overline{\varphi }}_{i,j}^{n+1}&=\gamma _x\widehat{w}_1\sum \limits _{\alpha =1}^Lw_\alpha \big [(1+\frac{\lambda _x}{\gamma _x\widehat{w}_1}\overline{u}_{i,\alpha }-\frac{\lambda _x}{\gamma _x\widehat{w}_1}u_{i-\frac{1}{2},\alpha }^+)\varphi _{i-\frac{1}{2},\alpha }^++\frac{\lambda _x}{\gamma _x\widehat{w}_1}\widehat{f}(\varphi _{i-\frac{1}{2},\alpha }^-,\varphi _{i-\frac{1}{2},\alpha }^+)\big ]\\&+\gamma _x\widehat{w}_2\sum \limits _{\alpha =1}^Lw_\alpha \big [(1-\frac{\lambda _x}{\gamma _x\widehat{w}_2}\overline{u}_{i,\alpha }+\frac{\lambda _x}{\gamma _x\widehat{w}_2}u_{i+\frac{1}{2},\alpha }^-)\varphi _{i+\frac{1}{2},\alpha }^--\frac{\lambda _x}{\gamma _x\widehat{w}_2}\widehat{f}(\varphi _{i+\frac{1}{2},\alpha }^-,\varphi _{i+\frac{1}{2},\alpha }^+)\big ]\\&+\gamma _y\widehat{w}_1\sum \limits _{\alpha =1}^Lw_\alpha \big [(1+\frac{\lambda _y}{\gamma _y\widehat{w}_1}\overline{v}_{\alpha ,j}-\frac{\lambda _y}{\gamma _y\widehat{w}_1}v_{\alpha ,j-\frac{1}{2}}^+)\varphi _{\alpha ,j-\frac{1}{2}}^++\frac{\lambda _y}{\gamma _y\widehat{w}_1}\widehat{g}(\varphi _{\alpha ,j-\frac{1}{2}}^-,\varphi _{\alpha ,j-\frac{1}{2}}^+)\big ]\\&+\gamma _y\widehat{w}_2\sum \limits _{\alpha =1}^Lw_\alpha \big [(1-\frac{\lambda _y}{\gamma _y\widehat{w}_2}\overline{v}_{\alpha ,j}+\frac{\lambda _y}{\gamma _y\widehat{w}_2}v_{\alpha ,j+\frac{1}{2}}^-)\varphi _{\alpha ,j+\frac{1}{2}}^--\frac{\lambda _y}{\gamma _y\widehat{w}_2}\widehat{g}(\varphi _{\alpha ,j+\frac{1}{2}}^-,\varphi _{\alpha ,j+\frac{1}{2}}^+)\big ]. \end{aligned}\nonumber \\ \end{aligned}$$
(31)

Here, \(\gamma _x={(a_x\lambda _x)}/{(a_x\lambda _x+a_y\lambda _y)}\), \(\gamma _y={(a_y\lambda _y)}/{(a_x\lambda _x+a_y\lambda _y)}\),

$$\begin{aligned} \overline{u}_{i,\alpha }=\frac{1}{\varDelta x}\int _{x_{i-\frac{1}{2}}}^{x_{i+\frac{1}{2}}}u_h(x,y_j^\alpha )dx, \quad \overline{v}_{\alpha ,j}=\frac{1}{\varDelta y}\int _{y_{j-\frac{1}{2}}}^{y_{j+\frac{1}{2}}}v_h(x_i^\alpha ,y)dy, \quad 1\le \alpha \le L, \end{aligned}$$
(32)

and we use the properties that

$$\begin{aligned} \begin{aligned}&\varphi _h^n(\widehat{x}_i^1,y_j^\alpha )=\varphi _{i-\frac{1}{2},j}^+(y_j^\alpha )\overset{def}{=}\varphi _{i-\frac{1}{2},\alpha }^+, \quad \varphi _h^n(\widehat{x}_i^N,y_j^\alpha )=\varphi _{i+\frac{1}{2},j}^-(y_j^\alpha )\overset{def}{=}\varphi _{i+\frac{1}{2},\alpha }^-, \\&\varphi _h^n(x_i^\alpha ,\widehat{y}_j^1)=\varphi _{i,j-\frac{1}{2}}^+(x_i^\alpha )\overset{def}{=}\varphi _{\alpha ,j-\frac{1}{2}}^+, \quad \varphi _h^n(x_i^\alpha ,\widehat{y}_j^N)=\varphi _{i,j+\frac{1}{2}}^-(x_i^\alpha )\overset{def}{=}\varphi _{\alpha ,j+\frac{1}{2}}^-. \end{aligned} \end{aligned}$$
(33)

Next, based on Eq. (31), we introduce the following formulations

$$\begin{aligned} \begin{aligned}&H_{x,\alpha }^{(1)}(\varphi _{i-\frac{1}{2},\alpha }^-,\varphi _{i-\frac{1}{2},\alpha }^+)=(1+\frac{\lambda _x}{\gamma _x\widehat{w}_1}\overline{u}_{i,\alpha }-\frac{\lambda _x}{\gamma _x\widehat{w}_1}u_{i-\frac{1}{2},\alpha }^+)\varphi _{i-\frac{1}{2},\alpha }^++\frac{\lambda _x}{\gamma _x\widehat{w}_1}\widehat{f}(\varphi _{i-\frac{1}{2},\alpha }^-,\varphi _{i-\frac{1}{2},\alpha }^+),\\&H_{x,\alpha }^{(2)}(\varphi _{i+\frac{1}{2},\alpha }^-,\varphi _{i+\frac{1}{2},\alpha }^+)=(1-\frac{\lambda _x}{\gamma _x\widehat{w}_2}\overline{u}_{i,\alpha }+\frac{\lambda _x}{\gamma _x\widehat{w}_2}u_{i+\frac{1}{2},\alpha }^-)\varphi _{i+\frac{1}{2},\alpha }^--\frac{\lambda _x}{\gamma _x\widehat{w}_2} \widehat{f}(\varphi _{i+\frac{1}{2},\alpha }^-,\varphi _{i+\frac{1}{2},\alpha }^+). \end{aligned}\nonumber \\ \end{aligned}$$
(34)

Substituting the numerical flux Eq. (25) into Eq. (34), it gives

$$\begin{aligned} \begin{aligned}&H_{x,\alpha }^{(1)}(\varphi _{i-\frac{1}{2},\alpha }^-,\varphi _{i-\frac{1}{2},\alpha }^+)=\frac{1}{2}\frac{\lambda _x}{\gamma _x\widehat{w}_1}(u_{i-\frac{1}{2},\alpha }^++a_x)\varphi _{i-\frac{1}{2},\alpha }^-+\big [1+\frac{1}{2}\frac{\lambda _x}{\gamma _x\widehat{w}_1}(2\overline{u}_{i,\alpha }-u_{i-\frac{1}{2},\alpha }^+-a_x)\big ]\varphi _{i-\frac{1}{2},\alpha }^+,\\&H_{x,\alpha }^{(2)}(\varphi _{i+\frac{1}{2},\alpha }^-,\varphi _{i+\frac{1}{2},\alpha }^+)=\big [1-\frac{1}{2}\frac{\lambda _x}{\gamma _x\widehat{w}_2}(2\overline{u}_{i,\alpha }-u_{i+\frac{1}{2},\alpha }^-+a_x)\big ]\varphi _{i+\frac{1}{2},\alpha }^--\frac{1}{2}\frac{\lambda _x}{\gamma _x\widehat{w}_2}(u_{i+\frac{1}{2},\alpha }^--a_x)\varphi _{i+\frac{1}{2},\alpha }^+. \end{aligned}\nonumber \\ \end{aligned}$$
(35)

Since a two-point Gauss-Lobatto quadrature rule is applied, the solution average \(\overline{u}_{i,\alpha }\) can be expressed as

$$\begin{aligned} \overline{u}_{i,\alpha }=\widehat{w}_1u_{i-\frac{1}{2},\alpha }^++\widehat{w}_2u_{i+\frac{1}{2},\alpha }^-=\frac{1}{2}(u_{i-\frac{1}{2},\alpha }^++u_{i+\frac{1}{2},\alpha }^-). \end{aligned}$$
(36)

Then, it is easy to check that under the CFL condition Eq. (29), the formulations Eq. (35) are monotone with respect to their two arguments, i.e.,

$$\begin{aligned} \frac{\partial H_{x,\alpha }^{(1)}(\varphi _{i-\frac{1}{2},\alpha }^-,\varphi _{i-\frac{1}{2},\alpha }^+)}{\partial \varphi _{i-\frac{1}{2},\alpha }^\pm }\ge 0, \quad \frac{\partial H_{x,\alpha }^{(2)}(\varphi _{i+\frac{1}{2},\alpha }^-,\varphi _{i+\frac{1}{2},\alpha }^+)}{\partial \varphi _{i+\frac{1}{2},\alpha }^\pm }\ge 0. \end{aligned}$$
(37)

Moreover, we have

$$\begin{aligned} \begin{aligned}&H_{x,\alpha }^{(1)}(m,m)=(1+\frac{\lambda _x}{\gamma _x\widehat{w}_1}\overline{u}_{i,\alpha })m, \quad H_{x,\alpha }^{(1)}(M,M)=(1+\frac{\lambda _x}{\gamma _x\widehat{w}_1}\overline{u}_{i,\alpha })M, \\&H_{x,\alpha }^{(2)}(m,m)=(1-\frac{\lambda _x}{\gamma _x\widehat{w}_2}\overline{u}_{i,\alpha })m, \quad H_{x,\alpha }^{(2)}(M,M)=(1-\frac{\lambda _x}{\gamma _x\widehat{w}_2}\overline{u}_{i,\alpha })M, \end{aligned} \end{aligned}$$
(38)

which results in

$$\begin{aligned} \widehat{w}_1H_{x,\alpha }^{(1)}(m,m)+\widehat{w}_2H_{x,\alpha }^{(2)}(m,m)=m, \quad \widehat{w}_1H_{x,\alpha }^{(1)}(M,M)+\widehat{w}_2H_{x,\alpha }^{(2)}(M,M)=M. \end{aligned}$$
(39)

Similar results can be obtained for the following formulations

$$\begin{aligned} \begin{aligned}&H_{\alpha ,y}^{(1)}(\varphi _{\alpha ,j-\frac{1}{2}}^-,\varphi _{\alpha ,j-\frac{1}{2}}^+)=(1+\frac{\lambda _y}{\gamma _y\widehat{w}_1}\overline{v}_{\alpha ,j}-\frac{\lambda _y}{\gamma _y\widehat{w}_1}v_{\alpha ,j-\frac{1}{2}}^+)\varphi _{\alpha ,j-\frac{1}{2}}^++\frac{\lambda _y}{\gamma _y\widehat{w}_1}\widehat{g}(\varphi _{\alpha ,j-\frac{1}{2}}^-,\varphi _{\alpha ,j-\frac{1}{2}}^+),\\&H_{\alpha ,y}^{(2)}(\varphi _{\alpha ,j+\frac{1}{2}}^-,\varphi _{\alpha ,j+\frac{1}{2}}^+)=(1-\frac{\lambda _y}{\gamma _y\widehat{w}_2}\overline{v}_{\alpha ,j}+\frac{\lambda _y}{\gamma _y\widehat{w}_2}v_{\alpha ,j+\frac{1}{2}}^-)\varphi _{\alpha ,j+\frac{1}{2}}^--\frac{\lambda _y}{\gamma _y\widehat{w}_2}\widehat{g}(\varphi _{\alpha ,j+\frac{1}{2}}^-,\varphi _{\alpha ,j+\frac{1}{2}}^+). \end{aligned}\nonumber \\ \end{aligned}$$
(40)

Thus, \({\overline{\varphi }}_{i,j}^{n+1}\) is a monotonically increasing function of all the arguments involved, i.e., \(\varphi _{i\pm \frac{1}{2},\alpha }^\mp \) and \(\varphi _{\alpha ,j\pm \frac{1}{2}}^\mp \), which implies the strict maximum principle

$$\begin{aligned} m\le {\overline{\varphi }}_{i,j}^{n+1}\le M, \end{aligned}$$
(41)

provided that \(m\le \varphi _h^n(x,y)\le M\) for any \((x,y)\in S_{i,j}\). \(\square \)

Now, we complete the first step in constructing a MPS DG(\(P^1\)) method for solving the advection equation in non-conservative form, i.e., maintaining the polynomial solution average \({\overline{\varphi }}_{i,j}^{n+1}\) falling in [mM]. Next, in order to enforce the condition in Theorem 1, the same linear scaling limiter as given in Lemma 2 can be employed to modify \(\varphi _h^n(x,y)\) such that the modified polynomial solution \(\widetilde{\varphi }_h^n(x,y)\in [m,M]\) for all \((x,y)\in S_{i,j}\) without losing accuracy.

Following a similar approach, the previous theorem can be extended to a general DG(\(P^k\)) method, which is given as follows

Theorem 2

Consider the scheme satisfied by the cell averages of the DG(\(P^k\)) method Eq. (27) for solving the advection equation in non-conservative form Eq. (21). If the approximate polynomials satisfy \(\varphi _h^n(x,y)\in [m,M]\) for any \((x,y)\in S_{i,j}\), then \({\overline{\varphi }}_{i,j}^{n+1}\in [m,M]\) under the CFL condition

$$\begin{aligned} a_x\lambda _x+a_y\lambda _y\le \min \{\min \limits _\beta \{\frac{\widehat{w}_\beta }{\sum \limits _{\gamma =1}^N\widehat{w}_\gamma |\partial _xh_x^{(\beta )}(\widehat{x}_i^\gamma )\varDelta x|+1},\frac{\widehat{w}_\beta }{\sum \limits _{\gamma =1}^N\widehat{w}_\gamma |\partial _yh_y^{(\beta )}(\widehat{y}_j^\gamma )\varDelta y|+1}\},\frac{1}{2k+1}\}.\nonumber \\ \end{aligned}$$
(42)

Here, \(k\ge 1\), \(a_x=\max |f'(\varphi )|=|\!|u|\!|_\infty \), \(a_y=\max |g'(\varphi )|=|\!|v|\!|_\infty \) and

$$\begin{aligned} h_x^{(\beta )}(x)=\prod \limits _{\begin{array}{c} \gamma =1\\ \gamma \ne \beta \end{array}}^N\frac{(x-\widehat{x}_i^\gamma )}{(\widehat{x}_i^\beta -\widehat{x}_i^\gamma )},\quad h_y^{(\beta )}(y)=\prod \limits _{\begin{array}{c} \gamma =1\\ \gamma \ne \beta \end{array}}^N\frac{(y-\widehat{y}_j^\gamma )}{(\widehat{y}_j^\beta -\widehat{y}_j^\gamma )} \end{aligned}$$
(43)

The detailed proof of Theorem 2 is given in Appendix A for interested readers.

3.4 High-Order Temporal Discretization

The temporal discretizations in Eq. (15) and Eq. (23) are conducted by a strong stability preserving Runge-Kutta (SSP-RK) scheme [31]. For example, the DG(\(P^1\)) spatial discretization is employed together with the following second-order SSP-RK scheme

$$\begin{aligned} \begin{aligned}&\varphi ^{(1)}=\varphi ^n+\varDelta tR(\varphi ^n),\\&\varphi ^{n+1}=\frac{1}{2}\varphi ^n+\frac{1}{2}[\varphi ^{(1)}+\varDelta tR(\varphi ^{(1)})]. \end{aligned} \end{aligned}$$
(44)

Here, \(R(\varphi )\) is the spatial operator in either conservative or non-conservative form. While for the DG(\(P^2\)) spatial discretization, the third-order SSP-RK scheme is used to evolve the solution

$$\begin{aligned} \begin{aligned}&\varphi ^{(1)}=\varphi ^n+\varDelta tR(\varphi ^n),\\&\varphi ^{(2)}=\frac{3}{4}\varphi ^n+\frac{1}{4}\big [\varphi ^{(1)}+\varDelta tR(\varphi ^{(1)})\big ],\\&\varphi ^{n+1}=\frac{1}{3}\varphi ^n+\frac{2}{3}[\varphi ^{(2)}+\varDelta tR(\varphi ^{(2)})]. \end{aligned} \end{aligned}$$
(45)

We remark that since the multi-stage SSP-RK scheme can be regarded as a convex combinations of the Euler forward temporal discretization, the previous analysis keeps validity.

4 Maximum-Principle-Satisfying DG Method for the Re-initialization Equation

In order to maintain the shape of the hyperbolic tangent function and limit mass loss, a re-initialization procedure is carried out after every real time step. The DG discretization of the re-initialization Eq. (5) can be written as

$$\begin{aligned} \int _{I_{i,j}}(\partial _\tau \varphi _h)\psi d\mathbf {x}-\int _{I_{i,j}}(\mathbf {G}_c-\mathbf {G}_d)\cdot \nabla \psi d\mathbf {x}+\int _{\partial I_{i,j}}\mathbf {n}_e\cdot (\widehat{\mathbf {G}}_c-\widehat{\mathbf {G}}_d)\psi ds=0. \end{aligned}$$
(46)

Here, \(\mathbf {G}_c=\varphi (1-\varphi )\widehat{\mathbf {n}}|_{\tau =0}\) and \(\mathbf {G}_d=\varepsilon \nabla \varphi \) are the compressive and diffusion terms, respectively. For the compressive part, we use the Lax-Friedrichs flux

$$\begin{aligned} \mathbf {n}_e\cdot \widehat{\mathbf {G}}_c(\varphi _h^-,\varphi _h^+)=\frac{1}{2}\big [\mathbf {n}_e\cdot \big (\mathbf {G}_c(\varphi _h^-)+\mathbf {G}_c(\varphi _h^+)\big )-a(\varphi _h^+-\varphi _h^-)\big ], \end{aligned}$$
(47)

where a is the global maximum value of \(|(\partial /{\partial \varphi })\big (\mathbf {n}_e\cdot \widehat{\mathbf {G}}_c(\varphi _h)\big )|=|\mathbf {n}_e\cdot (1-2\varphi _h)\widehat{\mathbf {n}}|_{\tau =0}|\), while for the diffusive part, we adopt the direct DG (DDG) flux [32, 33]. Specifically, in the DG(\(P^2\)) formulation, the diffusive flux is defined as

$$\begin{aligned} \mathbf {n}_e\cdot \widehat{\mathbf {G}}_d(\varphi _h^-,\varphi _h^+)=\mathbf {n}_e\cdot (\varepsilon \widehat{\nabla \varphi })=\varepsilon (\beta _0\frac{[\![\varphi ]\!]}{\varDelta }+\{\partial _\mathbf {n}\varphi \}+\beta _1\varDelta [\![\partial _{\mathbf {n}}^2\varphi ]\!]). \end{aligned}$$
(48)

Here, \(\varDelta \) is the characteristic length, \(\partial _{\mathbf {n}}\varphi =\mathbf {n}_e\cdot \nabla \varphi \), \([\![\cdot ]\!]\) and \(\{\cdot \}\) are the jump and average operators, respectively. \((\beta _0,\beta _1)\) are constant coefficients need to be specified such that the DG method Eq. (46) can satisfy the maximum principle.

Eq. (46) is marched in pseudo-time \(\tau \) by the third-order SSP-RK scheme Eq. (45). Theoretically, Eq. (46) should be solved to steady state. However, in practice we typically perform only a few, e.g., 10\(\sim \)20, iterations for improving efficiency. Before giving the sufficient condition for the cell averages of the DG method Eq. (46) to be bounded in [mM], we first introduce Lemma 3 [21].

Lemma 3

Consider the DG method associated with piecewise-quadratic polynomial approximations for solving the two-dimensional diffusion equation

$$\begin{aligned} \frac{\partial \varphi }{\partial t}=\nabla \cdot (\varepsilon \nabla \varphi ), \quad (\mathbf {x},t)\in {\Omega }\times (0,T). \end{aligned}$$
(49)

Given \(\varphi _h^n(x,y)\in [m,M]\) for any \((x,y)\in S_{i,j}\), we have \({\overline{\varphi }}_{i,j}^{n+1}\in [m,M]\) provided that

$$\begin{aligned} \beta _0\ge \frac{3}{2}-4\beta _1, \quad \frac{1}{8}\le \beta _1\le \frac{1}{4} \end{aligned}$$
(50)

combined with a suitable CFL condition

$$\begin{aligned} \frac{\varepsilon \varDelta t}{|I_{i,j}|}\le \min \left\{ \frac{1}{6(\beta _0+8\beta _1-2)},\frac{1}{6(1-4\beta _1)}\right\} \min \left\{ \frac{\lambda _x}{\lambda _x+\lambda _y},\frac{\lambda _y}{\lambda _x+\lambda _y}\right\} . \end{aligned}$$
(51)

Based on Lemma 3, we then have the following result

Theorem 3

Consider the scheme satisfied by the cell averages of the DG(\(P^2\)) method Eq. (46) for the re-initialization equation. If the approximate polynomials satisfy \(\varphi _h^s(x,y)\in [m,M]\) for any \((x,y)\in S_{i,j}\) and the coefficients \((\beta _0,\beta _1)\) satisfy the condition Eq. (50), then \({\overline{\varphi }}_{i,j}^{s+1}\in [m,M]\) under the CFL condition

$$\begin{aligned} \left\{ \begin{aligned}&a_1\lambda _1+a_2\lambda _2\le \frac{1}{16}, \\&\lambda _d\le \min \left\{ \frac{1}{12(\beta _0+8\beta _1-2)},\frac{1}{12(1-4\beta _1)}\right\} \min \left\{ \frac{\lambda _1}{\lambda _1+\lambda _2},\frac{\lambda _2}{\lambda _1+\lambda _2}\right\} . \end{aligned} \right. \end{aligned}$$
(52)

Here, s is the pseudo-time level, \(\lambda _1={\varDelta \tau }/{\varDelta x}\), \(\lambda _2={\varDelta \tau }/{\varDelta y}\), \(a_1=||(1-2\varphi )\widehat{n}_x||_\infty \), \(a_2=||(1-2\varphi )\widehat{n}_y||_\infty \) and \(\lambda _d={\varepsilon \varDelta \tau }/{|I_{i,j}|}\).

Proof

We present the proof in four steps:

  • 1. Split: We split the average \({\overline{\varphi }}_{i,j}^{s+1}\) into two halves such that

    $$\begin{aligned} {\overline{\varphi }}_{i,j}^{s+1}=\frac{1}{2}\mathcal {C}_{i,j}^n+\frac{1}{2}\mathcal {D}_{i,j}^n, \end{aligned}$$
    (53)

    where the convection term is

    $$\begin{aligned} \mathcal {C}_{i,j}={\overline{\varphi }}_{i,j}^s-\frac{2\varDelta \tau }{|I_{i,j}|}\int _{\partial I_{i,j}}\mathbf {n}_e\cdot \widehat{\mathbf {G}}_cds \end{aligned}$$
    (54)

    and the diffusion term is

    $$\begin{aligned} \mathcal {D}_{i,j}={\overline{\varphi }}_{i,j}^s+\frac{2\varDelta \tau }{|I_{i,j}|}\int _{\partial I_{i,j}}\mathbf {n}_e\cdot \widehat{\mathbf {G}}_dds. \end{aligned}$$
    (55)

    It should be noted that the this split is designed for convenient presentation purpose and may not lead to an optimal CFL condition [22].

  • 2. Convection: Following the same arguments as in Theorem 2 and replacing \(\varDelta t\) with \(2\varDelta \tau \), it gives that if \(\varphi _h^s(x,y)\in [m,M]\) for any \((x,y)\in S_{i,j}\), then \(\mathcal {C}_{i,j}\in [m,M]\) under the CFL condition

    $$\begin{aligned} a_1\lambda _1+a_2\lambda _2\le \frac{3}{8}\widehat{w}_1=\frac{1}{16}. \end{aligned}$$
    (56)
  • 3. Diffusion: Applying the results in Lemma 3 and replacing \(\varDelta t\) with \(2\varDelta \tau \), it provides that with \(\varphi _h^s(x,y)\in [m,M]\) for any \((x,y)\in S_{i,j}\) and \((\beta _0,\beta _1)\) satisfy the condition Eq. (50), we have \(\mathcal {D}_{i,j}\in [m,M]\) under the CFL condition

    $$\begin{aligned} \lambda _d\le \min \left( \frac{1}{12(\beta _0+8\beta _1-2)},\frac{1}{12(1-4\beta _1)}\right) \min \left( \frac{\lambda _1}{\lambda _1+\lambda _2},\frac{\lambda _2}{\lambda _1+\lambda _2}\right) . \end{aligned}$$
    (57)
  • 4. Summation: Plugging the results of \(m\le \mathcal {C}_{i,j}, \mathcal {D}_{i,j}\le M\) in Eq. (53) gives

    $$\begin{aligned} m\le {\overline{\varphi }}_{i,j}^{s+1}\le M. \end{aligned}$$
    (58)

\(\square \)

Again, the bound of the approximate polynomial \(\varphi _h^s(x,y)\) required in Theorem 3 is guaranteed by simply applying the linear scaling limiter Eq. (19).

Finally, taking the third-order MPS DG method as an example, we summary the solution algorithm for each time step from \(t^n\) to \(t^{n+1}\) as follows:

figure a
Table 1 Convergence results of the conservative and non-conservative DG methods

5 Numerical Tests

In this section, a number of benchmark test cases are carried out to illustrate the performance of the proposed method. For simplicity, in the following, the DG(\(P^k\)) methods Eq. (15) with and without the MPS limiter for solving the advection equation in conservative form will be denoted as conservative MPS DG(\(P^k\)) and conservative DG(\(P^k\)) methods, respectively. While the DG(\(P^k\)) methods Eq. (23) with and without the MPS limiter for solving the advection equation in non-conservative form will be denoted as non-conservative MPS DG(\(P^k\)) and non-conservative DG(\(P^k\)) methods, respectively. The union of these four methods will be denoted as DG(\(P^k\)) method.

Fig. 3
figure 3

Interface location for the Zalesak’s disk after one full rotation (red solid line: exact solution, green dashed line: non-conservative MPS DG method) (Color figure online)

Fig. 4
figure 4

Minimum and maximum values of \({\overline{\varphi }}\) in the Zalesak’s disk obtained by the DG(\(P^1\)) method

Fig. 5
figure 5

Minimum and maximum values of \({\overline{\varphi }}\) in the Zalesak’s disk obtained by the DG(\(P^2\)) method

5.1 Convergence Test

We perform a convergence test on the high-order DG methods for solving the advection equations in both conservative and non-conservative forms. Consider an initial condition given by [34]

$$\begin{aligned} \varphi (\mathbf {x},t=0)=\tanh ((y-0.5)/{0.25}) \end{aligned}$$
(59)

on a unit-sized domain with velocity

$$\begin{aligned} \mathbf {u}(\mathbf {x},t)=(\sin (\pi x)\cos (\pi y)\sin (2\pi t), -\cos (\pi x)\sin (\pi y)\sin (2\pi t))^\mathrm {T}. \end{aligned}$$
(60)

Since the velocity field is periodic and the problem is linear, the exact solution at \(t=1\) coincides with the initial condition.

The convergence results obtained by the conservative and non-conservative DG(\(P^k\)) methods are listed in Table 1. One can see that both these two methods can deliver the optimal \((k+1)\)-th order of accuracy. Moreover, due to the velocity field used in this test problem is exactly divergence free, the resulting solutions of these two methods are nearly the same as stated in Remark 2.

5.2 Solid Body Rotation of a Notched Disk

The solid body rotation of a notched circle, also known as Zalesak’s disk [35], is one of the standard test problems for testing the ability of the level set methods to transport a complex geometry with sharp corners. The Zalesak’s disk is defined as follows

  • Domain=\([0,100]^2\);

  • Radius=15, initial center=(50, 75);

  • Slot width=5, slot length=25.

The constant vorticity velocity field is given by

$$\begin{aligned} \mathbf {u}(\mathbf {x},t)=(\pi /314)(50-y, x-50)^\mathrm {T}, \end{aligned}$$
(61)

so that the disk completes one revolution every 628 time units. In order to test how mesh refinement and polynomial order affect the final shape of the notched disk, this problem will be solved by the DG(\(P^1\)) and DG(\(P^2\)) methods with three different meshes consisting of \(50\times 50\), \(100\times 100\) and \(200\times 200\) grids.

Fig. 6
figure 6

Interface location for the circle in a deformation field obtained by the non-conservative MPS DG(\(P^2\)) method with \(256\times 256\) mesh grids

Fig. 7
figure 7

Interface location for the circle in a deformation field at \(t=T\) (black solid line: exact solution, red dash dotted line: \(64\times 64\) grids, green dash dotted dotted line: \(128\times 128\) grids, blue dashed line: \(256\times 256\) grids)

Figure 3 shows that compared with the DG(\(P^1\)) method, the DG(\(P^2\)) method greatly improves the shape of the notch after one period rotation, especially on the coarsest mesh. When the mesh is refined to \(100\times 100\) and \(200\times 200\) grids, the shape corners of the notched disk are well resolved by the DG(\(P^2\)) method and visually no difference can be discerned in comparison with the exact solution.

Next, we validate the maximum-principle-satisfying property of the proposed method. Time-variations of the minimum and maximum values of the cell average solutions are shown in Fig. 4 and 5 for the DG(\(P^1\)) and DG(\(P^2\)) methods, respectively. It can be observed that as the velocity field is divergence free, the solutions obtained by the conservative and non-conservative schemes are very close. Moreover, the numerical solutions of the DG(\(P^1\)) and DG(\(P^2\)) methods with the MPS limiter are strictly in the interval [0, 1], while there are obvious overshoots and undershoots outside [0, 1] for the results without the MPS limiter. This clearly demonstrates that the MPS limiter can preserve the strict maximum principle for the proposed DG(\(P^k\)) method for solving the advection equation in non-conservative form.

Fig. 8
figure 8

Temporal evolution of the normalized mass errors for the circle in a deformation field obtained by the non-conservative MPS DG method (Color figure online)

Fig. 9
figure 9

Comparison of the normalized mass error \(E_1(t)\) for the circle in a deformation field obtained by the conservative and non-conservative MPS DG methods

Fig. 10
figure 10

Temporal evolution of the interface for the Rayleigh–Taylor instability at \(t^*\) obtained by the non-conservative MPS DG method (\(At=0.5\), \(Re=1000\), top: \(P^1\), bottom: \(P^2\))

Fig. 11
figure 11

Temporal evolution of the interface for the Rayleigh–Taylor instability at \(t^*\) obtained by the non-conservative MPS DG method (\(At=0.5\), \(Re=5000\), top: \(P^1\), bottom: \(P^2\))

Fig. 12
figure 12

Temporal evolution of the interface for the Rayleigh–Taylor instability at \(t^*\) obtained by the non-conservative MPS DG method (\(At=0.75\), \(Re=1000\), top: \(P^1\), bottom: \(P^2\))

Fig. 13
figure 13

Temporal evolution of the highest (top line) and the lowest (bottom line) interface locations for the Rayleigh–Taylor instability

Fig. 14
figure 14

Minimum and maximum values of \({\overline{\varphi }}_{i,j}\) for the Rayleigh–Taylor instability (\(At=0.5\), \(Re=1000\))

Fig. 15
figure 15

Minimum and maximum values of \({\overline{\varphi }}_{i,j}\) for the Rayleigh–Taylor instability (\(At=0.5\), \(Re=5000\))

Fig. 16
figure 16

Minimum and maximum values of \({\overline{\varphi }}_{i,j}\) for the Rayleigh–Taylor instability (\(At=0.75\), \(Re=1000\))

5.3 Single Vortex Deformation of a Circle

To test the ability of the proposed MPS DG methods to resolve and maintain ever thinner filaments, a circle in a deformation field problem, which was first introduced by Bell et al. [36] and then applied as a level set test problem by Enright et al. [37], is conducted. A circle of radius \(r=0.15\), initially centered at \((0.5,0.75)^\mathrm {T}\) is deformed inside a unit sized box under a solenoidal velocity

$$\begin{aligned} \left\{ \begin{aligned}&u(\mathbf {x},t)=-\sin ^2(\pi x)\sin (2\pi y)\cos (\pi t/T),\\&v(\mathbf {x},t)=+\sin ^2(\pi y)\sin (2\pi x)\cos (\pi t/T), \end{aligned} \right. \end{aligned}$$
(62)

where \(T=8\) is the time at which the flow returns to its initial state.

Fig. 6 shows the evolution of the circle shape in the deformation field obtained by the non-conservative MPS DG(\(P^2\)) method on a \(256\times 256\) mesh grid. It can be seen that the circle is stretched by the velocity field onto ever thinner filaments until \(t=4\). Then, as the velocity field reverses for another four time units, it pulls the filaments back into the initial circular shape [38]. We observe that during the entire stretching process, our method is able to capture very thin fluid filament.

Now, we turn our attention the convergence property of the proposed method, computations on three different mesh resolutions, refined from \(64\times 64\), \(128\times 128\) to \(256\times 256\) mesh grids, are performed and compared in Fig. 7. It is clear to see that the recovered circle is very comparable to its initial shape when a fine mesh and a high-order method are applied. Next, for further quantitatively comparing the mass conservation property of the proposed method, we define the relative mass errors as follows

$$\begin{aligned} \begin{aligned}&E_0(t)=\frac{\int _{\varOmega }\varphi (\mathbf {x},t)d\mathbf {x}-\int _{\varOmega }\varphi (\mathbf {x},0)d\mathbf {x}}{\int _{\varOmega }\varphi (\mathbf {x},0)d\mathbf {x}},\\&E_1(t)=\frac{\int _{\varOmega }\varphi (\mathbf {x},t)d\mathbf {x}-\int _{\varOmega }\varphi (\mathbf {x},0)d\mathbf {x}}{\int _{\varOmega }\varphi (\mathbf {x},0)d\mathbf {x}}, \quad \text {for } 0.5\le \varphi \le 1. \end{aligned} \end{aligned}$$
(63)

The effect of mesh refinement on the mass conservative property of the proposed method is studied and the computed mass losses are plotted in Fig. 8. As we expect, on the finest mesh, the amount of the tail region that falls below mesh resolution and transfers into resolvable droplets is the least and therefore the conservation error around \(t=4\) is the smallest. For the coarser meshes, more of the tail region falls below mesh resolution and transfers into droplets, which leads to large curvature changes and significant loss of mass during the simulation.

In the end, we compare the normalized mass error \(E_1(t)\) obtained by the conservative and the non-conservative MPS DG methods. The comparisons are shown in Fig. 9. Again, as stated in Remark 2, since a smooth and divergence-free velocity field is applied in this test, the results obtained by these two methods are very close to each other which demonstrate the accuracy and effectiveness of the proposed non-conservative DG method.

5.4 Viscous Rayleigh–Taylor Instability

In this subsection, we combine our high-order MPS DG method for the LS function with an incompressible two-phase flow solver to illustrate the performance of the proposed method for a practical problem, namely the Rayleigh–Taylor instability [39,40,41,42]. The determination of the incompressible two-phase fluids requires the solution of the following INS equations

$$\begin{aligned} \begin{aligned}&\frac{\partial \mathbf {u}}{\partial t}+\mathbf {u}\cdot \nabla \mathbf {u}=\frac{1}{\rho }\big (-\nabla p+\nabla \cdot \big [\mu (\nabla \mathbf {u}+\nabla \mathbf {u}^\mathrm {T})\big ]\big )+\mathbf {g},\\&\nabla \cdot \mathbf {u}=0. \end{aligned} \end{aligned}$$
(64)

Here, \(\mathbf {u}=\mathbf {u}(\mathbf {x},t)\) is the velocity vector, \(p=p(\mathbf {x},t)\) is the pressure and \(\mathbf {g}\) is a unit vector aligned with gravity. \(\rho (\mathbf {x},t)\) is the density calculated by

$$\begin{aligned} \rho (\mathbf {x},t)=\rho _m+(\rho _M-\rho _m)\varphi (x,t), \end{aligned}$$
(65)

where \(\rho _M\) and \(\rho _m\) (\(\rho _M>\rho _m\)) denote the densities of the heavier fluid and the light fluid, respectively, and \(\mu >0\) is the dynamic viscosity of the fluid (supposed to be constant in the whole domain). Initially, the heavier fluid superposed to the light fluid and the perturbed interface is described by

$$\begin{aligned} \eta (x)=-0.1d\cos (2\pi x/d),\quad d=1. \end{aligned}$$
(66)

The computing domain is \({\Omega }=(-d/2,d/2)\times (-2d,2d)\). Non-slip boundary condition is enforced at the bottom and top walls and symmetry boundary condition is imposed on the two vertical sides. In this work, numerical discretization of the INS equations (64) is performed using a high-order DG method proposed in [43,44,45] for its simplicity in implementation.

The difficulty of this problem essentially depends on:

  1. 1.

    The density ratio between the heavy fluid and the light fluid, which is measured by the so-called Atwood number

    $$\begin{aligned} At=\frac{\rho _M-\rho _m}{\rho _M+\rho _m}. \end{aligned}$$
    (67)
  2. 2.

    The viscosity of the fluid, which is measured by the Reynolds number

    $$\begin{aligned} Re=\frac{\rho _md^{3/2}g^{1/2}}{\mu }. \end{aligned}$$
    (68)

We compare the solutions at different Atwood and Reynolds numbers. A uniform mesh with \(50\times 200\) grids is employed for all the computations.

  • A low Atwood number problem at a low Reynolds number: Setting \(At=0.5\) (\(\rho _M=3\), \(\rho _m=1\)), we begin with a low Reynolds number case, \(Re=1000\). The temporal evolution of the interface at \(t^{*}=(t/t_0)T_0=(0.0, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5)T_0\), where \(T_0=\sqrt{At}\), is displayed in Fig. 10. The results are very close to those in [39, 40], and we can only observe some slight difference nearly at the end of the simulation.

  • A low Atwood number problem at a high Reynolds number: Setting \(At=0.5\) (\(\rho _M=3\), \(\rho _m=1\)) and \(Re=5000\). The temporal evolution of the interface at \(t^{*}=(t/t_0)\sqrt{At}=(0.0, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5)T_0\) under this case is displayed in Fig. 11. We observe that when the Reynolds number increases, the velocity of the characteristic mushroom shape remains the same as that of the lower Reynolds case. The influence of increasing Reynolds number appears only in the shape of the rising counter-rotating vortices, which induces many different small structures for \(t^{*}\ge 3.0T_0\).

  • A high Atwood number problem at a low Reynolds number: Setting \(At=0.75\) (\(\rho _M=7\), \(\rho _m=1\)) and \(Re=1000\). The temporal evolution of the interface at \(t^{*}=(0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0)T_0\) under this case is displayed in Fig. 12. Compared with the above test, we can observe the similar structure and the global characteristic of the flow in the early stage. At the same time, we find that the heavy fluid falls faster compared with the low Atwood number problem. The simulation results coincide well with those presented in [41].

Next, to quantitively measure the motion of the interface for the Rayleigh–Taylor instability problem, we track the highest and the lowest vertical locations of the interface obtained by the conservative and non-conservative MPS DG(\(P^1\)) methods and compare them with the available results [40, 42]. The comparison is presented in Fig. 13 which clearly shows good agreement.

In the end, we validate the maximum preserving property of the proposed MPS DG method. In this test, due to numerical oscillations, the divergence of the discrete velocity field is not identically equal to zero. Thus, the conservative DG method can not satisfy the maximum principle even though implemented with the MPS limiter. However, the non-conservative MPS DG method can still keep the strict maximum principle and no value greater than \(M=1\) or smaller than \(m=0\) is encountered during the simulation as shown in Figs. 14, 15, 16. Thus, the high-order non-conservative MPS DG method can be used to solve the incompressible two-phase flows with large density ratio.

6 Concluding Remarks

In this paper, a general framework to construct high-order accurate maximum-principle-satisfying DG method has been developed for solving the level set problem with a non-divergence-free velocity field. We proved that by applying a linear scaling limiter and a strong stability preserving time discretization scheme, the numerical solutions of the level set function obtained by the proposed DG method satisfy the strict maximum principle under a suitable CFL condition. Various numerical test cases, including the application to incompressible two-phase flows, have been presented to demonstrate the validity and accuracy of the proposed method. Generalizations to unstructured grids constitute our ongoing work.