1 Introduction

Many practical problems in computational fluid dynamics can be described by hyperbolic conservation laws on complex geometries. To avoid the difficulty in generating high-quality meshes in many problems, such as complex domains or moving interface problems, using unfitted meshes is a common approach. In this framework, the computational mesh is composed of the embedded Cartesian cells within the domain internally, and irregular “cut” cells are produced by the boundary interacting with each regular grid cell. Since the boundary of the computational area does not coincide with the physical boundary, boundary conditions on the computational domain must be carefully treated to obtain an optimal convergence rate. On the other hand, the irregular cut cells on the domain boundary may be arbitrarily small. It will bring the so-called “small-cell” problem, leading to a severe time step restriction for time-dependent problems. In this paper, we develop a high-order discontinuous Galerkin (DG) method for 1D hyperbolic conservation laws on unfitted meshes. In particular, a novel boundary treatment would be carefully designed to overcome the “small-cell” problem.

The DG method is a class of finite-element methods choosing a set of discontinuous basis functions. The DG method was first introduced by Reed and Hill [26]. Significant breakthroughs were gained by the so-called RKDG methods for solving hyperbolic conservation laws [5,6,7,8,9], in which the DG discretization is only used for the spatial variables, and the time discretization is achieved by the Runge-Kutta methods. DG methods offer numerous advantages compared to classical finite element methods and have found wide applications in various fields. For more details on DG, we refer to [28]. The DG methods on unfitted meshes have been addressed in the literature, and the small-cell problem can be avoided in distinct ways, such as the implicit time stepping [1], the cell merging or the cell agglomeration [24, 25, 27], the stabilization with ghost penalty [2, 11, 12, 14, 15, 30, 31], the state redistribution [13], and the shifted boundary method [29]. In this paper, we are going to give a novel boundary treatment based on the inverse Lax-Wendroff (ILW) principle for the DG method.

The ILW method was developed to give values of ghost points for high-order finite-difference methods on a Cartesian mesh. The first work for hyperbolic conservation law equations was introduced by Tan and Shu [32] and applied to inviscid compressible fluids. Given the inflow boundary conditions, they transformed the normal derivative into the time derivative and the tangential derivative via using the partial differential equation (PDE) repeatedly. Then, values at the ghost points near the boundary were obtained by a Taylor expansion with these normal derivatives. To avoid the heavy algebra of the ILW procedure for nonlinear systems, especially in the high-dimensional cases, the simplified ILW (SILW) method was proposed in Ref. [34], in which high-order derivatives are constructed by extrapolation directly. In Ref. [23], Lu et al. proposed an ILW method to deal with problems with changing wind direction on the boundary. The numerical fluxes near the boundary were suitably modified so that strict conservation of the total mass was achieved in Ref. [10]. In addition, the ILW method has been subsequently applied to various other time-dependent problems, including the advection equations and viscous compressible fluids [22], hyperbolic systems with source terms [36], and moving boundary problems [4, 20, 21, 33]. The linear stability of (S)ILW methods was studied in Refs. [16,17,18,19].

Owing to the advantages, including the ability to achieve arbitrary orders of accuracy and efficiently avoid the small-cell problem, extensive and in-depth research has been conducted on the ILW method within the context of finite-difference schemes. In this paper, we want to incorporate the ILW boundary treatment with DG methods, which could be beneficial for DG methods on unfitted meshes and complex boundary problems. As an initial step and a proof of concept, in this paper, we restrict our attention to 1D hyperbolic conservation laws on an unfitted mesh. The standard DG method would be used on the interior elements. Meanwhile, we treat these small boundary elements as special virtual elements and apply the principles of the (S)ILW treatment to design the numerical boundary conditions. This approach completely mitigates the issue of small time steps, ensuring that our method maintains the same explicit time step as the standard DG method. Moreover, we find that the boundary treatment will break the local conservative property on those virtual elements, leading to a significant impact on the magnitude of errors. An additional post-processing technique is proposed to preserve the local conservation. In the presence of shocks propagating from the inflow boundary, we develop an extra nonlinear limiter to prevent oscillations and maintain accuracy.

The rest of the paper is organized as follows. In Sect. 2, we develop the high-order boundary treatment based on (S)ILW principles for both scalar problems and linear systems. Theoretical analysis, including the stability analysis and error estimates, is presented in Sect. 3. Numerical examples are presented in Sect. 4 to demonstrate the effectiveness of our approach. Concluding remarks are given in Sect. 5.

2 (S)ILW Method for 1D Conservation Laws

We start our discussion with the 1D scalar hyperbolic conservation law on the physical domain \(\varOmega =[a,b]\),

