1 Introduction

Characteristic-wise Weighted Essentially Non-Oscillatory (WENO) conservative finite difference scheme as a class of high order/high resolution nonlinear scheme for simulating flows with both shock waves and small scale structures was initially developed in [12] (for details and history of WENO scheme, see [17] and references contained therein). The key idea is that the use of a dynamic set of substencils where a nonlinear convex combination of lower order (local) polynomials adapts either to a higher order (global) polynomial approximation at smooth stencils, or to a local polynomial approximation that avoids interpolation across discontinuities. However, there are certain disadvantages of using WENO scheme for solving hyperbolic conservation laws for certain class of problems. For example, it is computationally expensive than other low order nonlinear shock capturing schemes (like TVD). Moreover, it is, in general, too dissipative for certain class of problems (for example, compressible turbulence) than the linear schemes at a given order and resolution.

High order linear schemes which have superior dispersion and dissipation properties and computationally efficient, are widely used in the direct numerical simulations. Some often used high order linear schemes are the central finite difference scheme (CFD) [4] that has a strong dispersive error, the bandwidth optimized finite difference scheme (BFD) that increases the resolution at a cost of a reduced order of accuracy, and the compact finite difference (Compact) scheme that requires solving a system of banded matrix equation [1, 13, 15]. High order Compact schemes are a class of spectral-like scheme which are sufficiently accurate to resolve both small and large scale structures presented at direct numerical simulation of highly complex flows. In practice, there are two types of Compact scheme, the compact central finite difference (CCD) scheme and the compact upwind finite difference (CUW) scheme. As we know, the CCD scheme has no numerical dissipations. However, a small amount of numerical dissipation for a numerical scheme is often necessary in order to damp out oscillations issuing from initial and boundary conditions, as well as from aliasing error. The class of upwind scheme, which have more numerical dissipation, sometime also have less accuracy but can get a better numerical resolution, have been widely used in the computational fluid dynamics. For this purpose, the compact type upwind schemes have been developed in [1, 18, 26], which drop the restriction of symmetric coefficients, thus allowing the scheme to be upwind even with a centered stencil. However, when applied the Compact scheme to simulate the shocked flows, known as the Gibbs phenomenon generated, that causes loss of accuracy and numerical instability.

A natural remedy to alleviate the corresponding disadvantage of the high order WENO and linear schemes is to avoid using the WENO scheme and to use high order linear scheme in smooth regions of the solution wherever and whenever possible in practice. In the last two decades, the hybrid compact-WENO scheme has been employed in many different research areas. In [1], a class of upwind-biased Compact schemes is proposed in a general form, suitable for the time accurate direct numerical simulation of fluid convection problems and coupled with ENO scheme for the shock-turbulence interaction problems. The conservative hybrid compact-WENO schemes for shock-turbulence interaction is constructed by Pirozzoli in [15] which demonstrated better resolution properties than standard WENO schemes and hybrid compact-ENO schemes [1] as well, at a lower computational cost. Ren et al. developed a class of characteristic-wise hybrid compact-WENO scheme for solving hyperbolic conservation laws [16]. In [1, 15, 16], they used a low order smooth indicator as the criterion between the switch of the Compact and WENO schemes, this is not good enough especially for the complex flow filed which contain discontinuous and high frequency waves (such as shock-density problem). The characteristic-wise hybrid compact-WENO scheme in [16] results in a block-tridiagonal matrix which is computationally expensive, but not a tridiagonal system which can be solved efficiently. In our previous work [5, 14], a hybrid compact-WENO scheme, based on the 5th-order characteristic-wise WENO scheme and the high resolution spectral-like 6th-order compact central finite difference scheme (we refer to it as the Hybrid-CCD6 scheme for simplicity) was developed for the hyperbolic conservation laws and detonation wave simulations respectively. The smoothness of the solution is measured by the high order multi-resolution (MR) analysis [8] which can differentiate a high frequency wave from a high gradient/shock at each grid points. An 8th-order finite difference filtering [19] is also applied to stabilize the Hybrid-CCD6 scheme.

Furthermore, under certain extreme conditions, such as a strong shock with a very large density and/or pressure jump ratio and/or a near vacuum state with a very low density and/or pressure, the WENO scheme or Hybrid scheme still generates (despite small) numerical oscillations which cause the negative pressure and/or density when solving the Euler equations. In order to guarantee the positivity of these important physical quantities (density and pressure), Zhang et al. [22] designed an elaborate positivity-preserving high order WENO finite difference schemes. General equations of state and source terms are also considered in [24]. In [9], Hu et al. simply weighted the high-order WENO flux with the positively-preserving first-order Lax–Friedrichs flux at a location where the density and/or pressure is less than some critical positive value, to ensure the positivity-preserving property for general high-order conservative schemes. In [7], Guo et al. designed a positivity-preserving hybrid compact-WENO finite volume scheme following the ideas in [22, 23].

In this paper, we aim to the conjugation of high order conservative compact upwind scheme and the WENO-Z scheme for numerical simulations of compressible Euler equations. The 5th-order characteristic-wise WENO-Z5 finite difference scheme [2, 3] and 5th-order CUW scheme [15] are employed to resolve solutions in the non-smooth parts and the smooth parts of the solution respectively. A high order MR analysis is performed at the beginning of Runge–Kutta step to measure the smoothness of solutions at a given grid point to maintain the high order/resolution nature of the hybrid scheme. Furthermore, a positivity- and bound-preserving limiter is also designed for the new hybrid scheme to simulate the problems with extreme conditions. We refer to the new hybrid scheme with a positivity- and bound-preserving limiter as the Hybrid-CUW5 scheme. Different from the Hybrid-CCD6 scheme, the Hybrid-CUW5 scheme limit the numerical oscillations by the compact upwind scheme due to its own dissipation and at the same time get a better resolution properties. Moreover, it is difficult to design a positivity-preserving limiter for the Hybrid-CCD6 scheme, which computes the derivative of the numerical flux using the CCD scheme directly in the smooth regions.

The paper is organized as follows. In Sect. 2, we briefly review the conservative WENO-Z5 finite difference scheme, conservative CUW scheme and positivity-preserving limiter for the Euler equations, then we extend the positivity-preserving limiter to the detonation equations. In Sect. 3, the efficiency and accuracy of the Hybrid-CUW5 scheme are verified by comparing with the WENO-Z5 and Hybrid-CCD6 schemes in simulating numerous one- and two-dimensional shocked flow problems with original and extreme conditions. Concluding remarks are given in Sect. 4.

2 Numerical Schemes

The nonlinear system of hyperbolic conservation laws of one-dimensional compressible Euler equation can be written compactly as

$$\begin{aligned} {{\mathbf {Q}}}_t + \nabla \cdot {\mathbf {F}}({\mathbf {Q}}) = \mathbf {0}, \end{aligned}$$
(1)

with

$$\begin{aligned} {\mathbf {Q}}= \begin{bmatrix} \rho \\ \rho u\\ E \end{bmatrix}, \quad {\mathbf {F}}= \begin{bmatrix} \rho u \\ \rho u^2+P\\ (E+P)u \end{bmatrix}, \end{aligned}$$
(2)

are vectors of the conservative variables and flux, where \(\rho \) is density, P is pressure, u is the velocity. The total energy E is given by,

$$\begin{aligned} E = \frac{P}{\gamma -1} + \frac{1}{2}\rho u^2, \end{aligned}$$
(3)

where \(\gamma \) is the ratio of idea gas.

2.1 WENO-Z5 Finite Difference Scheme

Below is the brief description of the WENO-Z5 finite difference scheme for solving a nonlinear scalar hyperbolic equation in one dimension. Readers are referred to the literature [17] for discussion on other variants of high order WENO finite difference schemes.

Fig. 1
figure 1

The computational uniformly spaced grid \(x_i\) and the 5-points stencil \(S^5\), composed of three 3-points substencils \(\{S_0, S_1, S_2\}\), used for the fifth-order WENO reconstruction step

Consider an equidistant grid defined by the points \(x_i = i {\Delta x}, i=0,\ldots ,N\), which are called cell centers, with cell boundaries given by \(x_{i+\frac{1}{2}}=x_i+\frac{{\Delta x}}{2}\), where \({\Delta x}\) is the uniform grid spacing (see Fig. 1). The semi-discretized form of Eq. (1) is transformed into the system of ordinary differential equations and solved by the method of lines

$$\begin{aligned} \frac{dQ_i(t)}{dt} = - \left. {{\partial f} \over {\partial x}} \right| _{x=x_i}, \quad i=0,\ldots ,N, \end{aligned}$$
(4)

where \(Q_i(t)\) is a numerical approximation to the point value \(Q(x_i,t)\).

To form the flux difference across the uniformly spaced cells and to obtain high-order numerical flux consistent with the hyperbolic conservation laws, a conservative finite difference formulation is required at the cell boundaries. By defining a numerical flux function h(x) implicitly, one has

$$\begin{aligned} f(x) = \frac{1}{{\Delta x}}\int _{x-\frac{{\Delta x}}{2}}^{x+\frac{{\Delta x}}{2}} h(\xi ) d\xi , \end{aligned}$$
(5)

such that the spatial derivative in Eq. (4) is approximated by a conservative finite difference formula at \(x_i\),

$$\begin{aligned} \frac{dQ_i(t)}{dt}= -\frac{1}{{\Delta x}}\left( h_{i+\frac{1}{2}}-h_{i-\frac{1}{2}}\right) , \end{aligned}$$
(6)

where \(h_{i \pm \frac{1}{2}}=h(x_{i \pm \frac{1}{2}})\). High order polynomial interpolations to \(h_{i\pm \frac{1}{2}}\) are computed by using the point values \(f_j=f(x_j), j= i-2,\ldots ,i+2\).

The heart of the WENO methodology is the polynomial reconstruction procedure as discussed here. As shown in the Fig. 1, the 5-points global stencil \(S^5=(x_{i-2},\ldots ,x_{i+2})\) is subdivided into three 3-points substencils \(S_k,k=0,1,2\). The fifth degree polynomial approximation \({\hat{f}}_{i+ \frac{1}{2}}=h_{i + \frac{1}{2}}+O({\Delta x}^5)\) is built through the convex combination of three second degree interpolation polynomials in substencils \(S_k, (k=0,1,2)\) at the cell boundaries \(x_{i + \frac{1}{2}}\),

$$\begin{aligned} {\hat{f}}_{i+ \frac{1}{2}}= \sum _{k=0}^2 \omega _k {\hat{f}}^k \left( x_{i + \frac{1}{2}}\right) , \end{aligned}$$
(7)

where \(\omega _k\) are the normalized nonlinear weights and

$$\begin{aligned} {\hat{f}}^k(x_{i+\frac{1}{2}}) = \sum _{j=0}^2 c_{kj}f_{i-k+j}, \quad i=0,\ldots ,N, \end{aligned}$$
(8)

with Lagrangian interpolation coefficients \(c_{kj}\) [12].

The regularity of the interpolation polynomial approximation \({\hat{f}}^k(x)\) of the substencil \(S_k\) at \(x_i\) is measured by the local lower order smoothness indicators \(\beta _k\), which are given by

$$\begin{aligned} \beta _k=\sum _{l=1}^2 {\Delta x}^{2l-1}\int _{x_{i-\frac{1}{2}}}^{x_{i+\frac{1}{2}}} \left( \frac{d^{l}}{dx^{l}}{\hat{f}}^k(x)\right) ^2 dx , \quad k = 0,1,2. \end{aligned}$$
(9)

The explicit expression of the smoothness indicators \(\beta _k\) can be found in [12].

In the WENO-Z5 scheme [2, 3], the nonlinear weights \(\omega _k\) are defined as

$$\begin{aligned} \alpha _k =d_k \left( 1+\left( \frac{\tau _5}{\beta _k +\epsilon }\right) ^{p}\right) , \quad \omega _k =\frac{\alpha _k }{\sum _{l=0}^2 \alpha _l }, \quad k=0,1,2, \end{aligned}$$
(10)

where \(\tau _5 = \left| \beta _2 - \beta _0 \right| \), which has a leading truncation error of order \(O({\Delta x}^5)\). The coefficients \(\left\{ d_0=\frac{3}{10}, d_1=\frac{3}{5}, d_2=\frac{1}{10}\right\} \) are the ideal weights that, when the solution is sufficiently smooth, one has \(\{\omega _k \approx d_k, k=0,1,2\}\) and the WENO-Z5 scheme essentially becomes the optimal fifth order central upwind scheme. The machine \(\epsilon \) (\(\epsilon =10^{-16}\) in this study) is used to avoid the division by zero in the denominator and power parameter p (\(p=2\) in this study) is chosen to increase the difference of scales of distinct weights at the non-smooth stencils of the solution [6].

2.2 Conservative Compact Upwind Finite Difference Schemes

In this subsection, we briefly review the 5th-order compact upwind finite difference (CUW5) scheme introduced in [15] which is nearly optimal for its resolution properties among the family of compact schemes they developed.

For the 6th-order compact central finite difference (CCD6) scheme, the derivative of flux (Eq. 4) is computed at the cell center \(x_i\) directly as

$$\begin{aligned} \frac{1}{3}f_{i-1}' + f_i' + \frac{1}{3}f_{i+1}' = \frac{1}{36{\Delta x}}(-f_{i-2}-28f_{i-1}+28f_{i+1}+f_{i+2}). \end{aligned}$$
(11)

Readers are referred to [14] for more detailed discussion of its compact matrix representation and the boundary treatment at the ghost points. To mitigate any numerical oscillations that might appear in an Hybrid-CCD6 scheme for the non-dissipative property of CCD6 scheme, we propose to apply high order finite difference filtering

$$\begin{aligned} \hat{q}_i = \sum _{j=-n}^{n} \alpha _j q_{i+j}, \end{aligned}$$
(12)

where q is the given function and \(\hat{q}\) is the filtered function. \(\alpha _j\) are the filtering weights of order n (in this study we use \(n=8\)) which satisfy the symmetry property \(\alpha _{-j}=\alpha _j\), ensuring no dispersion. One can see [4, 19] for detailed discussion of the filter.

In this study, we will employ the 5th-order compact upwind (CUW5) scheme. In contrary to the CCD6 scheme, the numerical flux is computed at the cell boundaries \(x_{i+\frac{1}{2}}\) as

$$\begin{aligned} 3\hat{f}_{i-\frac{1}{2}} + 6\hat{f}_{i+\frac{1}{2}} + \hat{f}_{i+\frac{3}{2}} = \frac{1}{3}(f_{i-1}+19f_{i}+10f_{i+1}). \end{aligned}$$
(13)

It can be written compactly as

$$\begin{aligned} \mathbf {A} {\hat{\mathbf {f}}} = \mathbf {Bf} + \mathbf {b}, \end{aligned}$$
(14)

where \(\mathbf {A}\) and \(\mathbf {B}\) are the tridiagonal matrices,

$$\begin{aligned} \mathbf {A} = \left( \begin{array}{ccccc} {6} &{}\quad {1}&{}\quad &{}\quad &{}\quad \\ {3} &{}\quad {6} &{}\quad {1} &{}\quad &{}\quad \\ &{}\quad \ddots &{}\quad \ddots &{}\quad \ddots &{}\quad \\ &{}\quad &{}\quad {3} &{}\quad {6} &{}\quad {1} \\ &{}\quad &{}\quad &{}\quad {3} &{}\quad {6} \\ \end{array} \right) , \quad \mathbf {B} = \frac{1}{3} \left( \begin{array}{cccccc} 19 &{}\quad 10 &{}\quad &{}\quad &{}\quad &{}\quad \\ 1 &{}\quad 19 &{}\quad 10 &{}\quad &{}\quad &{}\quad \\ &{}\quad 1 &{}\quad 19 &{}\quad 10 &{}\quad &{}\quad \\ &{}\quad &{}\quad \ddots &{}\quad \ddots &{}\quad \ddots &{}\quad \\ &{}\quad &{}\quad &{}\quad 1 &{}\quad 19 &{}\quad 10 \\ &{}\quad &{}\quad &{}\quad &{}\quad 1 &{}\quad 19 \\ \end{array} \right) , \end{aligned}$$

which can be numerically solved very efficiently. The vectors \(\hat{\mathbf {f}}\) and \(\mathbf {f}\) are

$$\begin{aligned} \hat{\mathbf {f}} =\left( \hat{f}_{-1/2},\hat{f}_{ 1/2}, \ldots ,\hat{f}_{N-1/2},\hat{f}_{N+1/2}\right) ^{\scriptscriptstyle T}, \quad \mathbf {f} =\left( f_{-1},f_{ 0},\ldots , f_{N-1},f_{N}\right) ^{\scriptscriptstyle T}. \end{aligned}$$

The vector \(\mathbf {b}\) is

$$\begin{aligned} \mathbf {b} =\left( \frac{1}{3}f_{-2} - 3 \hat{f}_{-3/2}, 0,\ldots ,0,\frac{10}{3}f_{N+1} - \hat{f}_{N+3/2}\right) ^{\scriptscriptstyle T}, \end{aligned}$$