$$\begin{aligned} {\left\{ \begin{array}{ll} u_t + f(u)_x = 0, \quad &{}x\in (a,b),\quad t>0,\\ u(x,0) = u_0(x),\quad &{}x\in [a,b], \\ u(a,t) = g(t), \quad &{}t>0. \end{array}\right. } \end{aligned}$$
(1)

We assume that \(f'(u(a,t))\geqslant \sigma >0\) and \(f'(u(b,t))\geqslant 0\) for \(t>0\). Under this assumption, the left boundary \(x=a\) is an inflow boundary where a Dirichlet boundary condition is imposed, and the right boundary \(x=b\) is an outflow boundary where no boundary condition is needed.

Here, we assume the domain is partitioned by the uniform mesh (see Fig. 1)

$$\begin{aligned} a+\delta _1 = x_\frac{1}{2}<x_\frac{3}{2}<\cdots <x_{N+\frac{1}{2}} = b-\delta _2 \end{aligned}$$

with the uniform mesh size \(h=(b-a-\delta _1-\delta _2)/N\), \(N \in \mathbb {N}\). Note that the physical boundary is allowed to be not coinciding with grid points, and the distance \(\delta _{1,2}\) can be any non-negative number between 0 and h. Let \(I_j = [x_{j-\frac{1}{2}}, x_{j+\frac{1}{2}}]\) denote an element with the length of h, \(j=1, \cdots , N\), and \(\widetilde{\varOmega } = [x_\frac{1}{2}, x_{N+\frac{1}{2}}] = \cup _{i=1}^{N} I_j\) is called the computational domain, in which the numerical solutions are computed via the standard DG method. The non-overlapping cut cells between \(\varOmega \) and \(\widetilde{\varOmega }\) are denoted by \(\tilde{I}_0 = [a,x_\frac{1}{2}]\) and \(\tilde{I}_{N+1}=[x_{N+\frac{1}{2}}, b]\).

Fig. 1
figure 1

Domain decomposition

Let \(P^k(I_{j})\) be the space of polynomials of degree at most \(k \geqslant 0\) on \(I_{j}\), and the DG finite-element space is defined as

$$\begin{aligned} V_h^k = \{ v\!:v|_{I_{j}} \in P^k(I_{j}), \, j=1, \cdots , N \}. \end{aligned}$$
(2)

The semi-discrete DG method for solving (1) is defined as follows: find the unique function \(u_h(\cdot ,t)\in V_h^k\) such that for all test functions \(v_h\in V_h^k\) and all \(1\leqslant j \leqslant N\), we have

$$\begin{aligned} \int _{I_j} (u_h)_tv_h \textrm{d}x - \int _{I_j} f(u_h)(v_h)_x \textrm{d}x + \hat{f}_{j+\frac{1}{2}}v_h\left( x_{j+\frac{1}{2}}^-\right) - \hat{f}_{j-\frac{1}{2}}v_h\left( x_{j-\frac{1}{2}}^+\right) = 0. \end{aligned}$$
(3)

Here, \(w\left( x_{j+\frac{1}{2}}^{-},t\right) \) and \(w\left( x_{j+\frac{1}{2}}^{+},t\right) \) are the left and right limits of the discontinuous solution w(xt) at the interface \(x_{j+\frac{1}{2}}\), respectively. \(\hat{f}_{j+\frac{1}{2}} = \hat{f}\left( u_h\left( x_{j+\frac{1}{2}}^-,t\right) ,u_h\left( x_{j+\frac{1}{2}}^+,t\right) \right) \; ( j=1,2,\cdots ,N-1)\) is the monotone numerical flux as in the standard DG method, which satisfies the following conditions:

  • it is consistent with the flux f(u), i.e., \(\hat{f}(u,u) = f(u)\);

  • it is at least locally Lipschitz continuous with respect to both arguments;

  • it is a nondecreasing function of its first argument, and a nonincreasing function of its second argument.

In particular, the Lax-Friedrichs flux is one of the most commonly used monotone fluxes:

$$\begin{aligned} \hat{f}^\textrm{LF}(u^-,u^+) = \frac{1}{2} \left( f(u^-) + f(u^{+}) -\alpha (u^+ - u^-)\right) , \quad \alpha = \max _u |f'(u)|. \end{aligned}$$
(4)

The semi-discrete DG scheme (3) can be rewritten as the first-order ordinary differential equation (ODE) system \(u_t=\mathcal {L}(u)\), where the operator \(\mathcal {L}(u)\) arises from the spatial discretization. The third-order TVD Runge-Kutta method is used for the time discretization:

$$\begin{aligned} \left\{ \begin{aligned}&u^{(1)}=u^n + \Delta t \mathcal {L}(u^n), \\&u^{(2)}=\frac{3}{4}u^n + \frac{1}{4}u^{(1)} + \frac{1}{4}\Delta t \mathcal {L}(u^{(1)}),\\&u^{n+1}= \frac{1}{3}u^n + \frac{2}{3}u^{(1)} + \frac{2}{3}\Delta t \mathcal {L}(u^{(2)}). \end{aligned}\right. \end{aligned}$$
(5)

It has been demonstrated in Ref. [7] that to ensure the stability of the RKDG method with \(P^k\) elements for problems with periodic boundary conditions, the time step \(\Delta t\) must satisfy the condition \(\Delta t \leqslant \frac{1}{2k+1}\frac{h}{\alpha }\). For the hyperbolic problem (1) with Dirichlet boundary conditions, Ref. [3] indicates that the following match of time is necessary to maintain the third-order accuracy of (5):

$$\begin{aligned} \left\{ \begin{aligned}&u^n \sim g(t_n),\\&u^{(1)} \sim g(t_n) + \Delta t g'(t_n), \\&u^{(2)} \sim g(t_n) + \frac{\Delta t}{2} g'(t_n) + \frac{(\Delta t)^2}{4} g''(t_n). \end{aligned}\right. \end{aligned}$$
(6)

Note that the RKDG scheme can also be used to compute numerical solutions on two small cells \(\tilde{I}_0\) and \(\tilde{I}_{N+1}\). However, the time step \(\Delta t\) would then be restricted to be proportional to \(\min (\delta _1, \delta _2)\) to ensure the stability, which is referred to as the cut-cell problem. In this paper, we will employ the idea of the ILW method to construct values on \(\tilde{I}_0\) and \(\tilde{I}_{N+1}\) through the boundary treatment, and further define the numerical fluxes \(\hat{f}_{1/2}\) and \(\hat{f}_{N+1/2}\). Through this approach, the scheme can employ the time step as the standard DG method, meaning that \(\Delta t\) is only proportional to h and independent of \(\delta _{1,2}\).

2.1 (S)ILW Boundary Treatment at the Inflow Boundary

In this section, we focus on the inflow boundary \(x=a\) and the cell \(\tilde{I}_0=[a,a+\delta _1]\). A high-order ILW method is designed to construct a polynomial \(p(x,t)\in P^k(\tilde{I}_0)\). After that, we can set the numerical flux: \(\hat{f}_{\frac{1}{2}}=\hat{f}\left( p\left( x_{\frac{1}{2}},t\right) , u_h\left( x^{+}_{\frac{1}{2}}, t\right) \right) \).

Contrary to the idea of calculating the time derivatives with the space derivatives in the Lax-Wendroff scheme, the ILW method uses the differential equation to calculate space derivatives with time derivatives. Thus, we can obtain the spatial derivatives on the boundary \(x=a\) by employing the PDE and boundary conditions repeatedly. For example,

$$\begin{aligned} \left\{ \begin{aligned} \partial _x^{(0)}u|_{x=a} =&g(t), \\ \partial _x^{(1)}u|_{x=a} =&\frac{g_l'(t)}{-f'(g_l(t))},\\ \partial _x^{(2)}u|_{x=a} =&\frac{f'(g_l(t))g_l''(t)-2f''(g_l(t))g_l'(t)^2}{f'(g_l(t))^3},\\&\;\vdots \end{aligned}\right. \end{aligned}$$
(7)

Then, we can obtain the polynomial p(xt) with degree at most k by setting

$$\begin{aligned} \partial _x^{(m)} p|_{x=a} = \partial _x^{(m)}u|_{x=a}, \quad m=0, 1, \cdots , k. \end{aligned}$$

In practice, the polynomial p(xt) can be written in the form of the Taylor expansion:

$$\begin{aligned} p(x,t) = \sum _{m=0}^{k} \frac{1}{m!} (x-a)^m \partial _x^{(m)}u|_{x=a}. \end{aligned}$$
(8)

This method can achieve arbitrary high-order accuracy. However, the formula may be very complicated for high-order spatial derivatives. To avoid the very heavy algebra of the above method, we employ the idea of an SILW method in which information from the interior interval would be used.

Denote the cell average of \(u_h\) on \(I_j\) by

$$\begin{aligned}\bar{u}_j = \frac{1}{h} \int _{I_j} u_h(x) \textrm{d}x\end{aligned}$$

and the cell averages of derivatives by

$$\begin{aligned} (\bar{u}_x)_j = \frac{1}{h} \int _{I_j} (u_h)_x(x) \textrm{d}x, \quad (\bar{u}_{xx})_j = \frac{1}{h} \int _{I_j} (u_h)_{xx}(x) \textrm{d}x. \end{aligned}$$

Then, we can construct the polynomial p(x) of degree \(k\geqslant 1\) with information on the boundary \(x=a\) and on the first element \(I_1\). Strategies for \(P^k\), \(k\leqslant 3\), are listed in Table 1. For example, SILW-1 means the unique polynomial \(p(x) \in P^k(\tilde{I}_{0})\) which satisfies

$$\begin{aligned}&\partial _x^{(m)} p|_{x=a} = \partial _x^{(m)}u|_{x=a}, \quad m=0, 1, \cdots , k-1, \end{aligned}$$
(9a)
$$\begin{aligned}&\int _{I_1} p(x,t) \textrm{d}x = h \bar{u}_1, \end{aligned}$$
(9b)

and SILW-2 gives the constraint equations

$$\begin{aligned} \left\{ \begin{aligned}&\partial _x^{(m)} p|_{x=a} = \partial _x^{(m)}u|_{x=a}, \quad m=0, 1, \cdots , k-2, \\&\int _{I_1} p(x,t) \textrm{d}x = h \bar{u}_1, \quad \int _{I_1} p_x(x,t) \textrm{d}x = h (\bar{u}_x)_1. \end{aligned}\right. \end{aligned}$$
(10)
Table 1 Strategies which can be used in (S)ILW

Remark 1

To construct a polynomial \(p(x,t) \in P^k\), we can select \(k+1\) constraints from two sets of information (boundary information and information from the first element \(I_1\)) to form a system of constraint equations. It is crucial to note that the selection of constraints should not be arbitrary. In our experiment, constraints from each set are progressively added from lower order to higher order.

Remark 2

Obviously, the less boundary information \(\partial _x^{(m)}u|_{x=a}\) is used, the more efficient the scheme is. However, it is essential to avoid utilizing too few constraints provided by the boundary information. For example, considering \(k=3\), if we employ three constraints from \(I_1\) and only take u(at) on boundary, i.e.,

$$\begin{aligned} \left\{ \begin{aligned}&p(a,t) = u|_{x=a}, \\&\int _{I_1} p(x,t) \textrm{d}x = h \bar{u}_1, \\&\int _{I_1} p_x(x,t) \textrm{d}x = h (\bar{u}_x)_1, \\&\int _{I_1} p_{xx}(x,t) \textrm{d}x = h (\bar{u}_{xx})_1, \\ \end{aligned} \right. \end{aligned}$$

the constraint equations will lead to singularity and no solution exists when \(\delta \) approaches 0. In addition, selecting too little boundary information will directly affect the stability of the scheme. The theoretical analysis of the SILW method for high-order finite-difference schemes was given in Refs. [16,17,18,19]. We will discuss the stability and accuracy of the SILW boundary treatment for the DG method in this paper later.

Numerical results show that the schemes can always achieve the \((k+1)\)th order accuracy. However, the magnitude of error is closely related to the parameter \(\delta _1/h\). For example, we use the RKDG method with \(P^k\) bases, \(k=0, 1, 2, 3\), to solve the following equation:

$$\begin{aligned} {\left\{ \begin{array}{ll} u_t +u_x = 0, \quad 0<x<2\uppi ,t>0,\\ u(x,0) = -\sin (x), \quad 0<x<2\uppi , \\ u(0,t) = \sin (t). \end{array}\right. } \end{aligned}$$
(11)

This example has the exact solution \(u(x,t) = \sin (t-x)\). We divide the domain with \(N=80\), \(\delta _2=0\), and varying \(\delta =\delta _1\in [0,h)\). Since the numerical flux \(\hat{u}_{i+1/2}=u_h|^-_{i+1/2}\), \(i=1, \cdots , N\), no additional processing is required for the outflow boundary \(x=b\). The proposed (S)ILW method is used for the inflow boundary condition. The \(L_2\) errors on the computational domain \({\tilde{\varOmega }}\) at the final time \(T=3\) are plotted in Fig. 2, showing that the error increases significantly when \(\delta /h\) approaches 1 with \(k\geqslant 1\).

Fig. 2
figure 2

Errors of the test example (11) with different \(\delta /h\). “no-cv” represents that no conservation post-processing has been applied

We find that this phenomenon is caused by the loss of conservation of the reconstructed polynomials \(p(x,t)\in P^k(\tilde{I}_{0})\). To overcome this disadvantage, we propose a post-processing based on the local conservation in the following subsection.

2.2 Post-Processing Based on Local Conservation

One significant advantage of the DG method is that it can ensure the local conservation properties: taking the test function \(v_h=1\) in the classic DG scheme (3), we have

$$\begin{aligned} \int _{I_j} (u_h)_t \textrm{d}x + \hat{f}_{j+\frac{1}{2}}- \hat{f}_{j-\frac{1}{2}} = 0, \quad j=1, \cdots , N. \end{aligned}$$
(12)

This tells us the local conservative of the DG scheme. Note that \(p(x,t) \in P^k(\tilde{I}_0)\) is constructed via the (S)ILW method, and the local conservative property fails on this cut cell,

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t} \int _{a}^{a+\delta _1} p(x,t)\textrm{d}x + \hat{f}_{\frac{1}{2}}- f(g(t)) \ne 0, \quad \end{aligned}$$
(13)

where \(\hat{f}_\frac{1}{2} = \hat{f}\left( p(a+\delta _1,t), u_h\left( x_\frac{1}{2}^+\right) \right) \).

In the following, we introduce the post-processing based on the local conservation for \(k\geqslant 1\). We primarily focus on the treatment of inflow boundaries. The treatment of outflow boundaries will be addressed in the next subsection. For the inflow boundary, the numerical flux \(\hat{f}_{\frac{1}{2}}\) would be modified via the conservation

$$\begin{aligned} \hat{f}^c_{\frac{1}{2}} \triangleq f(g(t)) - \frac{\textrm{d}}{\textrm{d}t} \int _{a}^{a+\delta _1} p(x,t)\textrm{d}x. \end{aligned}$$
(14)

If \(p(x,t) \in P^k\) is obtained by the ILW method (8), then

$$\begin{aligned} \begin{aligned} \hat{f}^c_{\frac{1}{2}} =&f(g(t)) - \int _{a}^{a+\delta _1}\partial _t p(x,t)\textrm{d}x \\ =&f(g(t)) - \sum _{m=0}^{k} \int _{a}^{a+\delta _1} \frac{1}{m!} (x-a)^m \partial _t \partial _x^{(m)}u|_{x=a} \textrm{d}x \\ =&f(g(t)) - \sum _{m=0}^{k} \frac{\delta _1^{m+1}}{(m+1)!} \partial _t \partial _x^{(m)}u|_{x=a} \\ =&f(g(t)) + \sum _{m=0}^{k} \frac{{\delta _1}^{m+1}}{(m+1)!} \partial _x^{(m+1)}f(u)|_{x=a}. \end{aligned} \end{aligned}$$
(15)

Here, we define the notation \(\Pi _s^k[w](x)\) to represent the kth order Taylor polynomial of w(x)

$$\begin{aligned} \Pi _s^k[w](x) = \sum _{m=0}^{k} \frac{1}{m!}(x-s)^m \partial _x^{(m)}w|_{x=s}. \end{aligned}$$
(16)

Notice that the right-hand side of (15) is precisely the Taylor expansion of f(u),

$$\begin{aligned} \hat{f}^c_\frac{1}{2} = \Pi _a^{k+1}[f(u)](a+\delta _1) \approx f(u(a+\delta _1,t)). \end{aligned}$$

This indicates that we actually use the Taylor expansion of the function f(u) at the physical boundary to approximate the numerical flux at the computational boundary, which provides another perspective on the validity of the ILW method.

If p(xt) is obtained by the SILW method, the interior value would be used, whose time derivatives could be given via the DG scheme on \(I_1\). In particular, we can directly set \(v_h=1\) to get the time derivative of the cell average

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t} \bar{u}_1 =&\frac{1}{h}\left( \hat{f}^c_{\frac{1}{2}} - \hat{f}_\frac{3}{2} \right) . \end{aligned}$$
(17)

Higher order information can be obtained by taking a special test function in the DG scheme. But the specific expression is dependent on the choice of DG basis functions and the degree k. For instance, let \(\phi _i\) denote the ith orthogonal Legendre polynomials basis function in \(I_1\),

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t} (\bar{u}_x)_1 ={\left\{ \begin{array}{ll} \frac{12}{h^3}\displaystyle {\int }_{I_1} f(u_h) \textrm{d}x - \frac{6}{h^2} \left( \hat{f}^c_{\frac{1}{2}} + \hat{f}_\frac{3}{2}\right) , \qquad k=1,2, \\ \frac{12}{h^3}\displaystyle {\int }_{I_1} f(u_h) \textrm{d}x + \frac{14}{h^2}\displaystyle {\int }_{I_1}f(u_h(x,t))\phi '_3(x)\,\textrm{d}x - \frac{20}{h^2} \left( \hat{f}^c_{\frac{1}{2}} + \hat{f}_\frac{3}{2}\right) , \quad k=3. \end{array}\right. } \nonumber \\ \end{aligned}$$
(18)

Plugging them in the conservation form (14), we can get an algebraic equation of \(\hat{f}^c_{1/2}\). The numerical flux can be obtained by solving this equation.

Here, we give the details of the SILW-1 method as an example. Utilizing (9a), we know that \(p(x,t) \in P^k\) has the form

$$\begin{aligned} \begin{aligned} p(x,t) =&\sum _{m=0}^{k-1} \frac{1}{m!}(x-a)^m \partial _x^{(m)}u(a,t) + R(t)(x-a)^k \\ =&\, \Pi _a^{k-1}[u](x,t) + R(t)(x-a)^k. \end{aligned} \end{aligned}$$
(19)

Plugging in (9b), we can have

$$\begin{aligned} R(t)&= \frac{k+1}{(a+\delta _1+h)^{k+1}-(a+\delta _1)^{k+1}} \left( h \bar{u}_1 -\int _{I_1}\Pi _a^{k-1}[u](x,t)\,\textrm{d}x \right) . \end{aligned}$$
(20)

Utilizing the expression (14) and (19)–(20), we can obtain the algebraic equations regarding the numerical flux,

$$\begin{aligned} \begin{aligned} \hat{f}^c_\frac{1}{2} =&f(g(t)) - \frac{\textrm{d}}{\textrm{d}t} \int _{a}^{a+\delta _1} \left( \Pi _a^{k-1}[u](x,t) + R(t)(x-a)^k \right) \textrm{d}x \\ =&f(g(t)) - \int _{a}^{a+\delta _1} \partial _t \Pi _a^{k-1}[u](x,t)\,\textrm{d}x - \frac{ \delta _1^{k+1} \left( \hat{f}^c_\frac{1}{2} -\hat{f}_\frac{3}{2} - \frac{\textrm{d}}{\textrm{d}t}\int _{I_1} \uppi _a^{k-1}[u](x,t)\,\textrm{d}x \right) }{(a+\delta _1+h)^{k+1}-(a+\delta _1)^{k+1}}. \end{aligned}\nonumber \\ \end{aligned}$$
(21)

Solve the above equation,

$$\begin{aligned} \hat{f}_\frac{1}{2}^c =&\sum _{m=0}^k \left[ \frac{\partial _x^{(m)}f(u(a,t))}{m!}\right] \delta _1^m + \frac{\delta _1^{k+1}}{(\delta _1+h)^{k+1}} \left\{ \hat{f}_\frac{3}{2} - \sum _{m=0}^k \left[ \frac{\partial _x^{(m)}f(u(a,t))}{m!}\right] (\delta _1 + h)^m \right\} \nonumber \\ =&\Pi _a^k [f(u)](a+\delta _1) + \frac{\delta _1^{k+1}}{(\delta _1+h)^{k+1}} \left\{ \hat{f}_\frac{3}{2} - \uppi _a^k [f(u)](a+\delta _1+h)\right\} . \end{aligned}$$
(22)

The spatial derivatives at \(x=a\) can be conversed to the mixed derivatives using the PDE,

$$\begin{aligned} \partial ^{(m)}_x f(u(a,t)) = -\partial ^{(m-1)}_x \partial _t u(a,t). \end{aligned}$$

After that, all terms including time derivatives can be obtained via the ILW procedure (7).

To illustrate the corrective impact of the post-processing on the numerical flux, we provide Fig. 3 as a comparison to Fig. 2. We can observe that after post-processing, the magnitude of the error no longer exhibits significant variations as \(\delta /h\) approaches 1.

Fig. 3
figure 3

Errors of the test example (11) with different \(\delta /h\). “no-cv” represents that no conservation post-processing has been applied

2.3 Nonlinear Limiter for Shock Waves

Until this point, the numerical flux is designed with the assumption that u(x) is smooth enough. Significantly, the shock wave propagating from the inflow boundary will lead to numerical oscillations and disrupt the stability of the scheme. Therefore, a nonlinear limiter is required to prevent oscillations and ensure the stability in the presence of strong discontinuities in \(\tilde{I}_0\). Numerical experiments demonstrate that the first-order numerical flux \(\hat{f}_\frac{1}{2} = f(g(t))\) (this is the numerical flux of \(k=0\) without the conservative modification) always has a good performance in avoiding spurious oscillations. Thus, we design an extra limiting procedure as follows: to switch the high-order numerical flux \(\hat{f}^c_\frac{1}{2}\) to a first-order flux f(g(t)) when encountering such situations, while retaining the high-order accuracy in smooth regions.

We use the following notations to present the variations in \(\tilde{I}_0\) and \(I_1\):

$$\begin{aligned} \begin{aligned} \Delta _1 =&\left| f(u(a,t)) - \hat{f}^c_\frac{1}{2}\right| , \\ \Delta _2 =&\left| f\left( u_h(x_\frac{1}{2}^+,t\right) \right) - f\left( u_h\left( x_\frac{1}{2} +\delta \right) \right| . \end{aligned} \end{aligned}$$

Next, we define a discontinuous index \(\theta \in [0,1]\) as follows:

$$\begin{aligned} \theta = \eta \left( \left( \frac{\Delta _1-\Delta _2}{\Delta _1 + \varepsilon }\right) ^4\right) , \end{aligned}$$
(23)

where \(\eta (x) = \frac{1}{2}(1+\tanh (20(x-1/2))\) and \(\varepsilon \) is a small number used to avoid the division by zero. We choose \(\varepsilon = 10^{-16}\) in practice. Finally, \(\hat{f}_\frac{1}{2}\) will be modified as a convex combination of \(\hat{f}^c_\frac{1}{2}\) and f(g(t)),

$$\begin{aligned} \hat{f}_\frac{1}{2}^\textrm{mod} = (1-\theta ) \hat{f}^c_\frac{1}{2} + \theta \, f(g(t)). \end{aligned}$$
(24)

Such modification will lead to the following effects.

  1. (i)

    If f(u) is smooth, both \(\Delta _1\) and \(\Delta _2\) are about \(|f_x(u(x_\frac{1}{2},t))|\delta + \mathcal {O}(\delta ^2)\). Thus, \(\theta = \eta (\mathcal {O}(\delta ^4)) = \mathcal {O}(\delta ^4)\) approaches 0 and \(\hat{f}_\frac{1}{2}^\textrm{mod} = \hat{f}^c_\frac{1}{2}+\mathcal {O}(\delta ^4)\). Furthermore, the modification (24) can maintain the original order of accuracy for \(k\leqslant 3\).

  2. (ii)

    If a shock comes from the boundary, \(\Delta _1=\mathcal {O}(1)\). Consequently, \(\theta \approx \eta (1)\) and \(\hat{f}_\frac{1}{2}^\textrm{mod}\) would degenerate to f(g(t)), which could avoid the numerical oscillation around boundary.

It is remarkable that both \(\hat{f}^c_\frac{1}{2}\) and f(g(t)) give the result that the magnitude of the error does not depend on \(\delta /h\) significantly. This leads to the fact that the flux \(\hat{f}_\frac{1}{2}^\textrm{mod}\) has the same property.

2.4 Boundary Treatment at the Outflow Boundary

In this subsection, we are concerned about the treatment of outflow boundaries. Based on the characteristics of the conservation law, information on the downwind side should not affect the interior of the computational domain. Hence, for 1D scalar equations, we can directly compute the numerical flux using values on the interior side of the boundary \(\hat{f}_{N+1/2}=f(u_h(x^-_{N+1/2}),t)\), without considering the information at the physical boundary \(x=b\).

However, when solving systems of equations, inflow and outflow boundary conditions are often mixed at the boundary. The numbers of inflow boundary conditions and outflow boundary conditions depend on how many eigenvalues of the Jacobian at the boundary are positive and negative, respectively. Different components of the solution may interact at the physical boundary through boundary conditions. Therefore, it is necessary to obtain information about these outflow components at the physical boundary.

Let us consider the treatment of the outflow boundary \(x=b\). First, we take p(xt) as the direct extension of the polynomial \(u_h\) on \(I_N\) to the virtual cell \(\tilde{I}_{N+1} = [x_{N+\frac{1}{2}},b]\):

$$\begin{aligned} p(x,t) = u_h|_{I_N}(x), \quad x \in \tilde{I}_{N+1}. \end{aligned}$$

Meanwhile, we still have \(\hat{f}_{N+1/2}=f(u_h(x^-_{N+1/2}),t)\). However, we face the problem of violating conservation properties once again,

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t} \int _{x_{N+\frac{1}{2}}}^{b} p(x,t)\textrm{d}x + f(p(b,t))- \hat{f}_{N+\frac{1}{2}} \ne 0. \end{aligned}$$
(25)

In order to preserve the conservation on the cell \(\tilde{I}_{N+1}\), we modify the point value at \(x=b\) by adding a constant \(p^*(b,t)=p(b,t)+C\),

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t} \int _{x_{N+\frac{1}{2}}}^{b} p(x,t)\textrm{d}x + f(p^*(b,t))- \hat{f}_{N+\frac{1}{2}} = 0. \end{aligned}$$
(26)

Ultimately, we obtain the information at the outflow physical boundary through the following expressions:

$$\begin{aligned} u_h|_{x=b} = p^*(c,t), \quad \partial _x^{(m)} u_h|_{x=b} = \partial _x^{(m)}p(x,t)|_{x=b}, \; m= 1, \cdots , k. \end{aligned}$$
(27)

2.5 The (S)ILW Scheme for Linear Systems

Since a linear system can be decoupled into a group of independent scalar equations after characteristic decomposition, we could do the boundary treatment on each component of the characteristic variable. Hence, the designed (S)ILW methods can work on linear systems as well.

Consider the following system on the physical domain \(\varOmega =[a,b]\):

$$\begin{aligned} {\left\{ \begin{array}{ll} {{\textbf{U}}}_t + {{\textbf{F}}}({{\textbf{U}}})_x = 0, \quad &{}x\in (a,b),\quad t>0,\\ {{\textbf{U}}}(x,0) = {{\textbf{U}}}_0(x),\quad &{}x\in [a,b], \end{array}\right. } \end{aligned}$$
(28)

where \({{\textbf{F}}}({{\textbf{U}}})={{\textbf{A}}}{{\textbf{U}}}\) and \({{\textbf{A}}}\in {{\mathbb {R}}}^{n\times n}\) is a constant matrix. This system is hyperbolic meaning the matrix \({{\textbf{A}}}\) is diagonalizable with real eigenvalues. For problems involving systems of equations, the required boundary conditions at the boundaries are determined by the sign of eigenvalues. Assume the eigenvalues of \({{\textbf{A}}}\) have the property

$$\begin{aligned} \lambda _1\leqslant \cdots \lambda _{n_1}\leqslant 0 < \lambda _{n_1+1}\leqslant \cdots \leqslant \lambda _n, \end{aligned}$$

then

$$\begin{aligned} {{\textbf{A}}}= {{\textbf{P}}}^{-1} \begin{pmatrix} {\mathbf \Lambda }^\mathrm{(L)} &{} \\ &{} {\mathbf \Lambda }^\mathrm{(R)} \end{pmatrix} {{\textbf{P}}},\quad {{\textbf{P}}}\in {{\mathbb {R}}}^{n \times n}, {\mathbf \Lambda }^\mathrm{(L)} \in {{\mathbb {R}}}^{n_1 \times n_1}, {\mathbf \Lambda }^\mathrm{(R)} \in {{\mathbb {R}}}^{n_2 \times n_2}, \; n= n_1+n_2. \end{aligned}$$

with \({\mathbf \Lambda }^\mathrm{(L)}=\textrm{diag}(\lambda _1, \cdots , \lambda _{n_1})\) and \({\mathbf \Lambda }^\mathrm{(R)}=\textrm{diag}(\lambda _{n_1+1}, \cdots , \lambda _{n})\). In this case, we require \(n_2\) boundary conditions at the left boundary \(x = a\) and \(n_1\) conditions at the right boundary \(x = b\).

As an example, we are concerned with the left boundary \(x=a\) imposed with \(n_2\) Dirichlet boundary conditions,

$$\begin{aligned} {{\textbf{U}}}= \begin{pmatrix} {{\textbf{U}}}^{(1)} \\ {{\textbf{U}}}^{(2)} \end{pmatrix}, \quad {{\textbf{U}}}^{(1)}(a,t) = {{\textbf{G}}}(t) \in {{\mathbb {R}}}^{n_2} , \quad \forall t > 0. \end{aligned}$$

Denoted \({{\textbf{V}}}\) as the characteristic variables \({{\textbf{V}}}= {{\textbf{P}}}{{\textbf{U}}}= ({{\textbf{V}}}^\mathrm{(L)}, {{\textbf{V}}}^\mathrm{(R)})^\textrm{T}\), where \({{\textbf{V}}}^\mathrm{(L)}\in {{\mathbb {R}}}^{n_1} \) and \({{\textbf{V}}}^\mathrm{(R)}\in {{\mathbb {R}}}^{n_2} \) are variables moving to the left and right, respectively. The proposed (S)ILW boundary treatment for scalar problems will be applied on each component of \({{\textbf{V}}}\) directly. Particularly, Dirichlet boundary conditions are imposed on conservative variables \({{\textbf{U}}}\) rather than the characteristic variables \({{\textbf{V}}}\). Hence, \({{\textbf{V}}}^\mathrm{(L)}\) and \({{\textbf{V}}}^\mathrm{(R)}\) will change information at \(x=a\), and they should be handled simultaneously.

To be more specific, the (S)ILW boundary treatment for systems is given as follows. Here, we use the superscript \(*\) to present values located at \(x = a\) to ease the notation.

  1. (i)

    First, we consider the outgoing characteristic components \({{\textbf{V}}}^\mathrm{(L)}\). The algorithm introduced in Sect. 2.4 should be applied on each component \(v_i\), \(i=1, \cdots , n_1\). Then, we obtain the values and spatial derivatives at \(x=a\),

    $$\begin{aligned} {{\textbf{V}}}^\mathrm{(L),*}, {{\textbf{V}}}^\mathrm{(L),*}_x,{{\textbf{V}}}^\mathrm{(L),*}_{xx},\cdots . \end{aligned}$$

    Moreover, by utilizing the Lax-Wendroff procedure on each \(v_i\) with the equation \((v_i)_t +\lambda _i (v_i)_x=0\), we can also obtain time derivatives at the boundary

    $$\begin{aligned} {{\textbf{V}}}^\mathrm{(L),*}_t,{{\textbf{V}}}^\mathrm{(L),*}_{tt},\cdots . \end{aligned}$$
  2. (ii)

    Through the following system of equations:

    $$\begin{aligned} {{\textbf{P}}}^{(1)} \begin{pmatrix} {{\textbf{V}}}^\mathrm{(L),*} \\ {{\textbf{V}}}^\mathrm{(R),*} \end{pmatrix}&= {{\textbf{U}}}^{(1),*} = {{\textbf{G}}}(t), \end{aligned}$$
    (29)

    where \({{\textbf{P}}}^{(1)}\) is a matrix formed by the first \(n_2\) rows of the matrix \({{\textbf{P}}}\), we can get the values of the inflow variable by solving the above system. Similarly, we can obtain higher order time derivatives from the system as well:

    $$\begin{aligned} {{\textbf{P}}}^{(1)} \begin{pmatrix} \partial _t^{m}{{\textbf{V}}}^{\mathrm{(L)},*} \\ \partial _t^{m}{{\textbf{V}}}^{\mathrm{(R)},*} \end{pmatrix}&= \partial _t^{m}{{\textbf{U}}}^{(1),*} = {{\textbf{G}}}^{(m)}(t). \end{aligned}$$
  3. (iii)

    We construct numerical fluxes for each inflow component, which is the same as those for the scalar equations.

We would like to remark that this method can provide the desired high-order accuracy. However, numerical experiments indicate that the errors grow as \(\delta /h\) increases. Based on the results of scalar problems, we suspect that this should be caused by the outflow boundary treatment, even though the errors may have been reduced to a certain extent by the conservative modification. Further improvement of the outflow boundary treatment will be considered in the future.

We would want to point out that the proposed methods can also be extended to nonlinear systems. However, the algorithm becomes more complicated, especially for the SILW method with the conservative modification. Since the numerical fluxes are generally not one-sided fluxes, outflow variables and inflow variables are coupled more tightly. To do the conservative modification on the outgoing variables, the numerical flux \({\hat{{{\textbf{F}}}}}_{1/2}\) is needed, which also depends on the inflow values on \(\tilde{I}\). Hence, solving a complex nonlinear system appears necessary. To address this problem, we have to design a new conservative modification, which is left as future work.

3 Theoretical Analysis

In this section, the theoretical analysis, including the stability analysis and error estimates, will be provided for the 1D linear initial-boundary value problem,

$$\begin{aligned} {\left\{ \begin{array}{ll} u_t + u_x = 0, \quad &{}x\in (a,b),\quad t>0,\\ u(x,0) = u_0(x),\quad &{}x\in [a,b], \\ u(a,t) = g(t), \quad &{}t\geqslant 0. \end{array}\right. } \end{aligned}$$
(30)

In this case, the left boundary \(x = a\) is always an inflow boundary and the right boundary \(x = b\) is an outflow boundary. Here, we only need to consider the effect of treatment of the inflow boundary. Again the domain is divided by the following uniform mesh with the mesh size \(h=x_{j+1/2}-x_{j-1/2}\) for \(j=1,\cdots ,N\), and \(\delta \in [0,h]\):

$$\begin{aligned} a+\delta = x_\frac{1}{2}< x_\frac{3}{2}<\cdots <x_{N+\frac{1}{2}} = b. \end{aligned}$$

For simplicity, we assume \(a=0\) and the prescribed condition \(g(t)=0.\)

In the following, DG schemes with \(P^k\) bases are considered, \(k=1, 2, 3\). The simple upwind numerical flux is used for the interior elements, i.e., \(\hat{u}_{j+1/2} = u_h|^-_{j+1/2}\), \(j=1, \cdots , N\). The flux \(\hat{u}_{1/2}\) can be obtained by the proposed SILW strategies with or without the conservative modification. First, we will prove the linear stability of all these schemes for both semi-discrete and fully discrete cases. This can be achieved via the eigenvalue spectrum visualization [35]. Specially, the energy stability analysis and error estimates for SILW-1 with the conservative modification will be discussed in Sects. 3.2 and 3.3.

3.1 Eigenvalue Spectrum Visualization

In this subsection, we present the stability analysis by visualizing the eigenspectrum of the discretized operators. For the kth order schemes, we set \(k+1\) equally spaced points in \(I_j\),

$$\begin{aligned} \hat{x}^{(i)}_j = x_j + \frac{2i-k}{2(k+1)}h, \quad i=0, \cdots , k. \end{aligned}$$

After picking a local Lagrange basis, the standard semi-discrete DG scheme (3) for the linear advection equation with upwind flux in inner cells can be written as

$$\begin{aligned} \frac{\textrm{d} \textbf{U}_{j}}{\textrm{d}t} = \frac{1}{h}( \textbf{A} \textbf{U}_{j-1} + \textbf{B} \textbf{U}_{j} ), \quad j=2, \cdots , N, \end{aligned}$$
(31)

where \(\textbf{U}_j\) is a vector of length \(k+1\) containing the coefficients of the solution \(u_h\) corresponding to the local basis inside \(I_j\), which also represents the values of \(u_h\) at the nodes \(\{\hat{x}^{(i)}_j\}_ {i=0}^{k}\). \(\textbf{A}\) and \(\textbf{B}\) are \((k+1)\times (k+1)\) constant matrices.

On the other hand, the numerical flux \(\hat{u}_\frac{1}{2}\) can be presented with \(u_h\) in \(I_1\), and the boundary information (which is always 0) and the DG semi-discrete scheme (3) on \(I_1\) can be sorted as follows:

$$\begin{aligned} \frac{\textrm{d} \textbf{U}_{1}}{\textrm{d}t} = \frac{1}{h} \textbf{C} \textbf{U}_1. \end{aligned}$$

Here, \(\textbf{C}\) is a \((k+1)\times (k+1)\) constant matrix.

Finally, the semi-discrete scheme yields a linear system expressed in a matrix-vector form as

$$\begin{aligned} \frac{\textrm{d} {\textbf {U}}}{\textrm{d}t} = \frac{1}{h} {\textbf {Q}}{} {\textbf {U}}, \end{aligned}$$
(32)

where \({\textbf {U}}\) is the vector representing the values of the solution at all nodes \(\{\hat{x}^{(i)}_j, \, j=1, \cdots , N, i=0,\cdots , k\}\),

$$\begin{aligned} \textbf{U}= ((\textbf{U}_1)^\textrm{T}, (\textbf{U}_2)^\textrm{T},\cdots ,(\textbf{U}_N)^\textrm{T})^\textrm{T}, \end{aligned}$$

and

$$\begin{aligned} \textbf{Q} = \begin{pmatrix} \textbf{C} &{} &{} &{} &{}\\ \textbf{A} &{} \textbf{B} &{} &{} &{}\\ &{} \textbf{A} &{} \textbf{B} &{} &{}\\ &{} &{} \ddots &{} \ddots &{}\\ &{} &{} &{} \textbf{A} &{} \textbf{B} \end{pmatrix}. \end{aligned}$$
(33)

This system contains the chosen inner scheme as well as the inflow boundary treatments.

We apply the normal mode analysis to (32) to get the eigenvalue problem. Assuming a solution of the form \(u(x,t)=\textrm{e}^{st}u_0(x)\) and \(\tilde{s}=hs\), the semi-discrete scheme (32) yields

$$\begin{aligned} \tilde{s} \, {\textbf {U}} = {\textbf {Q}}{} {\textbf {U}}, \end{aligned}$$

with \(\tilde{s}\) being the eigenvalue. The semi-discretization provided with the considered boundary conditions is stable if the whole eigenvalue spectrum of the coefficient matrix \({\textbf {Q}}\) lies in the left half-plane, i.e., \(\textrm{Re}\,\!(\tilde{s})\leqslant 0\). Note that eigenvalues of \(\textbf{Q}\) (33) are composed of the eigenvalues of \(\textbf{B}\) and \(\textbf{C}\), denoted by \(\kappa ^B\) and \(\kappa ^C\), respectively. It is easy to verify that \(\kappa ^B\) satisfies the condition. Therefore, we only need to focus on \(\kappa ^C\) in the following.

For example, considering the semi-discrete DG scheme with \(P^1\) basis and SILW-1 boundary treatment, \(\hat{u}_\frac{1}{2}\) and the coefficient matrix \(\textbf{C}\) have the forms as follows:

$$\begin{aligned} \hat{u}_\frac{1}{2} = \frac{2\delta }{2\delta + h} \bar{u}_1,\quad \textbf{C} = \frac{1}{4} \begin{pmatrix} -7 &{} -3\\ 11 &{} -9 \end{pmatrix} + \frac{2\delta }{2\delta + h} \begin{pmatrix} \frac{5}{4} &{} \frac{5}{4}\\ -\frac{1}{4} &{} -\frac{1}{4} \end{pmatrix}. \end{aligned}$$
(34)

Denote \(\mu =\frac{\delta }{h}\in [0,1)\). We can analytically calculate the eigenvalues of \(\textbf{C}\),

$$\begin{aligned} \kappa ^C_{1,2} = - \frac{3\mu +2\pm \sqrt{9\mu ^2-2}}{2\mu +1}. \end{aligned}$$

It can be verified that \(\textrm{Re}\,\!(\kappa ^C_{1,2})<0\) for all \(\mu \in [0,1)\), indicating that the semi-discrete scheme is stable. Moreover, if we construct \(\hat{u}_\frac{1}{2}\) with the conservative modification, i.e., \(\hat{u}_\frac{1}{2}^c\),

$$\begin{aligned} \hat{u}^c_{\frac{1}{2}} = \frac{\delta ^2}{(\delta +h)^2}\hat{u}_{\frac{3}{2}} = \frac{\delta ^2}{(\delta +h)^2}u_{\frac{3}{2}}^-,\quad \textbf{C} = \frac{1}{4} \begin{pmatrix} -7 &{} -3\\ 11 &{} -9 \end{pmatrix} + \frac{\delta ^2}{(\delta + h)^2} \begin{pmatrix} -\frac{5}{4} &{} \frac{15}{4}\\ \frac{1}{4} &{} -\frac{3}{4} \end{pmatrix}. \end{aligned}$$
(35)

In this case, we have the eigenvalues of \(\textbf{C}\) as

$$\begin{aligned} \kappa _{1,2}^C = \frac{ -(3\mu ^2+4\mu +2 \pm \sqrt{9\mu ^4+12\mu ^3-2\mu ^2-8\mu -2} ) }{(\mu +1)^2}, \end{aligned}$$

and \(\textrm{Re}\,\!(\kappa ^C_{1,2})<0\) also holds for all \(\mu \in [0,1)\).

For the semi-discrete scheme with \(k=2, 3\), the results are displayed in Fig. 4 due to the complexity of analytic eigenvalue expressions. We plot the maximum of \(\textrm{Re}\,\!(\kappa ^c)\) for different \(\delta /h\). It is observed that these semi-discrete schemes are stable since the real parts of the eigenvalues are all negative.

Fig. 4
figure 4

Stability analysis of semi-discrete DG schemes: the maximum of \(\textrm{Re}\,(\kappa ^C)\) for different \(\mu = \delta /h\in [0,1]\). no-cv here represents that no conservation post-processing has been applied

We can also prove the stability of the full-discrete scheme with the third-order RK time discretization (5). The full-discrete scheme yields a linear system expressed in a matrix-vector form as

$$\begin{aligned} {\textbf {U}}^{n+1} = g({\textbf {Q}}){\textbf {U}}^n, \end{aligned}$$
(36)

where \(g({\textbf {X}})\) is a matrix function

$$\begin{aligned} g({\textbf {X}}) ={\textbf {I}} + \lambda {\textbf {X}} + \frac{1}{2!}(\lambda {\textbf {X}})^2 + \frac{1}{3!}(\lambda {\textbf {X}})^3, \end{aligned}$$

and \(\lambda = \frac{\Delta t}{h} = \frac{1}{2k+1}\) is the CFL number. The full-discrete scheme is stable if the whole eigenvalue spectrum of \(g({\textbf {Q}})\) is contained within the unit disk, i.e., \(\rho (g({\textbf {Q}})) \leqslant 1\). It is obvious that the eigenvalues of \(g(\textbf{Q})\) are composed of the eigenvalues of \(g(\textbf{B})\) and \(g(\textbf{C})\). Similarly, we only need to focus on the part corresponding to the boundaries, i.e., the eigenvalues of \(g(\textbf{C})\).

For \(k=1, 2, 3\), we plot the \(\rho (g(\textbf{C}))\) for different \(\delta /h\) in Fig. 5. The results indicate that the full-discrete schemes are stable when an appropriate time discretization is employed.

Fig. 5
figure 5

Stability analysis of fully discrete DG schemes: \(\rho (g(\textbf{C}))\) for different \(\mu = \delta /h\in [0,1]\). no-cv here represents that no conservation post-processing has been applied

3.2 Energy Stability

In this subsection, we establish the energy stability of the semi-discrete DG scheme with the SILW-1 boundary treatment.

Proposition 1

For the linear equation (30) with the homogeneous inflow boundary conditions, if we employ the upwind numerical flux internally and conservative SILW-1 flux near the inflow boundary, the corresponding semi-discrete DG scheme (3) with \(k\geqslant 1\) is energy stable

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t} \mathcal {E}_h(t) \leqslant 0 \end{aligned}$$
(37)

with the discrete energy defined as

$$\begin{aligned} \mathcal {E}_h(t) = \left( 1- \frac{1}{2^{2k+2}}\right) ^{-1} \, \int _{I_1}(u_h)^2 \textrm{d}x + \int _{x_{3/2}}^{x_{N+1/2}} (u_h)^2 \textrm{d}x. \end{aligned}$$
(38)

Proof

Let \(v_h=u_h\) and use the upwind numerical flux in (3), we have

$$\begin{aligned} 0=&\int _{I_j} (u_h)_t u_h\,\textrm{d}x - \int _{I_j} u_h (u_h)_x \textrm{d}x+ u^-_{j+\frac{1}{2}} u^-_{j+\frac{1}{2}} - u^-_{j-\frac{1}{2}} u^+_{j-\frac{1}{2}} \\ =&\int _{I_j} \frac{1}{2} \frac{\textrm{d}}{\textrm{d}t}(u_h)^2\,\textrm{d}x - \frac{1}{2} \left( u_{j+\frac{1}{2}}^-\right) ^2 + \frac{1}{2} \left( u_{j-\frac{1}{2}}^+\right) ^2 + \left( u_{j+\frac{1}{2}}^-\right) ^2 - u_{j-\frac{1}{2}}^- u_{j-\frac{1}{2}}^+ . \end{aligned}$$

Summing over \(j\geqslant 2\), we can obtain that

$$\begin{aligned} \sum _{j=2}^N \int _{I_j}\frac{1}{2} \frac{\textrm{d}}{\textrm{d}t} (u_h)^2 \,\textrm{d}x&\leqslant - \frac{1}{2} \left( u_{N+\frac{1}{2}}^-\right) ^2 + \frac{1}{2} \left( u_\frac{3}{2}^-\right) ^2 \leqslant \frac{1}{2} \left( u_\frac{3}{2}^-\right) ^2. \end{aligned}$$

Combining the homogeneous boundary condition \(g(t)=0\), the conservative SILW-1 fluxes (22) for general \(k\geqslant 1\) are in the same form,

$$\begin{aligned} \hat{u}^c_\frac{1}{2} = \frac{\delta ^{k+1}}{(\delta +h)^{k+1}} \hat{u}_\frac{3}{2} = \frac{\delta ^{k+1}}{(\delta +h)^{k+1}} {u}^-_\frac{3}{2}. \end{aligned}$$
(39)

Taking \(v_h=u_h\) in the first item \(I_1\), we have

$$\begin{aligned} \int _{I_1}\frac{1}{2} \frac{\textrm{d}}{\textrm{d}t} (u_h)^2\,\textrm{d}x&= -\frac{1}{2} \left( u^-_\frac{3}{2}\right) ^2 -\frac{1}{2} \left( u_\frac{1}{2}^+\right) ^2 +\frac{\delta ^{k+1}}{(\delta +h)^{k+1}} u^-_\frac{3}{2} u^+_{\frac{1}{2}} \nonumber \\&\leqslant -\frac{1}{2} \left( u^-_\frac{3}{2}\right) ^2 + \frac{1}{2} \left( \frac{\delta ^{k+1}}{(\delta +h)^{k+1}}\right) ^2 \left( u^-_\frac{3}{2}\right) ^2. \end{aligned}$$

Using weighted summation over all cells with a constant \(W = \left( 1- \frac{1}{2^{2k+2}}\right) ^{-1}\), we can get

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t}\mathcal {E}_h(t) =&\, W \int _{I_1} \frac{\textrm{d}}{\textrm{d}t} (u_h)^2\,\textrm{d}x +\sum _{j=2}^N \int _{I_j} \frac{\textrm{d}}{\textrm{d}t} (u_h)^2 \,\textrm{d}x \\ \leqslant&\, W\left[ \left( \frac{\delta ^{k+1}}{(\delta +h)^{k+1}}\right) ^2 -1\right] \left( u_\frac{3}{2}^-\right) ^2 + \left( u_\frac{3}{2}^-\right) ^2 \nonumber \\ =&\, \left[ W\left( \frac{\delta ^{k+1}}{(\delta +h)^{k+1}}\right) ^2 -W + 1\right] \left( u_\frac{3}{2}^-\right) ^2 \\ \leqslant&\, 0. \end{aligned}$$

Hence, the energy stability is proved.

When employing the ILW boundary treatment for the linear function with homogeneous Dirichlet boundary conditions, the numerical flux \(\hat{u}_{1/2} =0\). In this case, the energy stability can be easily proven in the same way.

Proposition 2

For the linear equation (30) with the homogeneous inflow boundary condition, if we use the upwind numerical flux internally and the ILW flux at the inflow boundary, the corresponding semi-discrete DG scheme (3) with \(k\geqslant 0\) is stable in the \(L^2\) norm

$$\begin{aligned} \frac{\textrm{d}}{\textrm{d}t} \Vert u_h(\cdot ,t)\Vert ^2_{2,{\tilde{\varOmega }}} \leqslant 0. \end{aligned}$$
(40)

Remark 3

Unfortunately, those conclusions cannot be directly extended to nonlinear equations. For linear equations, \(\hat{f}_{1/2}u^{+}_{1/2}\) can be bounded by the expression consisting of point values \((u^+_{1/2})^2\) and \((u^{-}_{3/2})^2\), and further be canceled by those terms generated from \(\int _{I_1}f(u)u_x\textrm{d}x\). However, for nonlinear problems, \(\int _{I_j}f(u)u_x\textrm{d}x\) and \(\hat{f}_{j+1/2}u^{\pm }_{j+1/2}\) have different forms. Moreover, the terms derived from the boundary treatment are more complex and could not be canceled or merged with the inner schemes, making the analysis inapplicable.

3.3 Error Estimate

In this section, we will establish the error estimates of the semi-discrete scheme for the linear advection equation with the conservative SILW-1 flux.

Suppose that u(x) is sufficiently smooth, we have the Taylor formula with the Peano form of the remainder

$$\begin{aligned}&u\left( x_\frac{1}{2},t\right) = \Pi _0^{k}[u](\delta ) + \frac{\partial _x^{(k+1)}u(0,t)}{(k+1)!}\delta ^{k+1} + O(h^{k+2}), \\&u\left( x_\frac{3}{2},t\right) = \Pi _0^{k}[u](\delta +h) + \frac{\partial _x^{(k+1)}u(0,t)}{(k+1)!}(\delta +h)^{k+1} + O(h^{k+2}). \end{aligned}$$

Note that the explicit expression of the conservative SILW-1 flux (22) for the linear equation (30) degenerates to

$$\begin{aligned} \hat{u}^c_\frac{1}{2} = \Pi ^k_0[u](\delta ) + \frac{\delta ^{k+1}}{(\delta +h)^{k+1}} \left( u^-_\frac{3}{2} -\Pi ^k_0[u](\delta +h) \right) . \end{aligned}$$
(41)

Hence,

$$\begin{aligned} \begin{aligned} \hat{u}^c_\frac{1}{2}&= \left[ u\left( x_\frac{1}{2},t\right) - \frac{\partial _x^{(k+1)}u(0,t)}{(k+1)!}\delta ^{k+1} + O(h^{k+2})\right] \\&\quad + \frac{\delta ^{k+1}}{(\delta +h)^{k+1}} \left[ u^-_\frac{3}{2} -u\left( x_\frac{3}{2},t\right) + \frac{\partial _x^{(k+1)}u(0,t)}{(k+1)!}(\delta +h)^{k+1} + O(h^{k+2}) \right] \\&= u\left( x_\frac{1}{2},t\right) - \frac{\delta ^{k+1}}{(\delta +h)^{k+1}} \left( u\left( x_\frac{3}{2},t\right) - u^-_\frac{3}{2} \right) + O(h^{k+2}). \end{aligned} \end{aligned}$$
(42)

Next, we introduce the Gauss-Radau projection \(P_-\) and \(L^2\) projection P into \(V^k_h\). For a given function w, the projection \(P_-w\in V_h\) satisfies

$$\begin{aligned} {\left\{ \begin{array}{ll} \displaystyle {\int }_{I_j} (P_-w(x)-w(x))v_h(x)\,\textrm{d}x = 0, \quad \forall v_h \in P^{k-1}(I_j),\\ P_-w(x_{j+\frac{1}{2}}^-)=w\left( x_{j+\frac{1}{2}}^-\right) . \end{array}\right. } \end{aligned}$$
(43)

And the projection \(Pw\in V_h\) satisfies

$$\begin{aligned} \int _{I_j} (Pw(x)-w(x))v_h(x)\,\textrm{d}x = 0, \quad \forall v_h \in P^{k}(I_j). \end{aligned}$$
(44)

Moreover, the projection \(P_*\), which can be \(P_-\) or P, has the properties

$$\begin{aligned} \Vert u -P_* u \Vert _{\infty ,I_j} \leqslant C h^{k+1} |u|_{\infty ,k+1,I_j}, \end{aligned}$$
(45)
$$\begin{aligned} \Vert u -P_* u \Vert _{2,I_j} \leqslant C h^{k+\frac{3}{2}} |u|_{\infty ,k+1,I_j} \end{aligned}$$
(46)

for any \(u\in C^{k+1}(I_j)\). Here, \(C>0\) is some constant that is independent of \(h=|I_j|\) and u.

Proposition 3

Consider the linear equation (30) with the homogeneous Dirichlet boundary condition. Suppose the exact solution u is smooth. We consider the semi-discrete DG scheme (3) with the upwind numerical flux internally and the conservative SILW-1 flux at the inflow boundary, then the numerical solution \(u_h\) satisfies the following error estimate:

$$\begin{aligned} ||u-u_h||_{2,{\tilde{\varOmega }}}\leqslant C h^{k+1}, \end{aligned}$$
(47)

where \(C>0\) depends on u and its derivatives but is independent of h and \(\delta \).

Proof

We decompose the error into two parts

$$\begin{aligned} u-u_h =\eta + \xi , \quad \eta = u - P_-u, \quad \xi = P_-u - u_h. \end{aligned}$$

Note that the scheme (3) in the cell \(I_j\), \(j\geqslant 2\), is the same as the standard DG method. Hence, we can get the following inequality from the error estimate of the standard DG method [28]:

$$\begin{aligned} \frac{1}{2} \sum _{j=2}^N \frac{\textrm{d}}{\textrm{d}t}\int _{I_j} \xi ^2\,\textrm{d}x \leqslant -\sum _{j=2}^N \eta _t\xi \,\textrm{d}x - \frac{1}{2} \left( \xi ^-_{N+\frac{1}{2}}\right) ^2 + \frac{1}{2} \left( \xi ^-_{\frac{3}{2}}\right) ^2. \end{aligned}$$
(48)

Next, we focus on the special treatment for the inflow boundary cell \(I_1\). For any \(v_h\in V_h\),

$$\begin{aligned}&\int _{I_1} (u_h)_t v_h\,\textrm{d}x - \int _{I_1} u_h (v_h)_x\,\textrm{d}x + (u_h)_\frac{3}{2}^- v_h\left( x_\frac{3}{2}^-\right) - \hat{u}^c_\frac{1}{2} v_h\left( x_\frac{1}{2}^+\right) = 0,\\&\int _{I_1} u_t v_h\,\textrm{d}x - \int _{I_1} u (v_h)_x\,\textrm{d}x + u(x_\frac{3}{2},t) v_h\left( x_\frac{3}{2}^-\right) - u\left( x_\frac{1}{2},t\right) v_h\left( x_\frac{1}{2}^+\right) = 0. \end{aligned}$$

Subtracting these two equations, we obtain the error equation

$$\begin{aligned}&\int _{I_1} (u-u_h)_t v_h\,\textrm{d}x - \int _{I_1} (u-u_h) (v_h)_x\,\textrm{d}x \nonumber \\&+ \left( u\left( x_\frac{3}{2},t\right) -(u_h)_\frac{3}{2}^-\right) v_h\left( x_\frac{3}{2}^-\right) - \left( u\left( x_\frac{1}{2},t\right) -\hat{u}^c_\frac{1}{2}\right) v_h\left( x_\frac{1}{2}^+\right) = 0,\,\,\forall v_h\in V_h. \end{aligned}$$

Specially, take \(v_h = \xi \in V_h\),

$$\begin{aligned} 0 =&\int _{I_1} (\eta +\xi ) _t\xi \,\textrm{d}x - \int _{I_1}(\eta + \xi )\xi _x\,\textrm{d}x + \left( \eta _\frac{3}{2}^- + \xi _\frac{3}{2}^-\right) \xi _\frac{3}{2}^- -\left( u\left( x_\frac{1}{2},t\right) -\hat{u}^c_\frac{1}{2}\right) \xi _\frac{1}{2}^+ \nonumber \\ =&\int _{I_1} \eta _t \xi \,\textrm{d}x +\int _{I_1} \xi _t\xi \,\textrm{d}x - \frac{1}{2} \left( \xi _\frac{3}{2}^-\right) ^2 + \frac{1}{2} \left( \xi _\frac{1}{2}^+\right) ^2 + \left( \xi _\frac{3}{2}^-\right) ^2 -\left( u\left( x_\frac{1}{2},t\right) -\hat{u}^c_\frac{1}{2}\right) \xi _\frac{1}{2}^+ . \end{aligned}$$

Employing the equivalent formula of \(\hat{u}^c_\frac{1}{2}\) (42), we have

$$\begin{aligned} u(x_\frac{1}{2},t)-\hat{u}^c_\frac{1}{2}&= \frac{\delta ^{k+1}}{(\delta +h)^{k+1}} \left[ u\left( x_\frac{3}{2},t\right) - u_h\left( x_\frac{3}{2}^-\right) \right] + \beta (u,\delta ,h) \\&= \frac{\delta ^{k+1}}{(\delta +h)^{k+1}} \xi _\frac{3}{2}^- + \beta (u,\delta ,h), \end{aligned}$$

where \(|\beta (u,\delta ,h)| \leqslant C h^{k+2}\). Therefore,

$$\begin{aligned} \int _{I_1} \xi _t\xi \,\textrm{d}x&= -\int _{I_1} \eta _t \xi \,\textrm{d}x - \frac{1}{2} \left( \xi _\frac{3}{2}^-\right) ^2 -\frac{1}{2} \left( \xi _\frac{1}{2}^+\right) ^2 +\left[ \frac{\delta ^{k+1}}{(\delta +h)^{k+1}} \xi _\frac{3}{2}^- + \beta (u,\delta ,h)\right] \xi _\frac{1}{2}^+ \nonumber \\&\leqslant -\int _{I_1} \eta _t \xi \,\textrm{d}x - \frac{1}{2} \left( \xi _\frac{3}{2}^-\right) ^2 +\frac{1}{2} \left[ \frac{\delta ^{k+1}}{(\delta +h)^{k+1}} \xi _\frac{3}{2}^- + \beta (u,\delta ,h)\right] ^2. \end{aligned}$$
(49)

We now take \(\alpha = \frac{\delta ^{k+1}}{(\delta +h)^{k+1}}< \left( \frac{1}{2}\right) ^{k+1} < 1\). Since

$$\begin{aligned} - \frac{1}{2} \left( \xi _\frac{3}{2}^-\right) ^2 +\frac{1}{2} \left( \alpha \xi _\frac{3}{2}^- + \beta \right) ^2 \leqslant&\,\frac{\alpha ^2-1}{2} \left( \xi _\frac{3}{2}^-\right) ^2 + \frac{1-\alpha ^2}{2} \left( \xi _\frac{3}{2}^-\right) ^2 + \frac{\alpha ^2 \beta ^2}{2(1-\alpha ^2)} + \frac{1}{2} \beta ^2\\ \leqslant&\,C h^{2k+4}, \end{aligned}$$

we can obtain that

$$\begin{aligned} \int _{I_1} \xi _t\xi \,\textrm{d}x&\leqslant -\int _{I_1} \eta _t \xi \,\textrm{d}x - \frac{1}{2} \left( \xi _\frac{3}{2}^-\right) ^2 +\frac{1}{2} \left[ \alpha \xi _\frac{3}{2}^- + \beta (u,\delta ,h)\right] ^2 \\&\leqslant -\int _{I_1} \eta _t \xi \,\textrm{d}x + C h^{2k+4} \\&\leqslant \frac{1}{2} \int _{I_1} (\eta _t)^2\,\textrm{d}x + \frac{1}{2} \int _{I_1} \xi ^2\,\textrm{d}x + C h^{2k+4} \\&\leqslant \frac{1}{2} \int _{I_1} \xi ^2\,\textrm{d}x + C h^{2k+3}. \end{aligned}$$

The last inequality holds when u is smooth enough. If we take the initial value \(u_h = P u\) where P is a standard \(L^2\) projection, we can get the following estimate using Gronwall’s inequality:

$$\begin{aligned} \int _{I_1} \xi (x,t)^2\,\textrm{d}x \leqslant \textrm{e}^{t} \int _{I_1}\xi (x,0)^2 \,\textrm{d}x + \textrm{e}^{t} \int _0^\tau \textrm{e}^{-\tau }C h^{2k+3} \,\textrm{d}\tau \leqslant C(1+\textrm{e}^{t}) h^{2k+3}. \end{aligned}$$
(50)

According to the inverse inequality, there exists a constant C related to u and t such that

$$\begin{aligned} \left| \xi _\frac{3}{2}^-\right| \leqslant \Vert \xi \Vert _{\infty ,I_1} \leqslant C h^{-\frac{1}{2}} \Vert \xi \Vert _{2,I_1} \leqslant C h^{k+1}. \end{aligned}$$
(51)

Plugging (51) into (49), we can obtain

$$\begin{aligned} \begin{aligned} \int _{I_1} \xi _t\xi \,\textrm{d}x&\leqslant -\int _{I_1} \eta _t \xi \,\textrm{d}x - \frac{1}{2} \left( \xi _\frac{3}{2}^-\right) ^2 +\frac{1}{2} \left[ \alpha (\delta ,h) \xi _\frac{3}{2}^- + \beta (u,\delta ,h)\right] ^2 \\&\leqslant -\int _{I_1} \eta _t \xi \,\textrm{d}x - \frac{1}{2} \left( \xi _\frac{3}{2}^-\right) ^2 + C h^{2k+2}. \end{aligned} \end{aligned}$$
(52)

Now, we combine the estimates (48) and (52), and have

$$\begin{aligned} \begin{aligned} \frac{1}{2} \sum _{j=1}^N \frac{\textrm{d}}{\textrm{d}t}\int _{I_j} \xi ^2 \,\textrm{d}x&\leqslant - \sum _{j=1}^N \int _{I_j }\eta _t \xi \,\textrm{d}x - \frac{1}{2} \left( \xi ^-_{N+\frac{1}{2}}\right) ^2 + C h^{2k+2} \\&\leqslant \frac{1}{2} \sum _{j=1}^N \int _{I_j} \xi ^2\,\textrm{d}x + C h^{2k+2}. \end{aligned} \end{aligned}$$
(53)

Using Gronwall’s inequality, we can obtain

$$\begin{aligned} \sum _{j=1}^N \int _{I_j} \xi (x,t)^2\,\textrm{d}x \leqslant \textrm{e}^{t} \sum _{j=1}^N \int _{I_j} \xi (x,0)^2\,\textrm{d}x + \int _0^t \textrm{e}^{{t}-\tau } C h^{2k+2}\,\textrm{d}\tau . \end{aligned}$$
(54)

Noting that for the initial value,

$$\begin{aligned} \sum _{j=1}^N \Vert \xi (\cdot ,0)\Vert _{2,I_j}^2 \!= \!\sum _{j=1}^N \Vert P_-u - P u \Vert _{2,I_j}^2 \!\leqslant \! 2 \sum _{j=1}^N \left( \Vert u - P_- u \Vert _{2,I_j}^2 \!+\! \Vert u \!-\! P u \Vert _{2,I_j}^2\right) \leqslant C h^{2k+2}, \end{aligned}$$
(55)

we can get the \(L^2\) estimate of \(\xi \)

$$\begin{aligned} \Vert \xi (x,t) \Vert _{2,{\tilde{\varOmega }}}^2&= \sum _{j=1}^N \int _{I_j} \xi (x,t)^2\,\textrm{d}x \leqslant C (1+\textrm{e}^{t}) h^{2k+2}\textrm{,} \end{aligned}$$
(56)

which gives us the final conclusion

$$\begin{aligned} \Vert u(x,t) - u_h(x,t)\Vert _{2,{\tilde{\varOmega }}}^2&\leqslant 2 \left( \Vert \xi (x,t) \Vert _2^2 + \Vert \eta (x,t) \Vert _2^2\right) \leqslant C (1+\textrm{e}^{t}) h^{2k+2}. \end{aligned}$$
(57)

4 Numerical Examples

In this section, we present some numerical examples to demonstrate the performance of our proposed scheme. For the scalar case, both linear and nonlinear equations are considered. We also employ this method to solve linear systems.

In all our computations, we test the DG method with \(V^k_h\) (\(k=1, 2, 3\)) coupling with the conservative SILW-k boundary treatment. Without special declaration, the domain is divided uniformly with a cut element sized \(\delta \) at the left boundary. And we choose two extreme values \(\delta /h = 0.01, 0.99\), to show their influence on the numerical performance. The third-order Runge-Kutta method (5) is used for the time discretization with the time step \(\Delta t = \lambda h\) for \(k \leqslant 2\) and \(\Delta t = \lambda h^{\frac{k+1}{3}}\) for \(k=3\). The CFL number \(\lambda = \frac{1}{(2k+1)\alpha }\) is the same as that used in the standard RKDG method.

4.1 Accuracy Test for the Linear Scalar Equation

In this example, we consider the initial-boundary value problem of the linear advection equation

$$\begin{aligned} {\left\{ \begin{array}{ll} u_t + u_x = 0, \quad &{}x\in (0,\textrm{2}\uppi ),\quad t>0,\\ u(x,0) = -\sin (x),\quad &{}x\in [0,\textrm{2}\uppi ], \\ u(0,t) = \sin (t), \quad &{}t>0. \end{array}\right. } \end{aligned}$$
(58)

The exact solution is \(u(x,t)=\sin (t-x)\). In this case, the left boundary \(x = 0\) is an inflow boundary all the time and the right boundary \(x = \textrm{2}\uppi \) is an outflow boundary. Errors are calculated on the computational domain \({\tilde{\varOmega }}\). The \(L^2\) errors and \(L^\infty \) errors at time \(t=3\) are shown in Table 2. We can see that for all cases, the schemes are stable and can achieve the optimal \((k+1)\)th order. Moreover, with the help of the conservative modification, errors with different \(\delta \) have no significant difference.

Table 2 Example in Sect. 4.1: numerical errors and orders of the linear equation at \(t=3\)

4.2 Linear Scalar Equation with Non-smooth Boundary

Next, we consider the linear problem with non-smooth inflow boundary data:

$$\begin{aligned} {\left\{ \begin{array}{ll} u_t + u_x = 0, \quad &{}x\in (0,1),\quad t>0,\\ u(x,0) = 0,\quad &{}x\in [0,1], \\ u(0,t) = g(t), \quad &{}t>0, \end{array}\right. } \end{aligned}$$
(59)

where

$$\begin{aligned} g(t) = \left\{ \begin{aligned}&1,&t \leqslant 0.5,\\&0,&t > 0.5. \end{aligned}\right. \end{aligned}$$

We can see that discontinuities enter the computational domain from the inflow boundary. To control oscillations, the TVD limiter is applied on the interior cells and the modification mentioned in Sect. 2.3 is used on \(\hat{f}_\frac{1}{2}\). Numerical results with SILW-1 and SILW-2 are shown in Figs. 6 and 7, respectively, demonstrating that our algorithm does not introduce additional numerical oscillations when handling strong discontinuities near cut cells.

Fig. 6
figure 6

Example in Sect. 4.2: numerical solutions for the linear equation with the non-smooth boundary condition at \(t=0.75\). the SILW-1 boundary treatment is used. Left: \(\delta = 0.01h\); right: \(\delta =0.99h\)

Fig. 7
figure 7

Example in Sect. 4.2: numerical solutions for the linear equation with the non-smooth boundary condition at \(t=0.75\). The SILW-2 boundary treatment is used. Left: \(\delta = 0.01h\); right: \(\delta =0.99h\)

4.3 Nonlinear Burgers’ Equation

In this example, we apply the scheme to Burgers’ equation:

$$\begin{aligned} {\left\{ \begin{array}{ll} u_t + \left( \frac{u^2}{2}\right) _x = 0, \quad &{}x\in (-\uppi ,\uppi ),\quad t>0,\\ u(x,0) =1 + 2 \sin (x),\quad &{}x\in [-\uppi ,\uppi ], \\ u(-\uppi ,t) = g(t), \quad &{}t>0. \end{array}\right. } \end{aligned}$$
(60)

We take the boundary condition \(g(t)=w(-\uppi ,t)\), where w(xt) is the exact solution of the initial value problem on \((-\uppi , \uppi )\) with periodic boundary conditions and can be obtained by Newton’s method. For all time, the left boundary \(x = -\uppi \) is an inflow boundary and the right boundary \(x =\uppi \) is an outflow boundary. To verify the performance of the nonlinear limiter on the boundary treatment, we always use the modified numerical flux (24) in this example.

When \(t=0.3\), the exact solution is still smooth. Errors are shown in Table 3. It is observed that the scheme can always achieve the optimal \((k+1)\)th order accuracy and the ratio \(\delta /h\) does not effect the magnitude of errors significantly, demonstrating the limiters do not destroy the accuracy of smooth solutions.

At \(t=0.5\), a shock is fully developed in the interior of the computational domain. Moreover, a shock enters the inflow boundary at \(t = 2\uppi \) and moves to \(x=0\) at \(t = 3\uppi \). In order to capture the shock and avoid numerical oscillations, the TVD limiter is applied on the interior cells. Figures 8 and 9 indicate that the shock is well captured by our method.

Table 3 Example in Sect. 4.3: numerical errors and orders of Burgers’ equation at \(t=0.3\)
Fig. 8
figure 8

Example in Sect. 4.2: numerical solutions for Burgers’ equation at \(t=3\uppi \), with the SILW-1 boundary treatment. Left: \(\delta = 0.01h\); right: \(\delta =0.99h\)

Fig. 9
figure 9

Example in Sect. 4.2: numerical solutions for Burgers’ equation at \(t=3\mathrm {\uppi }\), with the SILW-2 boundary treatment. Left: \(\delta = 0.01h\); right: \(\delta =0.99h\)

4.4 Linear System

Finally, we consider the linear system,

$$\begin{aligned} \begin{pmatrix} u \\ v \end{pmatrix}_t + \begin{pmatrix} &{} -1 \\ -c^2 &{} \end{pmatrix} \begin{pmatrix} u \\ v \end{pmatrix}_x = 0, \quad x \in (0,2\uppi ), \, t > 0. \end{aligned}$$
(61)

We fix the coefficient \(c=1.5\) and choose the corresponding initial value to match the exact solution

$$\begin{aligned} \left\{ \begin{aligned} u(x,t)&= \cos (x+c t),\\ v(x,t)&= c \cos (x+c t).\\ \end{aligned} \right. \end{aligned}$$

Since the eigenvalues of the coefficient matrix are \(\pm c\), one boundary condition is needed at each boundary. Here, we take the boundary condition

$$\begin{aligned} u(0,t) = \cos (c t), \quad u(2\uppi ,t) = \cos (c t). \end{aligned}$$

The computational errors of all components, as shown in Table 4, indicate that our method still maintains the optimal convergence rate. However, in comparison to the scalar case, the impact of the ratio \(\delta /h\) is shown, leading to different magnitudes of errors. This is due to the outflow boundary treatment for the system. Even though the conservative modification has reduced the influence of the ratio \(\delta /h\), errors of the outflow variable are transmitted into the inflow variable through the boundary treatment, and further affect the internal solutions.

Table 4 Example in Sect. 4.4: numerical errors and orders of the linear system at \(t=4\)

5 Conclusion

In this paper, we design high-order DG methods to solve hyperbolic conservation laws on unfitted meshes. The standard RKDG method is employed on the interior cells. On the small cut cells near physical boundaries, we apply the idea of the ILW method to construct approximation polynomials. Moreover, the post-processing is given in order to preserve the local conservation properties of the DG solution. The eigenvalue spectrum visualization method is used to analyze the stability of the boundary treatment for both the semi-discrete and fully discrete cases. The energy stability and error analysis are given for a specific boundary treatment. Numerical results demonstrate that our methods can achieve the optimal convergence rate and completely avoid the typical issue of small time steps. In addition, an extra nonlinear limiter is provided to prevent oscillations if a shock is close to the boundary. Numerical examples illustrate that our method has the capacity to treat shocks going through the boundaries.

We note that the treatment for the outflow boundary can give high-order accuracy. However, the ratio \(\delta /h\) has a significant impact on the magnitude of errors, and the same is true for systems. We would like to improve this algorithm in the future. Moreover, boundary treatments for nonlinear systems and high-dimensional problems are subject to future research.