where \(f_{-2}=f_{0}-2{\Delta x}\) and \(f_{N+1}=f_{N}+{\Delta x}\) are the ghost points. The numerical flux at two boundary points \(\hat{f}_{-3/2}\) and \(\hat{f}_{N+3/2}\) are reconstructed by the WENO-Z5 scheme. Then we can obtain the spatial derivative in Eq. (4) by

$$\begin{aligned} \left. {{\partial f} \over {\partial x}} \right| _{x=x_i} = \frac{1}{{\Delta x}}\left( \hat{f}_{i+\frac{1}{2}}-\hat{f}_{i-\frac{1}{2}}\right) . \end{aligned}$$
(15)
Fig. 2
figure 2

Dispersion and dissipation properties of the UW5, CCD6 and CUW5 schemes

Figure 2 shows the spectral analysis [11, 15] of the CUW5 scheme, the CCD6 scheme and the explicit 5th-order upwind (UW5) scheme. It is clear that the CUW5 scheme yields a much better resolution than both the UW5 and CCD6 schemes. While the dissipation error is confined to the high wavenumbers \(\omega >2.5\), the CUW5 scheme is much more dissipative than the other two schemes. The stronger dissipation allows the damping of the high modes which are often associated with the numerical errors, such as the aliasing error, rounding error, truncation error and nonlinear error, to remove numerical oscillations and to enhance the stability of the scheme in solving a nonlinear system of PDE. For nonlinear PDEs such as the Euler equations, a suitable small amount of numerical dissipation is necessary to maintain the stability of the numerical scheme.

2.3 Positivity-Preserving Limiter for Euler Equations

We briefly introduce a positivity-preserving limiter constructed by Hu et al. [9] which simply weighted the high-order flux with the first-order Lax–Friedrichs flux at a location where the density and/or pressure is less than some critical positive value, to ensure the positivity-preserving property for general high order conservative schemes.

Firstly, we denote the momentum \(\rho u = m\). We also note that the density and pressure have the following relations with the conservative variables \({\mathbf {Q}}\)

$$\begin{aligned} \rho ({\mathbf {Q}}) = \rho , \quad P({\mathbf {Q}}) = (\gamma -1)\left( E-\frac{1}{2}\frac{m^2}{\rho }\right) , \end{aligned}$$
(16)

through simple derivation and the Jensen’s inequality, for \(0 \le \theta \le 1\), \(\rho ({\mathbf {Q}})\) and \(P({\mathbf {Q}})\) have

$$\begin{aligned} \rho [(1-\theta ){\mathbf {Q}}_1 + \theta {\mathbf {Q}}_2]= & {} (1-\theta )\rho ({\mathbf {Q}}_1) + \theta \rho ({\mathbf {Q}}_2), \end{aligned}$$
(17)
$$\begin{aligned} P[(1-\theta ){\mathbf {Q}}_1 + \theta {\mathbf {Q}}_2]\ge & {} (1-\theta )P({\mathbf {Q}}_1) + \theta P({\mathbf {Q}}_2), \mathrm {if}\,\, \rho ({\mathbf {Q}}_1), \rho ({\mathbf {Q}}_2) > 0. \end{aligned}$$
(18)

Next, the convex set of admissible states is defined by

$$\begin{aligned} {\mathbf {G}}_E= \left\{ {\mathbf {Q}}= (\rho , m, E)^T|\quad \rho> 0 \,\, \mathrm {and}\,\, P = (\gamma -1)\left( E-\frac{1}{2}\frac{m^2}{\rho }\right) > 0 \right\} . \end{aligned}$$

A general explicit conservative scheme with the first order stable Euler forward time integration from \(t=n{\Delta t}\) to \(t=(n+1){\Delta t}\), with a time step size \({\Delta t}\), can be written as

$$\begin{aligned} {\mathbf {Q}}_i^{n+1} = {\mathbf {Q}}_i^{n} + \lambda (\widehat{{\mathbf {F}}}_{i-1/2} - \widehat{{\mathbf {F}}}_{i+1/2}), \end{aligned}$$
(19)

and

$$\begin{aligned} \lambda = \frac{{\Delta t}}{{\Delta x}}= \frac{\mathrm {CFL}}{\alpha }, \end{aligned}$$
(20)

where \(c = \sqrt{\gamma P/\rho }\) is the sound speed, \(\alpha = (\Vert u\Vert +c)_{max}\) is the spectral radius of the Jacobian of the flux \({\mathbf {F}}\), and \(\mathrm {CFL}\) is the stable CFL number.

The positivity-preserving property for Eq. (19) refers to the fact that if \({\mathbf {Q}}_i^{n} \in {\mathbf {G}}_E\) then \({\mathbf {Q}}_i^{n+1} \in {\mathbf {G}}_E\). Since Eq. (19) can be rewritten as a convex combination

$$\begin{aligned} {\mathbf {Q}}_i^{n+1} = \frac{1}{2}({\mathbf {Q}}_i^{n} + 2\lambda \widehat{{\mathbf {F}}}_{i-1/2}) + \frac{1}{2}({\mathbf {Q}}_i^{n} - 2\lambda \widehat{{\mathbf {F}}}_{i+1/2}) = \frac{1}{2}{\mathbf {Q}}_i^{-} + \frac{1}{2}{\mathbf {Q}}_{i}^{+}, \end{aligned}$$
(21)

then a sufficient condition for positivity-preserving scheme is that \({\mathbf {Q}}_i^{\pm } \in {\mathbf {G}}_E\).

If the first order Lax–Friedrichs flux is used as the discretization of the finite difference numerical flux,

$$\begin{aligned} \widehat{{\mathbf {F}}}_{i+1/2}=\widehat{{\mathbf {F}}}_{i+1/2}^{LF} = \frac{1}{2}\left[ {\mathbf {F}}_{i}^n + {\mathbf {F}}_{i+1}^n - \alpha ({\mathbf {Q}}_{i+1}^{n}-{\mathbf {Q}}_{i}^{n}) \right] , \end{aligned}$$
(22)

in Eq. (21), then \({\mathbf {Q}}_i^{\pm } \in {\mathbf {G}}_E\) under the CFL condition \(\mathrm {CFL} \le \frac{1}{2}\) [9].

The key idea of the positivity-preserving limiter is to weight the high order flux with the first order Lax–Friedrichs flux at the locations where the density (pressure) is less than a user defined critical positive value \(\epsilon \), so that, in the worst case scenario, the final flux \(\widehat{{\mathbf {F}}}\) becomes the first order Lax–Friedrichs flux when \(\rho < \epsilon _{\rho }\) (\(P < \epsilon _P\)), and mimics a weighted high and low order fluxes, otherwise.

Positivity-Preserving Limiter

  1. 1.

    Initialize \(\theta ^+=\theta ^-=1\).

  2. 2.

    If \(\Phi ({\mathbf {Q}}_{i }^+)<\epsilon _{\Phi }\), set \(\theta ^+ = \left( {\Phi ({\mathbf {Q}}_{i }^{LF,+})-\epsilon _{\Phi }}\right) /\left( {\Phi ({\mathbf {Q}}_{i }^{LF,+})-\Phi ({\mathbf {Q}}_{i }^{+}) }\right) \).

  3. 3.

    If \(\Phi ({\mathbf {Q}}_{i+1}^-)<\epsilon _{\Phi }\), set \(\theta ^- = \left( {\Phi ({\mathbf {Q}}_{i+1}^{LF,-})-\epsilon _{\Phi }}\right) /\left( {\Phi ({\mathbf {Q}}_{i+1}^{LF,-})-\Phi ({\mathbf {Q}}_{i+1}^{-}) }\right) \).

  4. 4.

    Set \(\theta ^*=\min (\theta ^+,\theta ^-)\) and \(\widehat{{\mathbf {F}}}_{i+1/2}^*=(1-\theta ^*)\widehat{{\mathbf {F}}}_{i+1/2}^{LF}+\theta ^*\widehat{{\mathbf {F}}}_{i+1/2}\).

\(\Phi \) is either density \(\rho \) or pressure P. \(\epsilon _{\Phi }=\min (\epsilon _{\min }, \Phi _{\min })\), where \(\epsilon _{\min }\) (\(\epsilon _{\min } = 10^{-13}\) is used in this study) is an user defined minimum value and \(\Phi _{\min }\) is an user defined minimum density or pressure, which is often taken from the initial condition. \(\widehat{{\mathbf {F}}}_{i+1/2}^*\) is the limited flux, \(0 \le \theta ^{\pm } \le 1\) are the limiting factors corresponding to the two neighboring cells, which share the same flux \(\widehat{{\mathbf {F}}}_{i+1/2}\).

After applying the positivity-preserving flux limiter, Eq. (21) becomes

$$\begin{aligned} {\mathbf {Q}}_i^{n+1} = \frac{1}{2}\left( {\mathbf {Q}}_i^{n} + 2\lambda \widehat{{\mathbf {F}}}_{i-1/2}^* \right) + \frac{1}{2}\left( {\mathbf {Q}}_i^{n} - 2\lambda \widehat{{\mathbf {F}}}_{i+1/2}^* \right) = \frac{1}{2}{\mathbf {Q}}_i^{*,-} + \frac{1}{2}{\mathbf {Q}}_{i}^{*,+}, \end{aligned}$$
(23)

which can be proven that \({\mathbf {Q}}_{i}^{*,\pm } \in {\mathbf {G}}_E\) through the properties of Eqs. (17) and (18). Hence, we have \({\mathbf {Q}}_i^{n+1} \in {\mathbf {G}}_E\) and refer to [9] for details.

Remark 1

In practice, the density is positive-preserved first to obtain the limited \(\widehat{{\mathbf {F}}}_{i+1/2}^*\). Then the pressure is positivity-preserved afterward to update the limited flux \(\widehat{{\mathbf {F}}}_{i+1/2}^*\).

Also note that the limiter can be applied at each stage of the 3rd-order TVD Runge–Kutta method, which is a convex combination of Euler-forward time steps.

2.4 Positivity-/Bound-Preserving Limiter for Detonation Equations

The one-dimensional one-step reaction of the idea gas detonation equation is given by

$$\begin{aligned} {{\mathbf {Q}}}_t + \nabla \cdot {\mathbf {F}}({\mathbf {Q}}) = \mathbf {S}, \end{aligned}$$
(24)

with

$$\begin{aligned} {\mathbf {Q}}= \begin{bmatrix} \rho \\ \rho u\\ E \\ \rho f_1 \end{bmatrix}, {\mathbf {F}}= \begin{bmatrix} \rho u \\ \rho u^2+P\\ (E+P)u \\ \rho f_1 u \end{bmatrix}, \mathbf {S}= \begin{bmatrix} 0\\ 0\\ 0\\ \omega (T,f_1) \end{bmatrix}, \end{aligned}$$
(25)

are vectors of the conservative variables, flux and the source term respectively, where \(0 \le f_1 \le 1\) is the reactant mass fraction. The total specific energy E is given by

$$\begin{aligned} E = \frac{P}{\gamma -1} + \frac{1}{2}\rho u^2 + \rho f_1 q_0 , \end{aligned}$$
(26)

where \(q_0\) is the heat-release parameter. The source term \(\omega (T,f_1)\) due to the Arrhenius rate law is

$$\begin{aligned} \omega (T,f_1) = -K \rho f_1 e^{-{E_a}/T}, \end{aligned}$$
(27)

where \(T = P/(\rho R)\) is the temperature, R is the specific gas constant (with a suitable normalization, \(R=1\) in this study), \(E_a\) is the activation-energy parameter, and K is a pre-exponential factor that sets the spatial and temporal scales.

For the detonation equations, besides the positivity-preserving flux limiter, we shall focus here on the development of the bound-preserving flux limiter for the detonation equations due to the source term \(\mathbf {S}\) and the need to limit the mass fraction \(0 \le f_1 \le 1\).

Firstly, we define the operators \((\rho f_1)\) and \((\rho -\rho f_1)\) as

$$\begin{aligned} (\rho f_1)({\mathbf {Q}}) = \rho f_1, \quad (\rho -\rho f_1)({\mathbf {Q}}) = \rho -\rho f_1, \end{aligned}$$

and the set of admissible states as

$$\begin{aligned} {\mathbf {G}}_D= & {} \{ {\mathbf {Q}}= (\rho , m, E, \rho f_1)^T|\rho> 0, \quad 0\le f_1 \le 1, \quad \\ P= & {} (\gamma -1)\left( E-\frac{m^2}{2\rho }-\rho f_1 q_0\right) > 0 \}, \end{aligned}$$

in which \({\mathbf {G}}_D\) is a convex set.

Follow the similar procedure in Eq. (19), the conservative finite difference scheme for Eq. (25) can be written as

$$\begin{aligned} {\mathbf {Q}}_i^{n+1} = {\mathbf {Q}}_i^{n} + \lambda (\widehat{{\mathbf {F}}}_{i-1/2} - \widehat{{\mathbf {F}}}_{i+1/2}) + {\Delta t}\mathbf {S}= \frac{1}{2}\widetilde{{\mathbf {F}}} + \frac{1}{2}\widetilde{\mathbf {S}}, \end{aligned}$$
(28)

with

$$\begin{aligned} \widetilde{{\mathbf {F}}}= & {} {\mathbf {Q}}_i^n + 2\lambda (\widehat{{\mathbf {F}}}_{i-1/2}-\widehat{{\mathbf {F}}}_{i+1/2}) ,\nonumber \\ \widetilde{\mathbf {S}}= & {} {\mathbf {Q}}_i^n + 2{\Delta t}\mathbf {S}. \end{aligned}$$
(29)

Obviously, if \(\widetilde{{\mathbf {F}}} \in {\mathbf {G}}_D\) and \(\widetilde{\mathbf {S}} \in {\mathbf {G}}_D\), we can obtain \({\mathbf {Q}}_i^{n+1} \in {\mathbf {G}}_D\).

Lemma 2

If \({\mathbf {Q}}_i^{n} \in {\mathbf {G}}_D\) and the first-order Lax–Friedrichs flux (Eq. 22) is used in Eq. (28), then \({\mathbf {Q}}_i^{n+1} \in {\mathbf {G}}_D\) under the conditions of the time step \({\Delta t}= \frac{\mathrm {CFL}}{\alpha /{\Delta x}+ K}\) and \(\mathrm {CFL} \le \frac{1}{4}\).

Proof

Assuming \(\rho > 0\), one has

$$\begin{aligned} 0 \le f_1 \le 1 \Longleftrightarrow \rho f_1 \ge 0 \quad \mathrm {and}\quad \rho - \rho f_1 \ge 0. \end{aligned}$$
(30)

Hence, we only need to prove that \(\widetilde{{\mathbf {F}}} \in {\mathbf {G}}_D\) and \(\widetilde{\mathbf {S}} \in {\mathbf {G}}_D\).

For \(\widetilde{{\mathbf {F}}}\), we have

$$\begin{aligned} \widetilde{{\mathbf {F}}}= & {} {\mathbf {Q}}_i^n + 2\lambda \left( \widehat{{\mathbf {F}}}_{i-1/2}^{LF}-\widehat{{\mathbf {F}}}_{i+1/2}^{LF}\right) \\= & {} \frac{1}{2}\left( {\mathbf {Q}}_i^n + 4\lambda \widehat{{\mathbf {F}}}_{i-1/2}^{LF}\right) + \frac{1}{2}\left( {\mathbf {Q}}_i^n - 4\lambda \widehat{{\mathbf {F}}}_{i+1/2}^{LF}\right) \\= & {} \frac{1}{2}\left( {\mathbf {Q}}_i^{-} + {\mathbf {Q}}_i^{+}\right) . \end{aligned}$$

By defining \(\alpha = (\Vert u\Vert +c)_{max}\), \({\mathbf {Q}}_i^{-}\) can be reformulated as

$$\begin{aligned} {\mathbf {Q}}_i^{-}= & {} {\mathbf {Q}}_i^n + 4\lambda \widehat{{\mathbf {F}}}_{i-1/2}^{LF} = {\mathbf {Q}}_i^n + 2\lambda [{\mathbf {F}}_{i-1}^n + {\mathbf {F}}_i^n + \alpha ({\mathbf {Q}}_{i-1}^n-{\mathbf {Q}}_i^n)] \\= & {} (1-4\mathrm {CFL}){\mathbf {Q}}_i^n + 2\mathrm {CFL}\left( {\mathbf {Q}}_{i-1}^n + \frac{1}{\alpha }{\mathbf {F}}_{i-1}^n\right) + 2\mathrm {CFL}\left( {\mathbf {Q}}_i^n + \frac{1}{\alpha }{\mathbf {F}}_i^n\right) . \end{aligned}$$

If \(\mathrm {CFL} \le \frac{1}{4}\), \({\mathbf {Q}}_i^{-}\) is the convex combination of the three vectors \({\mathbf {Q}}_i^n\), \({\mathbf {Q}}_{i-1}^n + \frac{1}{\alpha }{\mathbf {F}}_{i-1}^n\) and \({\mathbf {Q}}_{i}^n + \frac{1}{\alpha }{\mathbf {F}}_{i}^n\). We only need to show that \({\mathbf {Q}}_{i}^n + \frac{1}{\alpha }{\mathbf {F}}_{i}^n \in {\mathbf {G}}_D\).

Due to \({\mathbf {Q}}^n \in {\mathbf {G}}_D\), dropping the subscripts and superscripts, we can prove \(\rho ({\mathbf {Q}}\pm \frac{1}{\alpha }{\mathbf {F}}) > 0\), \((\rho f_1)({\mathbf {Q}}\pm \frac{1}{\alpha }{\mathbf {F}}) \ge 0\) and \((\rho - \rho f_1)({\mathbf {Q}}\pm \frac{1}{\alpha }{\mathbf {F}}) \ge 0\). For \(P({\mathbf {Q}}\pm \frac{1}{\alpha }{\mathbf {F}})\), we use the following procedure

$$\begin{aligned} P\left( {\mathbf {Q}}\pm \frac{1}{\alpha }{\mathbf {F}}\right)= & {} P\left[ \left( (1\pm \frac{u}{\alpha })\rho , (1\pm \frac{u}{\alpha })m\pm \frac{1}{\alpha }P, (1\pm \frac{u}{\alpha })E\pm \frac{u}{\alpha }P, (1\pm \frac{u}{\alpha })\rho f_1 \right) ^\mathrm {T}\right] \\= & {} \left( 1-\frac{P}{\rho }\frac{\gamma -1}{2(\alpha \pm u)^2}\right) \left( 1\pm \frac{u}{\alpha }\right) P, \end{aligned}$$

therefore,

$$\begin{aligned} P\left( {\mathbf {Q}}\pm \frac{1}{\alpha }{\mathbf {F}}\right) > 0 \Longleftrightarrow \frac{P}{\rho }\frac{\gamma -1}{2(\alpha \pm u)^2}< 1 \Longleftrightarrow \sqrt{\gamma \frac{P}{\rho }} < \sqrt{\frac{2\gamma }{\gamma -1}}(\alpha \pm u). \end{aligned}$$

Since \(\alpha =(\Vert u\Vert +c)_{max}\) and \(c=\sqrt{\frac{\gamma P}{\rho }}\), we have \(P({\mathbf {Q}}\pm \frac{1}{\alpha }{\mathbf {F}}) > 0\). Using the relation of Eq. (30), we obtain \({\mathbf {Q}}_i^{-} \in {\mathbf {G}}_D\). By the similar procedure, \({\mathbf {Q}}_i^{+} \in {\mathbf {G}}_D\) can be proved. Therefore, \(\widetilde{{\mathbf {F}}} \in {\mathbf {G}}_D\) is satified.

For \(\widetilde{\mathbf {S}}\), \(\rho (\widetilde{\mathbf {S}}) > 0\), \((\rho f_1)(\widetilde{\mathbf {S}}) \ge 0\) and \((\rho -\rho f_1)(\widetilde{\mathbf {S}}) \ge 0\) under the condition \({\Delta t}\le \frac{1}{2K}\). Here, we check that \(P(\widetilde{\mathbf {S}}) > 0\),

$$\begin{aligned} P(\widetilde{\mathbf {S}})= & {} (\gamma -1)\left[ E - \frac{1}{2}\frac{m^2}{\rho } - \rho f_1(1-2{\Delta t}K e^{-E_a/T})q_0\right] \\= & {} P + 2(\gamma -1){\Delta t}Ke^{-E_a/T}\rho f_1q_0 > 0, \end{aligned}$$

because of \({\mathbf {Q}}^n \in {\mathbf {G}}_D\). Again, using the relation of Eq. (30), we have \(\widetilde{\mathbf {S}} \in {\mathbf {G}}_D\).

With the Lemma 2, the bound-preserving flux limiter is same to the positivity-preserving flux limiter when applied to \(\Phi =\rho f_1\) and \(\Phi =\rho -\rho f_1\) and \(\epsilon _{\Phi } = 0\). \(\square \)

2.5 Positivity-Preserving Hybrid-CUW5 Scheme

Now, together with all the numerical algorithms (the CUW5 scheme, WENO-Z5 scheme and positivity- and bound-preserving limiter), we have all the tools to build the positivity- and bound-preserving Hybrid-CUW5 scheme. For the detailed framework of the hybrid scheme, see [4, 5, 14] and references therein.

Algorithm 1 (Positivity- and bound-preserving Hybrid-CUW5 scheme):

  1. 1.

    Perform the multi-resolution analysis [4] (6th order used in this study) on one or more suitable variable(s) (Typically, density \(\rho \)) once at the beginning of the Runge-Kutta method.

  2. 2.

    Set a MR flag, based on the MR coefficients \(d_i\), at a grid point \(x_i\) as

    $$\begin{aligned} \text{ Flag }_i = \left\{ \begin{array}{ccr} 1, &{} |d_i| > \epsilon _{MR} &{} (\text{ non-smooth } \text{ stencil }), \\ 0, &{} \text{ otherwise } &{} (\text{ smooth } \text{ stencil }), \end{array} \right. \quad \end{aligned}$$
    (31)

    where \(\epsilon _{MR}\) is a user tunable parameter.

  3. 3.

    Create a buffer zone around each grid point \(x_i\) such that all the grid points inside the buffer zone are flagged as non-smooth stencils. If, for example, a grid point \(x_i\) is flagged as a non-smooth stencil, then its neighboring grid points \(\{x_{i-m}, \ldots , x_i, \ldots ,x_{i+m}\}\) will also be designated as non-smooth stencils that is, \(\{\text{ Flag }_j = 1, j = i-m,\ldots ,i,\ldots ,i+m \}\). (Typically, \(m=r\).)

  4. 4.

    Construct the numerical fluxes \(\widehat{{\mathbf {F}}}_{i+1/2}\) at each cell boundary by

    • (Non-smooth WENO subdomain): the WENO-Z5 scheme.

    • (Smooth Compact subdomain): the CUW5 scheme.

  5. 5.

    Modify the numerical fluxes \(\widehat{{\mathbf {F}}}_{i+1/2}\) by the positivity-preserving flux limiter. In case of detonation equations, the bound-preserving limiter will be applied after the positivity-preserving limiter.

  6. 6.

    Compute the derivative of numerical flux and update the resulting ODEs after spatial discretization by 3rd-order TVD Runge-Kutta method.

Remark 3

The global Lax–Friedrichs flux splitting is used in the WENO-Z5 scheme in order to be consistent with the numerical flux used in the CUW5 scheme. Also, it is easy to extend the Hybrid-CUW5 scheme to a multi-dimensional problem through a dimension-in-dimension procedure.

3 Numerical Results and Discussion

In this section, some numerical results are presented to validate the accuracy and efficiency of the Hybrid-CUW5 scheme. Similar results of the WENO-Z5 and Hybrid-CCD6 schemes are observed, if there is any, and hence, they are omitted in this paper. We first validate the Hybrid-CUW5 scheme by solving the one-dimensional scalar linear wave equation and show that the expected order of accuracy is achieved. Next, we apply the Hybrid-CUW5 scheme to one-dimensional Mach 3 shock-density/entropy problems and two-dimensional shock-turbulence problem, Mach 10 double Mach reflection problem and compare the results with those computed by the pure WENO-Z5 scheme and Hybrid-CCD6 scheme. The one-dimensional Riemann problems and several extreme condition problems are also simulated for demonstrating the performance of the Hybrid-CUW5 scheme. Finally, we show the behaviors of the positivity- and bound-preserving limiter of the Hybrid-CUW5 scheme by simulating the Mach 2000 jet problem, detonation shock diffraction problems with \(90^{\circ }\), and \(180^{\circ }\) diffraction angles and multiple obstacles problem, which can not be solved by the pure WENO-Z5 scheme and Hybrid-CCD6 scheme.

3.1 One-Dimensional Problems

3.1.1 Accuracy Test of the Hybrid-CUW5 Scheme

Consider the one-dimensional scalar linear wave equation,

$$\begin{aligned}&Q_t + Q_x = 0, \quad x \in [0,2], \\&Q(x,t=0)=1+0.1\mathrm {sin}(\pi x), \end{aligned}$$

which have the exact solution \(Q(x,t)=1+0.1\mathrm {sin}(\pi (x-t))\). The final time is \(t=2\). The \(L_2\) and \(L_\infty \) errors of the WENO-Z5 scheme and the Hybrid-CUW5 scheme along with the rate of convergence are shown in Table 1. From the table, we can observe that the WENO-Z5 scheme and the Hybrid-CUW5 scheme converge at a rate of 5th-order which agrees well with the analytical analysis. As expected, the errors computed by the Hybrid-CUW5 method are about ten times smaller than those computed by the WENO-Z5 schemes.

Table 1 The accuracy test

3.1.2 One-Dimensional Riemann Initial Value Problems

The classical Riemann initial value problems (123, Sod and Lax problems) are often used to demonstrate the singularities (contact wave, rarefaction wave and shock wave) capturing capability of a nonlinear shock capturing scheme. The corresponding density profiles and WENO flags computed by the Hybrid-CUW5 scheme using \(N=200\) are shown in Fig. 3, which are in a good agreement with the exact solutions. See [2] for the description of each problem.

Fig. 3
figure 3

(Color online) The density profiles and WENO flags of the one-dimensional 123, Sod, and Lax problems with \(N=200\)

Fig. 4
figure 4

(Color online) (Left) The density and WENO flag of the shock-density wave interaction problem computed by the Hybrid-CUW5 scheme at times \(t= 2.5\) and (Middle) \(t= 5\) and (Right) the high frequency density waves computed by the Hybrid-CUW5 scheme, the Hybrid-CCD6 scheme and the WENO-Z5 scheme with the resolution \(N=800\) in the interval [9, 12] at time \(t=5\)

3.1.3 Mach 3 Shock-Density Wave Interaction

In order to investigate the abilities of the Hybrid-CUW5 scheme in solving the Euler equations in a strong nonlinear regime that generates both large fine scale structures and localized shocklets, we solve the one-dimensional Mach 3 shock-density wave interaction problem [12] with an enlarged domain until the final time \(t=5\). The initial condition is

$$\begin{aligned} (\rho , u, P) = \left\{ \begin{array}{ll} \left( \frac{27}{7} , \frac{4 \sqrt{35}}{9},\frac{31}{3}\right) ,&{}\quad -5 \le x < x_0, \\ ( 1+\varepsilon \sin (kx), 0, 1),&{}\quad x_0 \le x \le 15, \end{array} \right. \end{aligned}$$

where \(x \in \left[ -5,15 \right] \), \(\varepsilon =0.2\), \(x_0=-4\) and \(k=5\).

In this case, we use \(\epsilon _{MR}=4 \times 10^{-3}\) and \(N=800\) uniformly spaced grid points. Since there is no exact solution for this problem, the numerical solution computed by the WENO-Z5 scheme with \(N=4000\) grid points is used as the reference solution. In the left and middle figures of Fig. 4, the density and WENO flag computed by the Hybrid-CUW5 scheme at times \(t=2.5\) and \(t=5\) are shown, respectively. The results indicate that the shock and the developing shocklets are well captured essentially non-oscillatory by the WENO-Z5 scheme while the fine scale structures are well resolved by the CUW5 scheme. Moreover, we find that there are some developing “shocklets” not captured by the WENO-Z5 scheme. However, there are no oscillations generated in these positions, this is due to the inherent dissipation mechanism of the CUW5 scheme. This phenomenon confirms the robustness of the Hybrid-CUW5 scheme. The right figure of Fig. 4 shows that the high frequency density waves behind the shock as computed by the WENO-Z5 scheme, the Hybrid-CCD6 scheme and the Hybrid-CUW5 scheme. As shown in the figures, the hybrid schemes have an overall better resolution than the WENO-Z5 scheme in resolving the spatially and temporally evolving high frequency density waves generated by the strong nonlinear interaction between the main shock and a small upstream density perturbation.

3.1.4 Mach 3 Shock-Entropy Wave Interaction

The goal of the hybrid scheme is to take advantage of the superior properties of the CUW5 scheme in capturing small scale smooth structures in the smooth stencils. To show this, we will employ the Hybrid-CUW5 scheme to solve a right moving Mach 3 shock interacting with a small amplitude sinusoidal perturbation of the entropy in the pre-shock region. The initial condition is

$$\begin{aligned} (\rho , u, P) = \left\{ \begin{array}{ll} \left( \frac{27}{7}, \frac{4 \sqrt{35}}{9} , \frac{31}{3}\right) ,&{}\quad x \le x_0, \\ (\exp (-\varepsilon \sin (k(x+x_0)), 0,1),&{}\quad x > x_0 , \end{array} \right. \end{aligned}$$

where \(x \in \left[ -10,10 \right] \), \(\varepsilon =0.01\), \(x_0=-9.5\) and \(k=13\).

The numerical solution computed by the WENO-JS9 scheme with \(N=10240\) grid points is used as the reference solution in this example. Since the amplitude of perturbation is small (\(\varepsilon =0.01\)), the solution of the Euler equations is dominated by those in the weak nonlinear regime. The entropy consists of a small amplitude high frequency wave train traveling to the left of the main shock wave. In the left figure of Fig. 5, we show the entropy and the WENO flag at time \(t=5\). The high and low frequency entropy waves behind and in front of the main shock, respectively, are well resolved by the CUW5 scheme. The multi-resolution tolerance used here is \(\epsilon _{MR}=4 \times 10^{-3}\). In the middle and right figures of Fig. 5, the close-up view of entropy as computed by the WENO-Z5 scheme and the two hybrid schemes with a resolution (\(N=1500\)) are shown. It is clear from the evolution of the small amplitude high frequency entropy waves behind the main shock that the hybrid schemes have much reduced dissipation and dispersion errors at this resolution. In contrary, the high frequency entropy waves is being severely dampened by the numerical dissipation of the WENO-Z5 scheme. We can also find that the dissipation and dispersion errors of the Hybrid-CUW5 scheme is slightly better than the Hybrid-CCD6 scheme.

Fig. 5
figure 5

(Color online) (Left) The entropy and WENO flag computed by the Hybrid-CUW5 scheme and (Middle and Right) Close-up view of entropy computed by the WENO-CUW5 scheme, the Hybrid-CCD6 scheme and the WENO-Z5 scheme with the resolution \(N=1500\) for the shock-entropy wave interaction problem at time \(t=5\)

In Table 2, we show the CPU timing of and speedup, for the shock-density and shock-entropy problems at the final time \(t=5\). As expected, the hybrid schemes are faster than the pure WENO-Z5 scheme in these two examples. Furthermore, a factor of almost two have been observed in the speedup of the Hybrid-CUW5 scheme over the WENO-Z5 scheme under the same resolution. And as expected, it is about two times slower than the Hybrid-CCD6 scheme. It is because the CUW5 scheme must reconstruct the numerical fluxes in both the “+” and “−” directions while the CCD6 scheme compute the derivative of flux directly.

Table 2 The CPU timing of and speedup (sp) among the WENO-Z5 scheme and the hybrid schemes for the shock-density problem and shock-entropy problem

3.1.5 One-Dimensional Extreme Condition Problems

In this section, we consider several extreme condition problems, including the one-dimensional shock-tube problems involving strong shocks and near vacuum states, the double rarefaction problem, Sedov blast-wave problem [25], two blast-waves interaction problem, and LeBlanc problem [9]. Here, the results computed by the Hybrid-CUW5 scheme are plotted in Fig. 6, and compared to the exact or published results in [9, 25]. We note that, the positivity-preserving limiter in the Hybrid-CUW5 scheme are not switched on in any of these problems.

Fig. 6
figure 6

The density of the one-dimensional Riemann IVP with extreme condition

3.2 Two-Dimensional Problems

3.2.1 Accuracy Test of the Hybrid-CUW5 Scheme

We use the following two-dimensional problem [10] to test the accuracy of the Hybrid-CUW5 scheme. The mean flow is \(\rho = 1\), \(P=1\), and \((u,v)=(1,1)\) (diagonal flow). We add to this mean flow an isentropic vortex, that mean perturbations in (uv) and the temperature \(T=P/\rho \), no perturbation in the entropy \(S=P/\rho ^\gamma \):

$$\begin{aligned} (\delta u, \delta v)= & {} \frac{\epsilon }{2\pi }e^{0.5(1-r^2)}(-\bar{y}, \bar{x})\\ \delta T= & {} -\frac{(\gamma -1)\epsilon ^2}{8\gamma \pi ^2}e^{1-r^2}, \quad \delta S = 0, \end{aligned}$$

where \((\bar{x},\bar{y})=(x-5,y-5)\), \(r^2 = \bar{x}^2+\bar{y}^2\), and the vortex strength \(\epsilon =5\). The computational domain is \((x,y) \in [0,10]\times [0,10]\). The exact solution of this example is just the passive convection of the vortex with the mean velocity, so the exact boundary condition is imposed on the x and y directions respectively. The final time is \(t=2\).

The \(L_2\) and \(L_\infty \) errors of the WENO-Z5 scheme and the Hybrid-CUW5 scheme along with the rate of convergence are shown in Table 3. It is observed that the Hybrid-CUW5 scheme can converge to the optimal 5th-order faster than WENO-Z5 scheme, and the errors computed by the Hybrid-CUW5 method are smaller than those computed by the WENO-Z5 schemes.

Table 3 The accuracy test of 2D scheme
Fig. 7
figure 7

(Color online) (Left) The density and (Right) velocity of the shock-turbulence test computed by the Hybrid-CUW5 scheme with \(N_x\times N_y=120\times 80\) and the WENO-Z5 scheme with \(N_x\times N_y=960\times 640\) at time \(t=0.2\)

3.2.2 Two-Dimensional Shock–Turbulence Problem

In this example, we test the performance of the Hybrid-CUW5 scheme on the two-dimensional shock–turbulence problem with the initial condition

$$\begin{aligned} (\rho , u, v, P) = \left\{ \begin{array}{ll} {\mathbf {Q}}_1, &{}\quad x \ge -1, \\ {\mathbf {Q}}_2, &{}\quad x < -1, \end{array} \right. \end{aligned}$$

with

$$\begin{aligned} {\mathbf {Q}}_1 = \begin{bmatrix} 1 \\ -\sqrt{\gamma }\mathrm {sin}(\theta )\mathrm {cos}(xk\mathrm {cos}(\theta )+yk\mathrm {sin}(\theta )) \\ \sqrt{\gamma }\mathrm {cos}(\theta )\mathrm {cos}(xk\mathrm {cos}(\theta )+yk\mathrm {sin}(\theta )) \\ 1 \end{bmatrix},\quad {\mathbf {Q}}_2 = \begin{bmatrix} \frac{(\gamma +1)M^2}{2+(\gamma -1)M^2} \\ \frac{2\sqrt{\gamma }(M^2-1)}{M(\gamma +1)} \\ 0 \\ 1+\frac{2\gamma (M^2-1)}{\gamma +1} \end{bmatrix}, \end{aligned}$$

where \(k=2\pi \), \(\theta =\pi /6\) and Mach number \(M=8\). The computational domain is \((x,y)\in [-1.5,1.5]\times [-1,1]\), with the fixed border in x-direction and periodic boundary condition in y-direction. The final time is \(t=0.2\). \(\epsilon _{MR}=1.0\times 10^{-2}\) is used in this example.

The color contours of density and velocity computed by the Hybrid-CUW5 scheme with \(N_x\times N_y=120\times 80\) grids and a reference solution computed by the WENO-Z5 scheme with \(N_x\times N_y=960\times 640\) grids are shown in Fig. 7. In [15], Pirozzoli mentioned that the reference solution consists of a set of acoustic waves moving to the left with respect to the shock wave and a set of vorticity and entropy waves moving more slowly; the two regions are separated by a rather sharp interface, which is clearly observed in the figure at \(x\approx 0.55\). It is not difficult to find that the Hybrid-CUW5 scheme correctly capture the salient features of the flow. In particular, the acoustic waves, which are associated with longer wavelengths, are well captured even on the coarse mesh. In order to analyze the differences in detail, we draw the density and velocity at the line \(y=0\) computed by the WENO-Z5 scheme and two hybrid schemes in Fig. 8. The results computed by the three schemes are very similar and they capture the large scale structures accurately.

Fig. 8
figure 8

(Color online) (Left) The density and (Right) velocity at the line \(y=0\) of the shock-turbulence test computed by the WENO-CUW5 scheme, the Hybrid-CCD6 scheme and the WENO-Z5 scheme with the resolution \(N_x\times N_y=120\times 80\) at time \(t=0.2\)

Fig. 9
figure 9

(Left) The contour lines of density and (Right) Close-up view of density of the DMR problem as computed by the Hybrid-CUW5 scheme at time \(t=0.2\)

3.2.3 Two-Dimensional Double Mach Reflection Problem

In the two-dimensional double Mach reflection (DMR) problem [21], a Mach 10 normal shock wave impinges onto a wedge with a given angle of inclination. By changing the frame of reference to the surface of the wedge, we setup the computational domain as \((x,y)\in \left[ 0,4\right] \times \left[ 0,1\right] \). The Mach 10 oblique shock makes contact with the lower domain boundary at a \(60^\circ \) angle with the horizontal x-axis. The initial condition is

$$\begin{aligned} \left( \rho ,u,v,P\right) =\left\{ \begin{array}{ll} \left( 8 , 8.25 \cos \theta ,- 8.25\sin \theta , 116.5 \right) , &{}\quad x<x_0+y/\sqrt{3}, \\ \left( 1.4, 0 , 0, 1 \right) , &{}\quad x\ge x_0+y/\sqrt{3}, \end{array} \right. \end{aligned}$$

with \(x_0=\frac{1}{6}\) and \(\theta = \pi /6\). The supersonic inflow and free-stream outflow boundary conditions are specified at \(x=0\) and \(x=4\), respectively. At the lower boundary \(y=0\), the reflective boundary conditions are applied in the interval \(\left[ x_0,4\right] \). At the upper boundary \(y=1\), the exact solution of the Mach 10 moving oblique shock is imposed.

The density contour lines computed by the Hybrid-CUW5 scheme with \(\epsilon _{MR}=1.0\times 10^{-2}\) and resolution \(N_x\times N_y=800 \times 200\) uniform cells at time \(t=0.2\) are shown in the left figure of Fig. 9 which reach a good agreement with those in [21]. We demonstrate the small scale structures (for example, the small vortical rollups along the slip line and the large mushroom shaped vortical rollup at the tip of the jet) around the region \(x \in [2,2.9]\) behind the incident shock in the right figure of Fig. 9.

In Table 4, we give the CPU timing of and speedup for the shock-turbulence problem and DMR problem which are computed by the WENO-Z5 scheme, the Hybrid-CCD6 scheme and the Hybrid-CUW5 scheme. The table shows that the hybrid schemes are more efficient than the WENO-Z5 scheme. A factor of almost three times in speedup can be achieved with the corresponding resolutions for the Hybrid-CCD6 scheme and about two times for the Hybrid-CUW5 scheme.

Table 4 The CPU timing of and speedup (sp) among the WENO-Z5 scheme and the hybrid schemes for the shock-turbulence and DMR problems
Fig. 10
figure 10

(Color online) Mach 2000 jet problem. (Left) The density and (Right) pressure computed by the Hybrid-CUW5 scheme at time \(t=0.001\)

3.2.4 Mach 2000 Jet Flows

We consider the Mach 2000 jet problem, which has been simulated in Zhang et al. [22, 25] with the high order positivity-preserving DG method and WENO scheme. The computation is performed on the domain \((x,y)\in [0,1]\times [-0.25,0.25]\). Initially, the entire domain is filled with ambient gas with \((\rho , u, v, P) = (0.5, 0, 0, 0.4127)\). An outflow condition is applied at the right, upper and the lower boundaries, and an inflow condition is imposed on the left boundary with states \((\rho , u, v, P) = (0.5, 800, 0, 0.4127)\) if \(|y|<0.05\) and \((\rho , u, v, P) = (0.5, 0, 0, 0.4127)\) otherwise. The final time is 0.001. The resolution is \(N_x\times N_y=800 \times 400\) uniform cells. Since \( \gamma = \frac{5}{3}\) is used, the speed of the jet is 800 which results in Mach 2100 with respect to the sound speed in the jet gas. \(\epsilon _{MR}=1.0\times 10^{-3}\) is used in the Hybrid-CUW5 scheme. Fig. 10 shows the color contours of density and pressure in logarithmic scale computed by the Hybrid-CUW5 scheme. One can observe that these results are in a very good agreement with those in [22, 25]. To investigate the performance of the positivity- and bound-preserving limiter in the Hybrid-CUW5 scheme, a function \(PP_{Limiter}(f,t)\) is defined as

$$\begin{aligned} PP_{Limiter}(f,t) = \frac{N}{N_x\times N_y} 100\%, \end{aligned}$$
(32)

where f could be \(\rho \), P or \(f_1\) and N is the total number of grid points where the limiter is activated. In Fig. 11, we plot the temporal evolution of PP limiter of physical variables (density and pressure) and the locations (in the red boxes) where the positivity-preserving limiter are used in the Hybrid-CUW5 scheme at time \(t=0.001\). Only the pressure limiter is switched and the density is always positive in this example. Furthermore, the percentage of limiters slightly oscillates around 0.15% after the time \(t=4.0\times 10^{-4}\) as the solution becomes self-similar without much change in the later time.

Fig. 11
figure 11

(Color online) Mach 2000 jet problem. (Left) The temporal evolution PP limiter of density and pressure in the Hybrid-CUW5 scheme and (Right) locations of positivity-preserving limiter used in the Hybrid-CUW5 scheme at time \(t=0.001\)

3.2.5 Detonation Diffraction Problems

Here, the detonation diffraction phenomena passing around an obstacle with angles \(90^\circ \) and \(180^\circ \) are simulated to demonstrate the performance of the Hybrid-CUW5 scheme. It is numerically challenging especially for the high order schemes because the pressure and density will drop very close to zero when the shock wave is diffracted around an obstacle. The initial condition is

$$\begin{aligned} \left( \rho ,u,v,P,f_1\right) =\left\{ \begin{array}{ll} \left( 11, 6.18, 0, 970, 1 \right) , &{}\quad x < L_s, \\ \left( 1, 0, 0, 55, 1 \right) , &{}\quad \mathrm {otherwise}, \end{array} \right. \end{aligned}$$

where the \(L_s\) is the initial shock location. The related parameters in (25) are \(\gamma =1.2\), \(q_0=50\), \(E_a=50\), \(K=2566.4\). \(\epsilon _{MR}=1.0\times 10^{-2}\) is used in the Hybrid-CUW5 scheme.

  • \(90^\circ \) corner

    The physical domain is set to be \((x,y)=[0,5]\times [0,5]\). The initial shock location is \(L_s=0.5\). The obstacle area is \((x,y)\in [0,1]\times [0,2]\). The boundary conditions are reflective except that at \(x=0\), \(\left( \rho ,u,v,P,f_1\right) =\left( 11, 6.18, 0, 970, 1 \right) \). The uniform cells used are \(N_x\times N_y = 400\times 400\). The final time is \(t=0.6\). The color contours of density and pressure computed by the Hybrid-CUW5 scheme at time \(t=0.6\) are demonstrated in Fig. 12, which are comparable to those in [25]. One can find that the density becomes very small when the flow expands around the corner and is well resolved by the Hybrid-CUW5 scheme.

  • \(180^\circ \) corner

    The physical domain is set to be \((x,y)\in [0,6]\times [0,5]\). The initial shock location is \(L_s=1\) The obstacle area is \((x,y)=[0,1.5]\times [2,2]\). The boundary conditions are reflective except that at (\(x=0\) and \(y>2\)), \(\left( \rho ,u,v,P,f_1\right) =\left( 11, 6.18, 0, 970, 1 \right) \). The uniform cells used are \(N_x\times N_y = 480\times 400\). The final time is \(t=0.68\). In Fig. 13, we show the color contours of density and pressure computed by the Hybrid-CUW5 scheme at time \(t=0.68\). The corresponding temporal evolution PP limiter of physical variables (density, pressure and mass fraction) in the Hybrid-CUW5 scheme and locations of positivity- and bound-preserving limiter used in the Hybrid-CUW5 scheme at the final times are shown in Fig. 14. One can easily find that the positivity-preserving limiter is used in the pressure and the bound-preserving limiter is used in the mass fraction when \(f_1\le 1\) respectively.

Fig. 12
figure 12

(Color online) Detonation diffraction problems with \(90^{\circ }\) corner. (Left) The density and (Right) pressure computed by the Hybrid-CUW5 scheme with the resolution \(N_x\times N_y = 400\times 400\) at time \(t=0.6\)

Fig. 13
figure 13

(Color online) Detonation diffraction problems with \(180^{\circ }\) corner. (Left) The density and (Right) pressure computed by the Hybrid-CUW5 scheme with the resolution \(N_x\times N_y = 480\times 400\) at time \(t=0.68\)

Fig. 14
figure 14

(Color online) Detonation diffraction problems with (Top) \(90^{\circ }\) corner and (Bottom) \(180^{\circ }\) corner. The temporal evolution of PP limiter of (Left) density and pressure, (Middle) mass fraction in the Hybrid-CUW5 scheme and (Right) locations of PP limiter used in the Hybrid-CUW5 scheme at time \(t=0.68\)

Fig. 15
figure 15

(Color online) Multiple obstacles problems. (Left) Density and (Right) pressure computed by the Hybrid-CUW5 scheme with the resolution \(N_x\times N_y = 332\times 400\) at time \(t=1.4\)

3.2.6 Multiple Obstacles Problems

Finally, we consider a more challenging example which is the detonation wave passing multiple rectangular obstacles. The computational domain is \((x,y)\in [0,8.3] \times [0,10]\). The initial condition is

$$\begin{aligned} \left( \rho ,u,v,E,f_1\right) =\left\{ \begin{array}{ll} \left( 7, 0, 0, 200, 0 \right) , &{}\quad x^2 + y^2 \le 0.36, \\ \left( 1, 0, 0, 55, 1 \right) , &{}\quad \mathrm {otherwise}, \end{array} \right. \end{aligned}$$

where the location of the first obstacle is \([1.3,3.3] \times [0,2.6]\) and the second one is \([5.1,8.3] \times [0,4.3]\). The terminal time is \(t=1.4\). The reflective boundary conditions are imposed on surface of the obstacles. The related parameters in (25) are \(\gamma =1.2\), \(q_0=50\), \(E_a=20\), \(K=2410.2\). \(\epsilon _{MR}=1.0\times 10^{-2}\) is used in the Hybrid-CUW5 scheme.

The color contours of density and pressure computed by the Hybrid-CUW5 scheme at the final time are demonstrated in Fig. 15, which are comparable to those in [20]. The corresponding temporal evolution of PP limiter of the physical variables (density and pressure and mass fraction) and locations of PP limiter used in the Hybrid-CUW5 scheme at the final time are shown in Fig. 16.

Fig. 16
figure 16

(Color online) Multiple obstacles problems. The temporal evolution of PP limiter of (Left) density and pressure, (Middle) mass fraction in the Hybrid-CUW5 scheme and (Right) locations of PP limiter used in the Hybrid-CUW5 scheme at time \(t=1.4\)

We show the CPU timing of and speedup in Table 5 for the Mach 2000 jet problem and detonation diffraction problems and multiple obstacles problem which are computed by the WENO-Z5 scheme with the positivity-preserving limiter and the Hybrid-CUW5 scheme. The pure WENO-Z5 and Hybrid-CCD6 schemes fail due to negative density and/or pressure, so the corresponding computational time is not available. A factor of more than 1.5 in speedup can be observed with the mesh resolutions for the Hybrid-CUW5 scheme over the WENO-Z5 scheme. For clarity, we refer to the WENO flags in the x- and y-directions as \(Flag_x\) and \(Flag_y\) respectively and display them in Appendix A which shows that the shock locations can be captured well by the WENO-Z5 scheme.

Table 5 The CPU timing of and speedup (sp) between the WENO-Z5 scheme with the PP limiter and the Hybrid-CUW5 scheme for the Mach 2000 problems, detonation diffraction problems and multiple obstacles problem

4 Conclusion

In this study, we construct a hybrid (Hybrid-CUW5) scheme by conjugating the 5th-order conservative compact upwind compact finite difference (CUW5) scheme and 5th-order improved characteristic-wise weighted essentially non-oscillatory (WENO-Z5) finite difference scheme for the compressible Euler equations. The Hybrid-CUW5 scheme employs the nonlinear WENO-Z5 scheme to capture high gradients and discontinuities in an essentially non-oscillatory manner and the linear CUW5 scheme to resolve the fine scale structures in the smooth regions of the solution in an efficient and accurate manner. The numerical oscillations generated by coupling different schemes are mitigated by the CUW5 scheme which also show a better resolution properties than the 6th-order compact central finite difference scheme. Furthermore, we develop a positivity- and bound-preserving limiter for the Hybrid-CUW5 scheme in simulating the Mach 2000 jet problem, detonation diffraction problems and multiple obstacles problem which can not be solved by the pure WENO-Z5 scheme and Hybrid-CCD6 scheme [5]. The corresponding results show that only few of locations need the positivity- and bound-preserving limiter in the pressure and mass fraction. The numerous one- and two-dimensional examples show that the Hybrid-CUW5 scheme allows a potential speedup up to a factor of more than 1.5, and less dispersive and less dissipative than the WENO-Z5 scheme under the specific mesh resolutions. The idea of the Hybrid-CUW5 scheme can be easily extended to other high order compact upwind finite difference schemes and similar research areas, for example, shallow water equations.