Introduction

The surface of the earth is not a flat plane. The irregular surface could distort the recorded data significantly. It also brings new challenge to seismic exploration. Numerical simulations with the surface topography describe more realistic seismic wave propagation. Thus, it is critically useful to study a numerical simulation method that considers the irregular topography.

To incorporate the irregular topography, the numerical methods based on the weak form of wave equation are commonly used. For example, Komatitsch and Tromp (1999) presented seismic wave field simulation with a relief surface by utilizing spectral element method. They discussed disturbance caused by the irregular topography. Finite element method and finite volume method are mostly used in the frequency domain to study seismic wave propagation with irregular topography (Jang et al. 2008; Brossier et al. 2008). Another important approach is to use the strong form of wave equation, such as the finite difference method. Compared with the finite difference method, the finite element method requires high-quality unstructured mesh, which is difficult for a complicated near surface. Moreover, the finite difference method is relatively cheaper in the aspect of computational cost compared to the finite element method.

Most of the methods for finite difference modeling with irregular topography are developed in the time domain, while an implementation in the frequency domain is relatively rare. To implement the irregular topography in the frequency domain, an accurate and stable numerical scheme for the frequency-domain elastic-wave equation discretization is necessary. Chen and Cao (2016) developed an average-derivative optimal method for modeling frequency-domain 2D elastic-wave equation. This method has the advantages of memory saving and arbitrary directional sampling intervals, which can reduce the computational cost of the frequency-domain elastic-wave modeling. However, only the flat free surface is considered in Chen and Cao (2016). The effects of the irregular topography are not considered. We generalize the frequency-domain average-derivative optimal method to the irregular topography case in this study.

Within the framework of the finite difference method, several kinds of ways to represent the irregular topography have been developed. A straightforward way is to take advantage of segments with different slopes to fit various topographies. Ilan (1977) applied this approach to match topography and studied propagation features caused by the irregular free surface. Jih et al. (1988) improved the method by taking transition points between different slope segments into account. The whole numerical treatment to the irregular surface is divided into six kinds of cases. In each case, they applied center difference approximation (Alterman and Karal 1968) or one-side difference approximation (Alterman and Rotenberg 1969) as the boundary condition, and they used the standard second-order difference scheme for the internal points (Kelly et al. 1976). We adopt this method in our paper. Another way is to realize topography mapping by coordinate transformation (Tessmer et al. 1992; Hestholm and Ruud 1994, 1998, 2002; Tessmer and Kosloff 1994; Ruud and Hestholm 2001; Lan and Zhang 2011; Zhang et al. 2012; Wang et al. 2015). This method projects a rectangle grid onto a curved grid and implements numerical calculations for free surface on the curved grid. To avoid intricate coordinate transformation, some researchers proposed to use the staircase approximation (Robertsson 1996; Ohminato and Chouet 1997; Hayashi et al. 2001). The irregular surface is represented by rectangle grids directly in this method. The implementation for the irregular free-surface boundary condition is an extension of the treatment for horizontal free surface. This method is suitable for arbitrary topography. However, the scattered noise occurs because of staircase-shaped discretization, which can be eliminated by an oversampled grid.

In our paper, we design a new frequency-domain finite difference scheme to implement the polygonal topography. This method is a generalization of the conventional average-derivative method proposed with a flat free surface (Chen and Cao 2016). We use a local rotated coordinate method to generalize the conventional average-derivative difference operators into the rotated coordinate system aligned with the irregular free surface. The local rotated coordinate method is presented by Jih et al. (1988) in the time domain. We classify the implementation of the irregular free surface into nine cases. New average-derivative schemes are presented for the irregular topography. These new schemes generalize the conventional average-derivative method to models with irregular topography easily.

In the following section, we present the theory of our method. This is followed by derivation of the new numerical schemes at the irregular free surface. We analyze the effectiveness through a simple model test. The influences on the structure of impedance matrix are also examined. Finally, we provide some complex numerical examples to demonstrate the feasibility of our new method.

Theory

Modeling with irregular free surface

We consider the first-order elastic-wave equation in frequency domain

$$\left\{ \begin{array}{l} \rho \omega^{2} u + \frac{{\partial \tau_{xx} }}{\partial x} + \frac{{\partial \tau_{xz} }}{\partial z} = 0, \hfill \\ \rho \omega^{2} w + \frac{{\partial \tau_{zx} }}{\partial x} + \frac{{\partial \tau_{zz} }}{\partial z} = 0, \hfill \\ \tau_{xx} = (\lambda + 2\mu )\frac{\partial u}{\partial x} + \lambda \frac{\partial w}{\partial z}, \hfill \\ \tau_{zz} = (\lambda + 2\mu )\frac{\partial w}{\partial z} + \lambda \frac{\partial u}{\partial x}, \hfill \\ \tau_{xz} = \tau_{zx} = \mu \left( {\frac{\partial u}{\partial z} + \frac{\partial w}{\partial x}} \right), \hfill \\ \end{array} \right.$$
(1)

where \(\rho\) is the density, \(\omega\) denotes the angular frequency, \(\lambda\) and \(\mu\) are Lamé parameters, \(u\) and \(w\) represent components of displacements in horizontal and vertical directions, respectively, \(\tau_{xx}\) and \(\tau_{zz}\) are normal stress components, and \(\tau_{xz}\) and \(\tau_{zx}\) are shear stress components.

Eliminating the stress components in the first two equations by inserting the last three expressions of Eq. (1) into the first two equations, we obtain the elastic-wave equation in terms of displacements

$$\left\{ \begin{array}{l} \rho \omega^{2} u + \frac{\partial }{\partial x}\left( {\eta \frac{\partial u}{\partial x}} \right) + \frac{\partial }{\partial z}\left( {\mu \frac{\partial u}{\partial z}} \right) + \frac{\partial }{\partial x}\left( {\lambda \frac{\partial w}{\partial z}} \right) + \frac{\partial }{\partial z}\left( {\mu \frac{\partial w}{\partial x}} \right) = 0, \hfill \\ \rho \omega^{2} w + \frac{\partial }{\partial x}\left( {\mu \frac{\partial w}{\partial x}} \right) + \frac{\partial }{\partial z}\left( {\eta \frac{\partial w}{\partial z}} \right) + \frac{\partial }{\partial x}\left( {\mu \frac{\partial u}{\partial z}} \right) + \frac{\partial }{\partial z}\left( {\lambda \frac{\partial u}{\partial x}} \right) = 0. \hfill \\ \end{array} \right.$$
(2)

Here, we replace \(\lambda + 2\mu\) by \(\eta\).

To perform seismic numerical modeling in the presence of topography, we deal with the internal model and the irregular free surface, respectively. For the internal model, we use the conventional average-derivative method to discretize Eq. (2) and obtain a 9-point scheme (Chen and Cao 2016).

Except for the free surface, the remaining three boundaries are handled with perfectly matched layer (PML) boundary conditions. To fill into the “finite-difference star” proposed by Pratt (1990), the 9-point scheme in Chen and Cao (2016) was simplified into

$$\left\{ \begin{array}{l} c_{1} u_{r - 1,s - 1} + c_{2} u_{r,s - 1} + c_{3} u_{r + 1,s - 1} + c_{4} u_{r - 1,s} + c_{5} u_{r,s} + c_{6} u_{r + 1,s} + c_{7} u_{r - 1,s + 1} + c_{8} u_{r,s + 1} \hfill \\ + c_{9} u_{r + 1,s + 1} + d_{1} w_{r - 1,s - 1} + d_{2} w_{r + 1,s - 1} + d_{3} w_{r - 1,s + 1} + d_{4} w_{r + 1,s + 1} = 0, \hfill \\ \tilde{d}_{1} w_{r - 1,s - 1} + \tilde{d}_{2} w_{r,s - 1} + \tilde{d}_{3} w_{r + 1,s - 1} + \tilde{d}_{4} w_{r - 1,s} + \tilde{d}_{5} w_{r,s} + \tilde{d}_{6} w_{r + 1,s} + \tilde{d}_{7} w_{r - 1,s + 1} + \tilde{d}_{8} w_{r,s + 1} \hfill \\ + \tilde{d}_{9} w_{r + 1,s + 1} + \tilde{c}_{1} u_{r - 1,s - 1} + \tilde{c}_{2} u_{r + 1,s - 1} + \tilde{c}_{3} u_{r - 1,s + 1} + \tilde{c}_{4} u_{r + 1,s + 1} = 0. \hfill \\ \end{array} \right.$$
(3)

The expressions for \(c_{i} ,\tilde{d}_{i} (i = 1,2, \ldots ,9)\) and \(d_{j} ,\tilde{c}_{j} (j = 1,2,3,4)\) can be found in Chen and Cao (2016).

To obtain new numerical schemes at the irregular free surface, we use the local rotated coordinate method presented by Jih et al. (1988). We develop this approach in the frequency domain (see “Appendix 1”). For the convenience of subsequent derivations of the new numerical scheme on the free surface, we summarize numerical treatments to the irregular free surface which are carried out by Jih et al. (1988) in time domain. In order to expound the main idea of our theory clearly, we use a free surface with a 45° slope (Fig. 1). The new scheme derived at this simple polygonal-shaped free surface can be generalized to more complex irregular topographies easily.

Fig. 1
figure 1

Structure of the irregular free surface

The key point of our method is designing new average-derivative difference schemes aligned with the irregular free surface by a local rotated coordinate method. Using our new numerical schemes, the elastic-wave modeling for irregular topography can be implemented in the frequency domain.

The numerical schemes on the slope surface are derived by a combination of the average-derivative method and the local rotated coordinate method. These numerical schemes differ in the number and distribution of the discrete grid points involved. Therefore, the guideline on determining different cases is the number and distribution of the discrete grid points involved. By checking all the points along the slope surface, we have found 9 cases in which the number and distribution of the discrete grid points involved differ from each other.

Here, we derive the new numerical schemes in these nine cases, respectively.

(1) Case 1

According to Fig. 2, the first case contains points on the left of point 1 and the right of point 2 on the free surface. Point 1 and point 2 are also involved. Based on the conventional average-derivative approach, nine points should be used to discrete the elastic-wave equation. However, three of them are outside the model according to Fig. 2. The numerical expressions for these three points are introduced in “Appendix 1.” The average-derivative difference operators are changed. The new average-derivative difference scheme on the irregular free surface for this case can be derived. To fit the “star” proposed by Pratt (1990), we can simplify the new numerical scheme into the following expressions:

$$\left\{ \begin{array}{l} c_{11} u_{r - 2,s} + c_{12} u_{r - 2,s + 1} + c_{13} u_{r - 1,s} + c_{14} u_{r - 1,s + 1} + c_{15} u_{r,s} \hfill \\ + c_{16} u_{r,s + 1} + c_{17} u_{r + 1,s} + c_{18} u_{r + 1,s + 1} + c_{19} u_{r + 2,s} + c_{110} u_{r + 2,s + 1} \hfill \\ + d_{11} w_{r - 2,s} + d_{12} w_{r - 2,s + 1} + d_{13} w_{r - 1,s} + d_{14} w_{r - 1,s + 1} + d_{15} w_{r,s} \hfill \\ + d_{16} w_{r,s + 1} + d_{17} w_{r + 1,s} + d_{18} w_{r + 1,s + 1} + d_{19} w_{r + 2,s} + d_{110} w_{r + 2,s + 1} = 0, \hfill \\ \tilde{d}_{11} w_{r - 2,s} + \tilde{d}_{12} w_{r - 2,s + 1} + \tilde{d}_{13} w_{r - 1,s} + \tilde{d}_{14} w_{r - 1,s + 1} + \tilde{d}_{15} w_{r,s} \hfill \\ + \tilde{d}_{16} w_{r,s + 1} + \tilde{d}_{17} w_{r + 1,s} + \tilde{d}_{18} w_{r + 1,s + 1} + \tilde{d}_{19} w_{r + 2,s} + \tilde{d}_{110} w_{r + 2,s + 1} \hfill \\ + \tilde{c}_{11} u_{r - 2,s} + \tilde{c}_{12} u_{r - 2,s + 1} + \tilde{c}_{13} u_{r - 1,s} + \tilde{c}_{14} u_{r - 1,s + 1} + \tilde{c}_{15} u_{r,s} \hfill \\ + \tilde{c}_{16} u_{r,s + 1} + \tilde{c}_{17} u_{r + 1,s} + \tilde{c}_{18} u_{r + 1,s + 1} + \tilde{c}_{19} u_{r + 2,s} + \tilde{c}_{110} u_{r + 2,s + 1} = 0, \hfill \\ \end{array} \right.$$
(4)

where \(c_{ij} ,\tilde{d}_{ij}\) and \(d_{ij} ,\tilde{c}_{ij} (i = 1,j = 1,2, \ldots ,10)\) are the coefficients.

Fig. 2
figure 2

Simulation points and discrete grid points used for the first case. Here, red points are the simulation points, blue points are discrete grid points used by the new average-derivative scheme, and points with dashed line on the fiction line are discrete grid points used by the conventional average-derivative scheme

Discrete grid points used by our new numerical scheme are shown in Fig. 2, which are blue and red points. In order to describe the difference between the new and the conventional average-derivative difference scheme, we simplify the coefficients of the new difference scheme. Here, we observe that new coefficients consist of the coefficients \(c_{i} ,\tilde{d}_{i} (i = 1,2, \ldots ,9)\) and \(d_{j} ,\tilde{c}_{j} (j = 1,2,3,4)\) of the conventional average-derivative difference scheme. Expressions for new coefficients are

$$\begin{aligned} c_{11} & = - d_{1} \frac{1}{{S_{xr - 1} }}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x}, \\ c_{12} & = 0, \\ c_{13} & = c_{1} + c_{4} , \\ c_{14} & = c_{7} , \\ c_{15} & = c_{2} + c_{5} + d_{1} \frac{1}{{S_{xr - 1} }}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x} - d_{2} \frac{1}{{S_{xr + 1} }}\frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x}, \\ c_{16} & = c_{8} , \\ c_{17} & = c_{3} + c_{6} , \\ c_{18} & = c_{9} , \\ c_{19} & = d_{2} \frac{1}{{S_{xr + 1} }}\frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x}, \\ c_{110} & = 0, \\ \end{aligned}$$
(5)
$$\begin{aligned} d_{11} & = - c_{1} \frac{1}{{S_{xr - 1} }}\frac{\Delta z}{2\Delta x}, \\ d_{12} & = 0, \\ d_{13} & = - c_{2} \frac{1}{{S_{xr} }}\frac{\Delta z}{2\Delta x} + d_{1} , \\ d_{14} & = d_{3} , \\ d_{15} & = c_{1} \frac{1}{{S_{xr - 1} }}\frac{\Delta z}{2\Delta x} - c_{3} \frac{1}{{S_{xr + 1} }}\frac{\Delta z}{2\Delta x}, \\ d_{16} & = 0, \\ d_{17} & = c_{2} \frac{1}{{S_{xr} }}\frac{\Delta z}{2\Delta x} + d_{2} , \\ d_{18} & = d_{4} , \\ d_{19} & = c_{3} \frac{1}{{S_{xr + 1} }}\frac{\Delta z}{2\Delta x}, \\ d_{110} & = 0, \\ \end{aligned}$$
(6)

and

$$\begin{aligned} \tilde{c}_{11} & = - \tilde{d}_{1} \frac{1}{{S_{xr - 1} }}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x}, \\ \tilde{c}_{12} & = 0, \\ \tilde{c}_{13} & = - \tilde{d}_{2} \frac{1}{{S_{xr} }}\frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x} + \tilde{c}_{1} , \\ \tilde{c}_{14} & = \tilde{c}_{3} , \\ \tilde{c}_{15} & = \tilde{d}_{1} \frac{1}{{S_{xr - 1} }}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x} - \tilde{d}_{3} \frac{1}{{S_{xr + 1} }}\frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x}, \\ \tilde{c}_{16} & = 0, \\ \tilde{c}_{17} & = \tilde{d}_{2} \frac{1}{{S_{xr} }}\frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x} + \tilde{c}_{2} , \\ \tilde{c}_{18} & = \tilde{c}_{4} , \\ \tilde{c}_{19} & = \tilde{d}_{3} \frac{1}{{S_{xr + 1} }}\frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x}, \\ \tilde{c}_{110} & = 0, \\ \end{aligned}$$
(7)
$$\begin{aligned} \tilde{d}_{11} & = - \tilde{c}_{1} \frac{1}{{S_{xr - 1} }}\frac{\Delta z}{2\Delta x}, \\ \tilde{d}_{12} & = 0, \\ \tilde{d}_{13} & = \tilde{d}_{1} + \tilde{d}_{4} , \\ \tilde{d}_{14} & = \tilde{d}_{7} , \\ \tilde{d}_{15} & = \tilde{d}_{2} + \tilde{d}_{5} + \tilde{c}_{1} \frac{1}{{S_{xr - 1} }}\frac{\Delta z}{2\Delta x} - \tilde{c}_{2} \frac{1}{{S_{xr + 1} }}\frac{\Delta z}{2\Delta x}, \\ \tilde{d}_{16} & = \tilde{d}_{8} , \\ \tilde{d}_{17} & = \tilde{d}_{3} + \tilde{d}_{6} , \\ \tilde{d}_{18} & = \tilde{d}_{9} , \\ \tilde{d}_{19} & = \tilde{c}_{2} \frac{1}{{S_{xr + 1} }}\frac{\Delta z}{2\Delta x}, \\ \tilde{d}_{110} & = 0, \\ \end{aligned}$$
(8)

where \(\Delta x\) and \(\Delta z\) denote spacing intervals.

Here, we have

$$\left\{ \begin{array}{l} S_{x} = 1 - \frac{{ic_{x} }}{\omega }\cos \left( {\frac{\pi }{2}\frac{x}{{L_{x} }}} \right), \hfill \\ S_{z} = 1 - \frac{{ic_{z} }}{\omega }\cos \left( {\frac{\pi }{2}\frac{z}{{L_{z} }}} \right), \hfill \\ \end{array} \right.$$
(9)

where \(c_{x}\) and \(c_{z}\) are the coefficients in Operto et al. (2007); \(L_{x}\) and \(L_{z}\) are thickness along x- and z-direction. On the free surface, we have \(S_{z} = 1\).

(2) Case 2

The simulation point in the second case is on the left of the flat-to-slope transition point (Fig. 3). According to the 9-point scheme, three points are on the fiction line. The numerical expressions at these points are given in “Appendix 1.” The average-derivative difference operators are changed. We derive the new average-derivative scheme. Discrete grid points used by our scheme are shown in Fig. 3. They are denoted by blue and red points. We can rewrite the new numerical scheme as follows:

$$\left\{ \begin{array}{l} c_{21} u_{r - 2,s} + c_{22} u_{r - 1,s} + c_{23} u_{r - 1,s + 1} + c_{24} u_{r,s} + c_{25} u_{r,s + 1} \hfill \\ + c_{26} u_{r + 1,s} + c_{27} u_{r + 1,s + 1} + c_{28} u_{r + 2,s - 1} + c_{29} u_{r + 2,s} + c_{210} u_{r + 3,s - 2} \hfill \\ + d_{21} w_{r - 2,s} + d_{22} w_{r - 1,s} + d_{23} w_{r - 1,s + 1} + d_{24} w_{r,s} + d_{25} w_{r,s + 1} \hfill \\ + d_{26} w_{r + 1,s} + d_{27} w_{r + 1,s + 1} + d_{28} w_{r + 2,s - 1} + d_{29} w_{r + 2,s} + d_{210} w_{r + 3,s - 2} = 0, \hfill \\ \tilde{d}_{21} w_{r - 2,s} + \tilde{d}_{22} w_{r - 1,s} + \tilde{d}_{23} w_{r - 1,s + 1} + \tilde{d}_{24} w_{r,s} + \tilde{d}_{25} w_{r,s + 1} \hfill \\ + \tilde{d}_{26} w_{r + 1,s} + \tilde{d}_{27} w_{r + 1,s + 1} + \tilde{d}_{28} w_{r + 2,s - 1} + \tilde{d}_{29} w_{r + 2,s} + \tilde{d}_{210} w_{r + 3,s - 2} \hfill \\ + \tilde{c}_{21} u_{r - 2,s} + \tilde{c}_{22} u_{r - 1,s} + \tilde{c}_{23} u_{r - 1,s + 1} + \tilde{c}_{24} u_{r,s} + \tilde{c}_{25} u_{r,s + 1} \hfill \\ + \tilde{c}_{26} u_{r + 1,s} + \tilde{c}_{27} u_{r + 1,s + 1} + \tilde{c}_{28} u_{r + 2,s - 1} + \tilde{c}_{29} u_{r + 2,s} + \tilde{c}_{210} u_{r + 3,s - 2} = 0, \hfill \\ \end{array} \right.$$
(10)

where

$$\begin{aligned} c_{21} & = - d_{1} \frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x}, \\ c_{22} & = c_{1} + c_{3} \frac{1}{2}(1 - \varepsilon_{1} )\frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x} + c_{4} , \\ c_{23} & = c_{7} , \\ c_{24} & = c_{2} + c_{5} + d_{1} \frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x} - d_{2} \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}, \\ c_{25} & = c_{8} , \\ c_{26} & = c_{3} \left[ {(1 - \varepsilon_{0} ) - \frac{1}{2}(1 - \varepsilon_{1} )\frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x}} \right] + c_{6} , \\ c_{27} & = c_{9} , \\ c_{28} & = - c_{3} \frac{1}{2}\varepsilon_{1} \frac{1}{2}\frac{{\lambda_{r + 2,s - 2} }}{{\eta_{r + 2,s - 2} }} + d_{2} \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}\left( {1 - \varepsilon_{1} \varepsilon_{0}^{\prime } } \right), \\ c_{29} & = c_{3} \varepsilon_{0} , \\ c_{210} & = c_{3} \frac{1}{2}\varepsilon_{1} \frac{1}{2}\frac{{\lambda_{r + 2,s - 2} }}{{\eta_{r + 2,s - 2} }} + d_{2} \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}\varepsilon_{1} \varepsilon_{0}^{\prime } , \\ \end{aligned}$$
(11)
$$\begin{aligned} d_{21} & = - c_{1} \frac{\Delta z}{2\Delta x}, \\ d_{22} & = - c_{2} \frac{\Delta z}{2\Delta x} + d_{1} + d_{2} \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}(1 - \varepsilon_{1} )\frac{\Delta z}{2\Delta x}, \\ d_{23} & = d_{3} , \\ d_{24} & = c_{1} \frac{\Delta z}{2\Delta x} - c_{3} \frac{1}{2}, \\ d_{25} & = 0, \\ d_{26} & = c_{2} \frac{\Delta z}{2\Delta x} + d_{2} \left[ {(1 - \varepsilon_{0} ) - \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}(1 - \varepsilon_{1} )\frac{\Delta z}{2\Delta x}} \right], \\ d_{27} & = d_{4} , \\ d_{28} & = c_{3} \frac{1}{2}\left( {1 - \varepsilon_{1} \varepsilon_{0}^{{\prime }} } \right) - d_{2} \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}\varepsilon_{1} \frac{1}{2}, \\ d_{29} & = d_{2} \varepsilon_{0} , \\ d_{210} & = c_{3} \frac{1}{2}\varepsilon_{1} \varepsilon_{0}^{{\prime }} + d_{2} \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}\varepsilon_{1} \frac{1}{2}, \\ \end{aligned}$$
(12)

and

$$\begin{aligned} \tilde{c}_{21} & = - \tilde{d}_{1} \frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x}, \\ \tilde{c}_{22} & = - \tilde{d}_{2} \frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x} + \tilde{c}_{1} + \tilde{c}_{2} \frac{1}{2}(1 - \varepsilon_{1} )\frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x}, \\ \tilde{c}_{23} & = \tilde{c}_{3} , \\ \tilde{c}_{24} & = \tilde{d}_{1} \frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x} - \tilde{d}_{3} \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}, \\ \tilde{c}_{25} & = 0, \\ \tilde{c}_{26} & = \tilde{d}_{2} \frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x} + \tilde{c}_{2} \left[ {(1 - \varepsilon_{0} ) - \frac{1}{2}(1 - \varepsilon_{1} )\frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x}} \right], \\ \tilde{c}_{27} & = \tilde{c}_{4} , \\ \tilde{c}_{28} & = \tilde{d}_{3} \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}\left( {1 - \varepsilon_{1} \varepsilon_{0}^{{\prime }} } \right) - \tilde{c}_{2} \frac{1}{2}\varepsilon_{1} \frac{1}{2}\frac{{\lambda_{r + 2,s - 2} }}{{\eta_{r + 2,s - 2} }}, \\ \tilde{c}_{29} & = \tilde{c}_{2} \varepsilon_{0} , \\ \tilde{c}_{210} & = \tilde{d}_{3} \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}\varepsilon_{1} \varepsilon_{0}^{{\prime }} + \tilde{c}_{2} \frac{1}{2}\varepsilon_{1} \frac{1}{2}\frac{{\lambda_{r + 2,s - 2} }}{{\eta_{r + 2,s - 2} }}, \\ \end{aligned}$$
(13)
$$\begin{aligned} \tilde{d}_{21} & = - \tilde{c}_{1} \frac{\Delta z}{2\Delta x}, \\ \tilde{d}_{22} & = \tilde{d}_{1} + \tilde{d}_{3} \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}(1 - \varepsilon_{1} )\frac{\Delta z}{2\Delta x} + \tilde{d}_{4} , \\ \tilde{d}_{23} & = \tilde{d}_{7} , \\ \tilde{d}_{24} & = \tilde{d}_{2} + \tilde{d}_{5} + \tilde{c}_{1} \frac{\Delta z}{2\Delta x} - \tilde{c}_{2} \frac{1}{2}, \\ \tilde{d}_{25} & = \tilde{d}_{8} , \\ \tilde{d}_{26} & = \tilde{d}_{3} \left[ {(1 - \varepsilon_{0} ) - \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}(1 - \varepsilon_{1} )\frac{\Delta z}{2\Delta x}} \right] + \tilde{d}_{6} , \\ \tilde{d}_{27} & = \tilde{d}_{9} , \\ \tilde{d}_{28} & = - \tilde{d}_{3} \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}\varepsilon_{1} \frac{1}{2} + \tilde{c}_{2} \frac{1}{2}\left( {1 - \varepsilon_{1} \varepsilon_{0}^{\prime } } \right), \\ \tilde{d}_{29} & = \tilde{d}_{3} \varepsilon_{0} , \\ \tilde{d}_{210} & = \tilde{d}_{3} \frac{1}{2}\frac{{\lambda_{r + 1,s - 1} }}{{\eta_{r + 1,s - 1} }}\varepsilon_{1} \frac{1}{2} + \tilde{c}_{2} \frac{1}{2}\varepsilon_{1} \varepsilon_{0}^{\prime } . \\ \end{aligned}$$
(14)
Fig. 3
figure 3

Simulation point and discrete grid points used for the second case

(3) Case 3

The simulation point in the third case is the red point in Fig. 4. It is on the right of the slope-to-flat transition point. Three discrete grid points are located on the fiction line when using the conventional average-derivative scheme. We derive the new average-derivative scheme using the numerical expressions at these three points given in “Appendix 1.” Discrete grid points used by our scheme are shown in Fig. 4 (blue and red points). The new numerical scheme for this case can be simplified as follows:

$$\left\{ \begin{array}{l} c_{31} u_{r - 2,s + 1} + c_{32} u_{r - 1,s} + c_{33} u_{r - 1,s + 1} + c_{34} u_{r,s} \hfill \\ + c_{35} u_{r,s + 1} + c_{36} u_{r + 1,s} + c_{37} u_{r + 1,s + 1} + c_{38} u_{r + 2,s} \hfill \\ + d_{31} w_{r - 2,s + 1} + d_{32} w_{r - 1,s} + d_{33} w_{r - 1,s + 1} + d_{34} w_{r,s} \hfill \\ + d_{35} w_{r,s + 1} + d_{36} w_{r + 1,s} + d_{37} w_{r + 1,s + 1} + d_{38} w_{r + 2,s} = 0, \hfill \\ \tilde{d}_{31} w_{r - 2,s + 1} + \tilde{d}_{32} w_{r - 1,s} + \tilde{d}_{33} w_{r - 1,s + 1} + \tilde{d}_{34} w_{r,s} \hfill \\ + \tilde{d}_{35} w_{r,s + 1} + \tilde{d}_{36} w_{r + 1,s} + \tilde{d}_{37} w_{r + 1,s + 1} + \tilde{d}_{38} w_{r + 2,s} \hfill \\ + \tilde{c}_{31} u_{r - 2,s + 1} + \tilde{c}_{32} u_{r - 1,s} + \tilde{c}_{33} u_{r - 1,s + 1} + \tilde{c}_{34} u_{r,s} \hfill \\ + \tilde{c}_{35} u_{r,s + 1} + \tilde{c}_{36} u_{r + 1,s} + \tilde{c}_{37} u_{r + 1,s + 1} + \tilde{c}_{38} u_{r + 2,s} = 0, \hfill \\ \end{array} \right.$$
(15)

where

$$\begin{aligned} c_{31} & = c_{1} \frac{1}{2}(1 - \varepsilon_{11} )\frac{1}{2}\frac{{\lambda_{r - 2,s} }}{{\eta_{r - 2,s} }} - d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\left[ {\varepsilon_{11} + (1 - \varepsilon_{11} )\left( {1 - \varepsilon_{0}^{\prime } } \right)} \right], \\ c_{32} & = c_{1} \left[ {(1 - \varepsilon_{00} ) - \frac{1}{2}\varepsilon_{11} \frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x} - \frac{1}{2}(1 - \varepsilon_{11} )\frac{1}{2}\frac{{\lambda_{r - 2,s} }}{{\eta_{r - 2,s} }}} \right] \\ & \quad + c_{4} - d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}(1 - \varepsilon_{11} )\varepsilon_{0}^{\prime } , \\ c_{33} & = c_{7} , \\ c_{34} & = c_{1} \varepsilon_{00} + c_{2} + c_{5} + d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }} - d_{2} \frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x}, \\ c_{35} & = c_{8} , \\ c_{36} & = c_{1} \frac{1}{2}\varepsilon_{11} \frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x} + c_{3} + c_{6} , \\ c_{37} & = c_{9} , \\ c_{38} & = d_{2} \frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x}, \\ \end{aligned}$$
(16)
$$\begin{aligned} d_{31} & = - c_{1} \frac{1}{2}\left[ {\varepsilon_{11} + (1 - \varepsilon_{11} )\left( {1 - \varepsilon_{0}^{\prime } } \right)} \right] + d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}(1 - \varepsilon_{11} )\frac{1}{2}, \\ d_{32} & = - c_{1} \frac{1}{2}(1 - \varepsilon_{11} )\varepsilon_{0}^{\prime } - c_{2} \frac{\Delta z}{2\Delta x} \\ & \quad + d_{1} \left[ {(1 - \varepsilon_{00} ) - \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\varepsilon_{11} \frac{\Delta z}{2\Delta x} - \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}(1 - \varepsilon_{11} )\frac{1}{2}} \right], \\ d_{33} & = d_{3} , \\ d_{34} & = c_{1} \frac{1}{2} - c_{3} \frac{\Delta z}{2\Delta x} + d_{1} \varepsilon_{00} , \\ d_{35} & = 0, \\ d_{36} & = c_{2} \frac{\Delta z}{2\Delta x} + d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\varepsilon_{11} \frac{\Delta z}{2\Delta x} + d_{2} , \\ d_{37} & = d_{4} , \\ d_{38} & = c_{3} \frac{\Delta z}{2\Delta x}, \\ \end{aligned}$$
(17)

and

$$\begin{aligned} \tilde{c}_{31} & = - \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}[\varepsilon_{11} + (1 - \varepsilon_{11} )(1 - \varepsilon_{0}^{\prime } )] + \tilde{c}_{1} \frac{1}{2}(1 - \varepsilon_{11} )\frac{1}{2}\frac{{\lambda_{r - 2,s} }}{{\eta_{r - 2,s} }}, \\ \tilde{c}_{32} & = - \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}(1 - \varepsilon_{11} )\varepsilon_{0}^{\prime } - \tilde{d}_{2} \frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x} \\ & \quad + \tilde{c}_{1} \left[ {(1 - \varepsilon_{00} ) - \frac{1}{2}\varepsilon_{11} \frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x} - \frac{1}{2}(1 - \varepsilon_{11} )\frac{1}{2}\frac{{\lambda_{r - 2,s} }}{{\eta_{r - 2,s} }}} \right], \\ \tilde{c}_{33} & = \tilde{c}_{3} , \\ \tilde{c}_{34} & = \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }} - \tilde{d}_{3} \frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x} + \tilde{c}_{1} \varepsilon_{00} , \\ \tilde{c}_{35} & = 0, \\ \tilde{c}_{36} & = \tilde{d}_{2} \frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x} + \tilde{c}_{1} \frac{1}{2}\varepsilon_{11} \frac{{\lambda_{r,s} }}{{\eta_{r,s} }}\frac{\Delta z}{2\Delta x} + \tilde{c}_{2} , \\ \tilde{c}_{37} & = \tilde{c}_{4} , \\ \tilde{c}_{38} & = \tilde{d}_{3} \frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x}, \\ \end{aligned}$$
(18)
$$\begin{aligned} \tilde{d}_{31} & = \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}(1 - \varepsilon_{11} )\frac{1}{2} - \tilde{c}_{1} \frac{1}{2}\left[ {\varepsilon_{11} + (1 - \varepsilon_{11} )\left( {1 - \varepsilon_{0}^{\prime } } \right)} \right], \\ \tilde{d}_{32} & = \tilde{d}_{1} \left[ {(1 - \varepsilon_{00} ) - \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\varepsilon_{11} \frac{\Delta z}{2\Delta x} - \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}(1 - \varepsilon_{11} )\frac{1}{2}} \right] \\ & \quad + \tilde{d}_{4} - \tilde{c}_{1} \frac{1}{2}(1 - \varepsilon_{11} )\varepsilon_{0}^{\prime } , \\ \tilde{d}_{33} & = \tilde{d}_{7} , \\ \tilde{d}_{34} & = \tilde{d}_{1} \varepsilon_{00} + \tilde{d}_{2} + \tilde{d}_{5} + \tilde{c}_{1} \frac{1}{2} - \tilde{c}_{2} \frac{\Delta z}{2\Delta x}, \\ \tilde{d}_{35} & = \tilde{d}_{8} , \\ \tilde{d}_{36} & = \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\varepsilon_{11} \frac{\Delta z}{2\Delta x} + \tilde{d}_{3} + \tilde{d}_{6} , \\ \tilde{d}_{37} & = \tilde{d}_{9} , \\ \tilde{d}_{38} & = \tilde{c}_{2} \frac{\Delta z}{2\Delta x}. \\ \end{aligned}$$
(19)
Fig. 4
figure 4

Simulation point and discrete grid points used for the third case

(4) Case 4

The simulation point in the fourth case is the flat-to-slope transition point in Fig. 5. According to the conventional average-derivative approach, there are two discrete grid points outside the model. Based on the numerical expressions at these two points given in “Appendix 1”, the new average-derivative scheme is derived. Blue and red points in Fig. 5 are the discrete grid points used by our new scheme. We simplify the new numerical scheme by

$$\left\{ \begin{array}{l} c_{41} u_{r - 2,s} + c_{42} u_{r - 1,s} + c_{43} u_{r - 1,s + 1} + c_{44} u_{r,s} + c_{45} u_{r,s + 1} \hfill \\ + c_{46} u_{r + 1,s - 1} + c_{47} u_{r + 1,s} + c_{48} u_{r + 1,s + 1} + c_{49} u_{r + 2,s - 2} + d_{41} w_{r - 2,s} \hfill \\ + d_{42} w_{r - 1,s} + d_{43} w_{r - 1,s + 1} + d_{44} w_{r,s} + d_{45} w_{r,s + 1} + d_{46} w_{r + 1,s - 1} \hfill \\ + d_{47} w_{r + 1,s} + d_{48} w_{r + 1,s + 1} + d_{49} w_{r + 2,s - 2} = 0, \hfill \\ \tilde{d}_{41} w_{r - 2,s} + \tilde{d}_{42} w_{r - 1,s} + \tilde{d}_{43} w_{r - 1,s + 1} + \tilde{d}_{44} w_{r,s} + \tilde{d}_{45} w_{r,s + 1} \hfill \\ + \tilde{d}_{46} w_{r + 1,s - 1} + \tilde{d}_{47} w_{r + 1,s} + \tilde{d}_{48} w_{r + 1,s + 1} + \tilde{d}_{49} w_{r + 2,s - 2} + \tilde{c}_{41} u_{r - 2,s} \hfill \\ + \tilde{c}_{42} u_{r - 1,s} + \tilde{c}_{43} u_{r - 1,s + 1} + \tilde{c}_{44} u_{r,s} + \tilde{c}_{45} u_{r,s + 1} + \tilde{c}_{46} u_{r + 1,s - 1} \hfill \\ + \tilde{c}_{47} u_{r + 1,s} + \tilde{c}_{48} u_{r + 1,s + 1} + \tilde{c}_{49} u_{r + 2,s - 2} = 0, \hfill \\ \end{array} \right.$$
(20)

where

$$\begin{aligned} c_{41} & = c_{2} \frac{1}{2}(1 - \varepsilon_{1} )\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x} - d_{1} \frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x}, \\ c_{42} & = c_{1} + c_{4} , \\ c_{43} & = c_{7} , \\ c_{44} & = c_{2} \left[ {(1 - \varepsilon_{0} ) - \frac{1}{2}(1 - \varepsilon_{1} )\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x}} \right] + c_{5} + d_{1} \frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x}, \\ c_{45} & = c_{8} , \\ c_{46} & = - c_{2} \frac{1}{2}\varepsilon_{1} \frac{1}{2}\frac{{\lambda_{r + 1,s - 2} }}{{\eta_{r + 1,s - 2} }} + c_{3} , \\ c_{47} & = c_{2} \varepsilon_{0} + c_{6} , \\ c_{48} & = c_{9} , \\ c_{49} & = c_{2} \frac{1}{2}\varepsilon_{1} \frac{1}{2}\frac{{\lambda_{r + 1,s - 2} }}{{\eta_{r + 1,s - 2} }}, \\ \end{aligned}$$
(21)
$$\begin{aligned} d_{41} & = - c_{1} \frac{\Delta z}{2\Delta x}, \\ d_{42} & = - c_{2} \frac{1}{2} + d_{1} , \\ d_{43} & = d_{3} , \\ d_{44} & = c_{1} \frac{\Delta z}{2\Delta x}, \\ d_{45} & = 0, \\ d_{46} & = c_{2} \frac{1}{2}\left( {1 - \varepsilon_{1} \varepsilon_{0}^{{\prime }} } \right) + d_{2} , \\ d_{47} & = 0, \\ d_{48} & = d_{4} , \\ d_{49} & = c_{2} \frac{1}{2}\varepsilon_{1} \varepsilon_{0}^{{\prime }} , \\ \end{aligned}$$
(22)

and

$$\begin{aligned} \tilde{c}_{41} & = - \tilde{d}_{1} \frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x}, \\ \tilde{c}_{42} & = - \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }} + \tilde{c}_{1} , \\ \tilde{c}_{43} & = \tilde{c}_{3} , \\ \tilde{c}_{44} & = \tilde{d}_{1} \frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\frac{\Delta z}{2\Delta x}, \\ \tilde{c}_{45} & = 0, \\ \tilde{c}_{46} & = \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }}\left( {1 - \varepsilon_{1} \varepsilon_{0}^{\prime } } \right) + \tilde{c}_{2} , \\ \tilde{c}_{47} & = 0, \\ \tilde{c}_{48} & = \tilde{c}_{4} , \\ \tilde{c}_{49} & = \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }}\varepsilon_{1} \varepsilon_{0}^{\prime } , \\ \end{aligned}$$
(23)
$$\begin{aligned} \tilde{d}_{41} & = \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }}(1 - \varepsilon_{1} )\frac{\Delta z}{2\Delta x} - \tilde{c}_{1} \frac{\Delta z}{2\Delta x}, \\ \tilde{d}_{42} & = \tilde{d}_{1} + \tilde{d}_{4} , \\ \tilde{d}_{43} & = \tilde{d}_{7} , \\ \tilde{d}_{44} & = \tilde{d}_{2} \left[ {(1 - \varepsilon_{0} ) - \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }}(1 - \varepsilon_{1} )\frac{\Delta z}{2\Delta x}} \right] + \tilde{d}_{5} + \tilde{c}_{1} \frac{\Delta z}{2\Delta x}, \\ \tilde{d}_{45} & = \tilde{d}_{8} , \\ \tilde{d}_{46} & = - \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }}\varepsilon_{1} \frac{1}{2} + \tilde{d}_{3} , \\ \tilde{d}_{47} & = \tilde{d}_{2} \varepsilon_{0} + \tilde{d}_{6} , \\ \tilde{d}_{48} & = \tilde{d}_{9} , \\ \tilde{d}_{49} & = \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }}\varepsilon_{1} \frac{1}{2}. \\ \end{aligned}$$
(24)
Fig. 5
figure 5

Simulation point and discrete grid points used for the fourth case

(5) Case 5

The simulation point in the fifth case is the slope-to-flat transition point in Fig. 6. Four discrete grid points are located outside the model when using the 9-point scheme. The numerical expressions at these points are introduced in “Appendix 1.” The average-derivative difference operators are changed. We derive the new average-derivative scheme. Discrete grid points are the blue and red points in Fig. 6. We simplify the new numerical scheme by

$$\left\{ \begin{array}{l} c_{51} u_{r - 1,s + 1} + c_{52} u_{r,s} + c_{53} u_{r,s + 1} + c_{54} u_{r + 1,s} + c_{55} u_{r + 1,s + 1} + c_{56} u_{r + 2,s} \hfill \\ + d_{51} w_{r - 1,s + 1} + d_{52} w_{r,s} + d_{53} w_{r,s + 1} + d_{54} w_{r + 1,s} + d_{55} w_{r + 1,s + 1} + d_{56} w_{r + 2,s} = 0, \hfill \\ \tilde{d}_{51} w_{r - 1,s + 1} + \tilde{d}_{52} w_{r,s} + \tilde{d}_{53} w_{r,s + 1} + \tilde{d}_{54} w_{r + 1,s} + \tilde{d}_{55} w_{r + 1,s + 1} + \tilde{d}_{56} w_{r + 2,s} \hfill \\ + \tilde{c}_{51} u_{r - 1,s + 1} + \tilde{c}_{52} u_{r,s} + \tilde{c}_{53} u_{r,s + 1} + \tilde{c}_{54} u_{r + 1,s} + \tilde{c}_{55} u_{r + 1,s + 1} + \tilde{c}_{56} u_{r + 2,s} = 0, \hfill \\ \end{array} \right.$$
(25)

where

$$\begin{aligned} c_{51} & = c_{2} \frac{1}{2}(1 - \varepsilon_{11} )\frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }} + c_{4} \left( {1 - \varepsilon_{0}^{{\prime }} } \right) + c_{7} - d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}, \\ c_{52} & = c_{1} \left[ {1 - \frac{1}{2}\frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x}} \right] + c_{4} \varepsilon_{0}^{{\prime }} + c_{5} - d_{2} \frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x} \\ & \quad + c_{2} \left[ {(1 - \varepsilon_{00} ) - \frac{1}{2}\varepsilon_{11} \frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x} - \frac{1}{2}(1 - \varepsilon_{11} )\frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}} \right], \\ c_{53} & = c_{8} , \\ c_{54} & = c_{2} \varepsilon_{00} + c_{3} + c_{6} + d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}, \\ c_{55} & = c_{9} , \\ c_{56} & = c_{1} \frac{1}{2}\frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x} + c_{2} \frac{1}{2}\varepsilon_{11} \frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x} + d_{2} \frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x}, \\ \end{aligned}$$
(26)
$$\begin{aligned} d_{51} & = - c_{1} \frac{1}{2} - c_{4} \frac{1}{2} + d_{3} \\ & \quad - c_{2} \frac{1}{2}\left[ {\varepsilon_{11} + (1 - \varepsilon_{11} )\left( {1 - \varepsilon_{0}^{{\prime }} } \right)} \right], \\ d_{52} & = - c_{2} \frac{1}{2}(1 - \varepsilon_{11} )\varepsilon_{0}^{{\prime }} - c_{3} \frac{\Delta z}{2\Delta x} \\ & \quad + c_{4} \frac{1}{2} + d_{1} \left[ {1 - \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\frac{\Delta z}{2\Delta x}} \right], \\ d_{53} & = 0, \\ d_{54} & = c_{1} \frac{1}{2} + c_{2} \frac{1}{2} + d_{2} , \\ d_{55} & = d_{4} , \\ d_{56} & = c_{3} \frac{\Delta z}{2\Delta x} + d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\frac{\Delta z}{2\Delta x}, \\ \end{aligned}$$
(27)

and

$$\begin{aligned} \tilde{c}_{51} & = - \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }} - \tilde{d}_{4} \frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }} + \tilde{c}_{3} \\ & \quad - \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }}\left[ {\varepsilon_{11} + (1 - \varepsilon_{11} )\left( {1 - \varepsilon_{0}^{\prime } } \right)} \right], \\ \tilde{c}_{52} & = - \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }}(1 - \varepsilon_{11} )\varepsilon_{0}^{\prime } - \tilde{d}_{3} \frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x} \\ & \quad + \tilde{d}_{4} \frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }} + \tilde{c}_{1} \left[ {1 - \frac{1}{2}\frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x}} \right], \\ \tilde{c}_{53} & = 0, \\ \tilde{c}_{54} & = \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }} + \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }} + \tilde{c}_{2} , \\ \tilde{c}_{55} & = \tilde{c}_{4} , \\ \tilde{c}_{56} & = \tilde{d}_{3} \frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x} + \tilde{c}_{1} \frac{1}{2}\frac{{\lambda_{r + 1,s} }}{{\eta_{r + 1,s} }}\frac{\Delta z}{2\Delta x}, \\ \end{aligned}$$
(28)
$$\begin{aligned} \tilde{d}_{51} & = \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }}(1 - \varepsilon_{11} )\frac{1}{2} + \tilde{d}_{4} (1 - \varepsilon_{0}^{{\prime }} ) + \tilde{d}_{7} - \tilde{c}_{1} \frac{1}{2}, \\ \tilde{d}_{52} & = \tilde{d}_{1} \left[ {1 - \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\frac{\Delta z}{2\Delta x}} \right] + \tilde{d}_{4} \varepsilon_{0}^{{\prime }} + \tilde{d}_{5} - \tilde{c}_{2} \frac{\Delta z}{2\Delta x} \\ & \quad + \tilde{d}_{2} \left[ {(1 - \varepsilon_{00} ) - \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }}\varepsilon_{11} \frac{\Delta z}{2\Delta x} - \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }}(1 - \varepsilon_{11} )\frac{1}{2}} \right], \\ \tilde{d}_{53} & = \tilde{d}_{8} , \\ \tilde{d}_{54} & = \tilde{d}_{2} \varepsilon_{00} + \tilde{d}_{3} + \tilde{d}_{6} + \tilde{c}_{1} \frac{1}{2}, \\ \tilde{d}_{55} & = \tilde{d}_{9} , \\ \tilde{d}_{56} & = \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\frac{\Delta z}{2\Delta x} + \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }}\varepsilon_{11} \frac{\Delta z}{2\Delta x} + \tilde{c}_{2} \frac{\Delta z}{2\Delta x}. \\ \end{aligned}$$
(29)
Fig. 6
figure 6

Simulation point and discrete grid points used for the fifth case

(6) Case 6

The simulation point in the sixth case is the point on the right of the flat-to-slope transition point in Fig. 7. According to the 9-point scheme, one discrete grid point is located on the fiction line. The numerical expression at this point is given in “Appendix 1.” Referring to this numerical expression, we derive the new average-derivative scheme. Discrete grid points are the blue and red points in Fig. 7. We simplify the new numerical scheme by

$$\left\{ \begin{array}{l} c_{61} u_{r - 3,s} + c_{62} u_{r - 2,s} + c_{63} u_{r - 1,s} + c_{64} u_{r - 1,s + 1} + c_{65} u_{r,s - 1} + c_{66} u_{r,s} \hfill \\ + c_{67} u_{r,s + 1} + c_{68} u_{r + 1,s - 2} + c_{69} u_{r + 1,s - 1} + c_{610} u_{r + 1,s} + c_{611} u_{r + 1,s + 1} \hfill \\ + d_{61} w_{r - 3,s} + d_{62} w_{r - 2,s} + d_{63} w_{r - 1,s} + d_{64} w_{r - 1,s + 1} + d_{65} w_{r,s - 1} + d_{66} w_{r,s} \hfill \\ + d_{67} w_{r,s + 1} + d_{68} w_{r + 1,s - 2} + d_{69} w_{r + 1,s - 1} + d_{610} w_{r + 1,s} + d_{611} w_{r + 1,s + 1} = 0, \hfill \\ \tilde{d}_{61} w_{r - 3,s} + \tilde{d}_{62} w_{r - 2,s} + \tilde{d}_{63} w_{r - 1,s} + \tilde{d}_{64} w_{r - 1,s + 1} + \tilde{d}_{65} w_{r,s - 1} + \tilde{d}_{66} w_{r,s} \hfill \\ + \tilde{d}_{67} w_{r,s + 1} + \tilde{d}_{68} w_{r + 1,s - 2} + \tilde{d}_{69} w_{r + 1,s - 1} + \tilde{d}_{610} w_{r + 1,s} + \tilde{d}_{611} w_{r + 1,s + 1} \hfill \\ + \tilde{c}_{61} u_{r - 3,s} + \tilde{c}_{62} u_{r - 2,s} + \tilde{c}_{63} u_{r - 1,s} + \tilde{c}_{64} u_{r - 1,s + 1} + \tilde{c}_{65} u_{r,s - 1} + \tilde{c}_{66} u_{r,s} \hfill \\ + \tilde{c}_{67} u_{r,s + 1} + \tilde{c}_{68} u_{r + 1,s - 2} + \tilde{c}_{69} u_{r + 1,s - 1} + \tilde{c}_{610} u_{r + 1,s} + \tilde{c}_{611} u_{r + 1,s + 1} = 0, \hfill \\ \end{array} \right.$$
(30)

where

$$\begin{aligned} c_{61} & = c_{1} \frac{1}{2}(1 - \varepsilon_{1} )\frac{{\lambda_{r - 2,s} }}{{\eta_{r - 2,s} }}\frac{\Delta z}{2\Delta x}, \\ c_{62} & = - d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}, \\ c_{63} & = c_{1} \left[ {(1 - \varepsilon_{0} ) - \frac{1}{2}(1 - \varepsilon_{1} )\frac{{\lambda_{r - 2,s} }}{{\eta_{r - 2,s} }}\frac{\Delta z}{2\Delta x}} \right] + c_{4} , \\ c_{64} & = c_{7} , \\ c_{65} & = - c_{1} \frac{1}{2}\varepsilon_{1} \frac{1}{2}\frac{{\lambda_{r,s - 2} }}{{\eta_{r,s - 2} }} + c_{2} + d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\left( {1 - \varepsilon_{1} \varepsilon_{0}^{\prime } } \right), \\ c_{66} & = c_{1} \varepsilon_{0} + c_{5} , \\ c_{67} & = c_{8} , \\ c_{68} & = c_{1} \frac{1}{2}\varepsilon_{1} \frac{1}{2}\frac{{\lambda_{r,s - 2} }}{{\eta_{r,s - 2} }} + d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\varepsilon_{1} \varepsilon_{0}^{\prime } , \\ c_{69} & = c_{3} , \\ c_{610} & = c_{6} , \\ c_{611} & = c_{9} , \\ \end{aligned}$$
(31)
$$\begin{aligned} d_{61} & = d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}(1 - \varepsilon_{1} )\frac{\Delta z}{2\Delta x}, \\ d_{62} & = - c_{1} \frac{1}{2}, \\ d_{63} & = d_{1} \left[ {(1 - \varepsilon_{0} ) - \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}(1 - \varepsilon_{1} )\frac{\Delta z}{2\Delta x}} \right], \\ d_{64} & = d_{3} , \\ d_{65} & = c_{1} \frac{1}{2}(1 - \varepsilon_{1} \varepsilon_{0}^{\prime } ) - d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\varepsilon_{1} \frac{1}{2}, \\ d_{66} & = d_{1} \varepsilon_{0} , \\ d_{67} & = 0, \\ d_{68} & = c_{1} \frac{1}{2}\varepsilon_{1} \varepsilon_{0}^{\prime } + d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\varepsilon_{1} \frac{1}{2}, \\ d_{69} & = d_{2} , \\ d_{610} & = 0, \\ d_{611} & = d_{4} , \\ \end{aligned}$$
(32)

and

$$\begin{aligned} \tilde{c}_{61} & = \tilde{c}_{1} \frac{1}{2}(1 - \varepsilon_{1} )\frac{{\lambda_{r - 2,s} }}{{\eta_{r - 2,s} }}\frac{\Delta z}{2\Delta x}, \\ \tilde{c}_{62} & = - \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}, \\ \tilde{c}_{63} & = \tilde{c}_{1} \left[ {(1 - \varepsilon_{0} ) - \frac{1}{2}(1 - \varepsilon_{1} )\frac{{\lambda_{r - 2,s} }}{{\eta_{r - 2,s} }}\frac{\Delta z}{2\Delta x}} \right], \\ \tilde{c}_{64} & = \tilde{c}_{3} , \\ \tilde{c}_{65} & = \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\left( {1 - \varepsilon_{1} \varepsilon_{0}^{\prime } } \right) - \tilde{c}_{1} \frac{1}{2}\varepsilon_{1} \frac{1}{2}\frac{{\lambda_{r,s - 2} }}{{\eta_{r,s - 2} }}, \\ \tilde{c}_{66} & = \tilde{c}_{1} \varepsilon_{0} , \\ \tilde{c}_{67} & = 0, \\ \tilde{c}_{68} & = \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\varepsilon_{1} \varepsilon_{0}^{{\prime }} + \tilde{c}_{1} \frac{1}{2}\varepsilon_{1} \frac{1}{2}\frac{{\lambda_{r,s - 2} }}{{\eta_{r,s - 2} }}, \\ \tilde{c}_{69} & = \tilde{c}_{2} , \\ \tilde{c}_{610} & = 0, \\ \tilde{c}_{611} & = \tilde{c}_{4} , \\ \end{aligned}$$
(33)
$$\begin{aligned} \tilde{d}_{61} & = \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}(1 - \varepsilon_{1} )\frac{\Delta z}{2\Delta x}, \\ \tilde{d}_{62} & = - \tilde{c}_{1} \frac{1}{2}, \\ \tilde{d}_{63} & = \tilde{d}_{1} \left[ {(1 - \varepsilon_{0} ) - \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}(1 - \varepsilon_{1} )\frac{\Delta z}{2\Delta x}} \right] + \tilde{d}_{4} , \\ \tilde{d}_{64} & = \tilde{d}_{7} , \\ \tilde{d}_{65} & = - \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\varepsilon_{1} \frac{1}{2} + \tilde{d}_{2} + \tilde{c}_{1} \frac{1}{2}\left( {1 - \varepsilon_{1} \varepsilon_{0}^{\prime } } \right), \\ \tilde{d}_{66} & = \tilde{d}_{1} \varepsilon_{0} + \tilde{d}_{5} , \\ \tilde{d}_{67} & = \tilde{d}_{8} , \\ \tilde{d}_{68} & = \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}\varepsilon_{1} \frac{1}{2} + \tilde{c}_{1} \frac{1}{2}\varepsilon_{1} \varepsilon_{0}^{\prime } , \\ \tilde{d}_{69} & = \tilde{d}_{3} , \\ \tilde{d}_{610} & = \tilde{d}_{6} , \\ \tilde{d}_{611} & = \tilde{d}_{9} . \\ \end{aligned}$$
(34)
Fig. 7
figure 7

Simulation point and discrete grid points used for the sixth case

(7) Case 7

The simulation points in the seventh case are the red points under the slope in Fig. 8. If we use the conventional average-derivative scheme, one discrete grid point is located on the fiction line. The numerical expression at this point is given in “Appendix 1.” The average-derivative difference operators are changed. We derive the new average-derivative scheme. Discrete grid points used by the new scheme are shown in Fig. 8 (the blue and red points). We simplify the new numerical scheme by

$$\left\{ \begin{array}{l} c_{71} u_{r - 1,s} + c_{72} u_{r - 1,s + 1} + c_{73} u_{r,s - 1} + c_{74} u_{r,s} \hfill \\ + c_{75} u_{r,s + 1} + c_{76} u_{r + 1,s - 1} + c_{77} u_{r + 1,s} + c_{78} u_{r + 1,s + 1} \hfill \\ + d_{71} w_{r - 1,s} + d_{72} w_{r - 1,s + 1} + d_{73} w_{r,s - 1} + d_{74} w_{r,s} \hfill \\ + d_{75} w_{r,s + 1} + d_{76} w_{r + 1,s - 1} + d_{77} w_{r + 1,s} + d_{78} w_{r + 1,s + 1} = 0, \hfill \\ \tilde{d}_{71} w_{r - 1,s} + \tilde{d}_{72} w_{r - 1,s + 1} + \tilde{d}_{73} w_{r,s - 1} + \tilde{d}_{74} w_{r,s} \hfill \\ + \tilde{d}_{75} w_{r,s + 1} + \tilde{d}_{76} w_{r + 1,s - 1} + \tilde{d}_{77} w_{r + 1,s} + \tilde{d}_{78} w_{r + 1,s + 1} \hfill \\ + \tilde{c}_{71} u_{r - 1,s} + \tilde{c}_{72} u_{r - 1,s + 1} + \tilde{c}_{73} u_{r,s - 1} + \tilde{c}_{74} u_{r,s} \hfill \\ + \tilde{c}_{75} u_{r,s + 1} + \tilde{c}_{76} u_{r + 1,s - 1} + \tilde{c}_{77} u_{r + 1,s} + \tilde{c}_{78} u_{r + 1,s + 1} = 0, \hfill \\ \end{array} \right.$$
(35)

where

$$\begin{aligned} c_{71} & = c_{1} \left( {1 - \varepsilon_{0}^{\prime } } \right) + c_{4} - d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}, \\ c_{72} & = c_{7} , \\ c_{73} & = c_{1} \varepsilon_{0}^{\prime } + c_{2} + d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}, \\ c_{74} & = c_{5} , \\ c_{75} & = c_{8} , \\ c_{76} & = c_{3} , \\ c_{77} & = c_{6} , \\ c_{78} & = c_{9} , \\ \end{aligned}$$
(36)
$$\begin{aligned} d_{71} & = - c_{1} \frac{1}{2} + d_{1} \left( {1 - \varepsilon_{0}^{\prime } } \right), \\ d_{72} & = d_{3} , \\ d_{73} & = c_{1} \frac{1}{2} + d_{1} \varepsilon_{0}^{\prime } , \\ d_{74} & = 0, \\ d_{75} & = 0, \\ d_{76} & = d_{2} , \\ d_{77} & = 0, \\ d_{78} & = d_{4} , \\ \end{aligned}$$
(37)

and

$$\begin{aligned} \tilde{c}_{71} & = - \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }} + \tilde{c}_{1} \left( {1 - \varepsilon_{0}^{{\prime }} } \right), \\ \tilde{c}_{72} & = \tilde{c}_{3} , \\ \tilde{c}_{73} & = \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }} + \tilde{c}_{1} \varepsilon_{0}^{{\prime }} , \\ \tilde{c}_{74} & = 0, \\ \tilde{c}_{75} & = 0, \\ \tilde{c}_{76} & = \tilde{c}_{2} , \\ \tilde{c}_{77} & = 0, \\ \tilde{c}_{78} & = \tilde{c}_{4} , \\ \end{aligned}$$
(38)
$$\begin{aligned} \tilde{d}_{71} & = \tilde{d}_{1} \left( {1 - \varepsilon_{0}^{\prime } } \right) + \tilde{d}_{4} - \tilde{c}_{1} \frac{1}{2}, \\ \tilde{d}_{72} & = \tilde{d}_{7} , \\ \tilde{d}_{73} & = \tilde{d}_{1} \varepsilon_{0}^{\prime } + \tilde{d}_{2} + \tilde{c}_{1} \frac{1}{2}, \\ \tilde{d}_{74} & = \tilde{d}_{5} , \\ \tilde{d}_{75} & = \tilde{d}_{8} , \\ \tilde{d}_{76} & = \tilde{d}_{3} , \\ \tilde{d}_{77} & = \tilde{d}_{6} , \\ \tilde{d}_{78} & = \tilde{d}_{9} . \\ \end{aligned}$$
(39)
Fig. 8
figure 8

Simulation points and discrete grid points used for the seventh case

(8) Case 8

The simulation point in the eighth case is the point on the slope which is next to the flat-to-slope transition point (Fig. 9). Three discrete grid points are outside the model when using the 9-point scheme. The numerical expressions at these points are given in “Appendix 1.” We derive the new average-derivative scheme by these numerical expressions. Discrete grid points used by the new scheme are shown in Fig. 9 (the blue and red points). We simplify the new numerical scheme by

$$\left\{ \begin{array}{l} c_{81} u_{r - 3,s + 1} + c_{82} u_{r - 2,s + 1} + c_{83} u_{r - 1,s + 1} + c_{84} u_{r,s} \hfill \\ + c_{85} u_{r,s + 1} + c_{86} u_{r + 1,s - 1} + c_{87} u_{r + 1,s} + c_{88} u_{r + 1,s + 1} \hfill \\ + d_{81} w_{r - 3,s + 1} + d_{82} w_{r - 2,s + 1} + d_{83} w_{r - 1,s + 1} + d_{84} w_{r,s} \hfill \\ + d_{85} w_{r,s + 1} + d_{86} w_{r + 1,s - 1} + d_{87} w_{r + 1,s} + d_{88} w_{r + 1,s + 1} = 0, \hfill \\ \tilde{d}_{81} w_{r - 3,s + 1} + \tilde{d}_{82} w_{r - 2,s + 1} + \tilde{d}_{83} w_{r - 1,s + 1} + \tilde{d}_{84} w_{r,s} \hfill \\ + \tilde{d}_{85} w_{r,s + 1} + \tilde{d}_{86} w_{r + 1,s - 1} + \tilde{d}_{87} w_{r + 1,s} + \tilde{d}_{88} w_{r + 1,s + 1} \hfill \\ + \tilde{c}_{81} u_{r - 3,s + 1} + \tilde{c}_{82} u_{r - 2,s + 1} + \tilde{c}_{83} u_{r - 1,s + 1} + \tilde{c}_{84} u_{r,s} \hfill \\ + \tilde{c}_{85} u_{r,s + 1} + \tilde{c}_{86} u_{r + 1,s - 1} + \tilde{c}_{87} u_{r + 1,s} + \tilde{c}_{88} u_{r + 1,s + 1} = 0, \hfill \\ \end{array} \right.$$
(40)

where

$$\begin{aligned} c_{81} & = c_{4} \frac{1}{2}(1 - \varepsilon_{1} )\frac{{\lambda_{r - 2,s + 1} }}{{\eta_{r - 2,s + 1} }}\frac{\Delta z}{2\Delta x}, \\ c_{82} & = 0, \\ c_{83} & = c_{4} \left[ {(1 - \varepsilon_{0} ) - \frac{1}{2}(1 - \varepsilon_{1} )\frac{{\lambda_{r - 2,s + 1} }}{{\eta_{r - 2,s + 1} }}\frac{\Delta z}{2\Delta x}} \right] + c_{7} - d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}, \\ c_{84} & = c_{1} + c_{2} (1 - \varepsilon_{0}^{\prime } ) - c_{4} \frac{1}{2}\varepsilon_{1} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }} + c_{5} , \\ c_{85} & = c_{4} \varepsilon_{0} + c_{8} , \\ c_{86} & = c_{2} \varepsilon_{0}^{\prime } + c_{3} + c_{4} \frac{1}{2}\varepsilon_{1} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }} + d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}, \\ c_{87} & = c_{6} , \\ c_{88} & = c_{9} , \\ \end{aligned}$$
(41)
$$\begin{aligned} d_{81} & = 0, \\ d_{82} & = - c_{4} \frac{1}{2}, \\ d_{83} & = - c_{1} \frac{1}{2} + d_{3} , \\ d_{84} & = - c_{2} \frac{1}{2} + c_{4} \frac{1}{2}\left( {1 - \varepsilon_{1} \varepsilon_{0}^{\prime } } \right) + d_{1} , \\ d_{85} & = 0, \\ d_{86} & = c_{1} \frac{1}{2} + c_{2} \frac{1}{2} + c_{4} \frac{1}{2}\varepsilon_{1} \varepsilon_{0}^{\prime } + d_{2} , \\ d_{87} & = 0, \\ d_{88} & = d_{4} , \\ \end{aligned}$$
(42)

and

$$\begin{aligned} \tilde{c}_{81} & = 0, \\ \tilde{c}_{82} & = - \tilde{d}_{4} \frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}, \\ \tilde{c}_{83} & = - \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }} + \tilde{c}_{3} , \\ \tilde{c}_{84} & = - \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }} + \tilde{d}_{4} \frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\left( {1 - \varepsilon_{1} \varepsilon_{0}^{\prime } } \right) + \tilde{c}_{1} , \\ \tilde{c}_{85} & = 0, \\ \tilde{c}_{86} & = \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }} + \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }} + \tilde{d}_{4} \frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\varepsilon_{1} \varepsilon_{0}^{\prime } + \tilde{c}_{2} , \\ \tilde{c}_{87} & = 0, \\ \tilde{c}_{88} & = \tilde{c}_{4} , \\ \end{aligned}$$
(43)
$$\begin{aligned} \tilde{d}_{81} & = \tilde{d}_{4} \frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}(1 - \varepsilon_{1} )\frac{\Delta z}{2\Delta x}, \\ \tilde{d}_{82} & = 0, \\ \tilde{d}_{83} & = \tilde{d}_{4} \left[ {(1 - \varepsilon_{0} ) - \frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}(1 - \varepsilon_{1} )\frac{\Delta z}{2\Delta x}} \right] + \tilde{d}_{7} - \tilde{c}_{1} \frac{1}{2}, \\ \tilde{d}_{84} & = \tilde{d}_{1} + \tilde{d}_{2} \left( {1 - \varepsilon_{0}^{\prime } } \right) - \tilde{d}_{4} \frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\varepsilon_{1} \frac{1}{2} + \tilde{d}_{5} , \\ \tilde{d}_{85} & = \tilde{d}_{4} \varepsilon_{0} + \tilde{d}_{8} , \\ \tilde{d}_{86} & = \tilde{d}_{2} \varepsilon_{0}^{\prime } + \tilde{d}_{3} + \tilde{d}_{4} \frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }}\varepsilon_{1} \frac{1}{2} + \tilde{c}_{1} \frac{1}{2}, \\ \tilde{d}_{87} & = \tilde{d}_{6} , \\ \tilde{d}_{88} & = \tilde{d}_{9} . \\ \end{aligned}$$
(44)
Fig. 9
figure 9

Simulation point and discrete grid points used for the eighth case

(9) Case 9

The simulation points in the ninth case are points on the slope in Fig. 10. There are three discrete grid points outside the model when using the 9-point scheme. The numerical expressions at these points are introduced in “Appendix 1.” With these numerical expressions, we derive the new average-derivative scheme. The average-derivative difference operators are changed. Discrete grid points we used are shown in Fig. 10 (the blue and red points). We simplify the new numerical scheme by

$$\left\{ \begin{array}{l} c_{91} u_{r - 1,s + 1} + c_{92} u_{r,s} + c_{93} u_{r,s + 1} + c_{94} u_{r + 1,s - 1} + c_{95} u_{r + 1,s} + c_{96} u_{r + 1,s + 1} \hfill \\ + d_{91} w_{r - 1,s + 1} + d_{92} w_{r,s} + d_{93} w_{r,s + 1} + d_{94} w_{r + 1,s - 1} + d_{95} w_{r + 1,s} + d_{96} w_{r + 1,s + 1} = 0, \hfill \\ \tilde{d}_{91} w_{r - 1,s + 1} + \tilde{d}_{92} w_{r,s} + \tilde{d}_{93} w_{r,s + 1} + \tilde{d}_{94} w_{r + 1,s - 1} + \tilde{d}_{95} w_{r + 1,s} + \tilde{d}_{96} w_{r + 1,s + 1} \hfill \\ + \tilde{c}_{91} u_{r - 1,s + 1} + \tilde{c}_{92} u_{r,s} + \tilde{c}_{93} u_{r,s + 1} + \tilde{c}_{94} u_{r + 1,s - 1} + \tilde{c}_{95} u_{r + 1,s} + \tilde{c}_{96} u_{r + 1,s + 1} = 0, \hfill \\ \end{array} \right.$$
(45)

where

$$\begin{aligned} c_{91} & = c_{4} \left( {1 - \varepsilon_{0}^{{\prime }} } \right) + c_{7} - d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}, \\ c_{92} & = c_{1} + c_{2} \left( {1 - \varepsilon_{0}^{{\prime }} } \right) + c_{4} \varepsilon_{0}^{{\prime }} + c_{5} , \\ c_{93} & = c_{8} , \\ c_{94} & = c_{2} \varepsilon_{0}^{{\prime }} + c_{3} + d_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }}, \\ c_{95} & = c_{6} , \\ c_{96} & = c_{9} , \\ \end{aligned}$$
(46)
$$\begin{aligned} d_{91} & = - c_{1} \frac{1}{2} - c_{4} \frac{1}{2} + d_{3} , \\ d_{92} & = - c_{2} \frac{1}{2} + c_{4} \frac{1}{2} + d_{1} , \\ d_{93} & = 0, \\ d_{94} & = c_{1} \frac{1}{2} + c_{2} \frac{1}{2} + d_{2} , \\ d_{95} & = 0, \\ d_{96} & = d_{4} , \\ \end{aligned}$$
(47)

and

$$\begin{aligned} \tilde{c}_{91} & = - \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }} - \tilde{d}_{4} \frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }} + \tilde{c}_{3} , \\ \tilde{c}_{92} & = - \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }} + \tilde{d}_{4} \frac{1}{2}\frac{{\lambda_{r - 1,s} }}{{\eta_{r - 1,s} }} + \tilde{c}_{1} , \\ \tilde{c}_{93} & = 0, \\ \tilde{c}_{94} & = \tilde{d}_{1} \frac{1}{2}\frac{{\lambda_{r - 1,s - 1} }}{{\eta_{r - 1,s - 1} }} + \tilde{d}_{2} \frac{1}{2}\frac{{\lambda_{r,s - 1} }}{{\eta_{r,s - 1} }} + \tilde{c}_{2} , \\ \tilde{c}_{95} & = 0, \\ \tilde{c}_{96} & = \tilde{c}_{4} , \\ \end{aligned}$$
(48)
$$\begin{aligned} \tilde{d}_{91} & = \tilde{d}_{4} \left( {1 - \varepsilon_{0}^{\prime } } \right) + \tilde{d}_{7} - \tilde{c}_{1} \frac{1}{2}, \\ \tilde{d}_{92} & = \tilde{d}_{1} + \tilde{d}_{2} \left( {1 - \varepsilon_{0}^{\prime } } \right) + \tilde{d}_{4} \varepsilon_{0}^{\prime } + \tilde{d}_{5} , \\ \tilde{d}_{93} & = \tilde{d}_{8} , \\ \tilde{d}_{94} & = \tilde{d}_{2} \varepsilon_{0}^{\prime } + \tilde{d}_{3} + \tilde{c}_{1} \frac{1}{2}, \\ \tilde{d}_{95} & = \tilde{d}_{6} , \\ \tilde{d}_{96} & = \tilde{d}_{9} . \\ \end{aligned}$$
(49)
Fig. 10
figure 10

Simulation points and discrete grid points used for the ninth case

Feasibility analysis

To test the feasibility of our method, we design a model with a simple irregular free surface. There is a 45° slope on the free surface. The dimensions of the model are 2.5 km × 2.0 km with the grid spacing of ∆x = ∆z = 2.5 m. The two transition points of the free surface are at (0.3 km, 1.25 km) and (0 km, 1.55 km), respectively. Two flats are located at depth 0.3 km and 0 km, respectively (Fig. 11). Except for the free surface, the remaining three boundaries are handled with the PML boundary conditions. The velocities of the P-wave and S-wave are 3500 m/s, and 2020.7 m/s, respectively. We use a density of 2000 kg/m3 and a Poisson ratio of 0.25. Here, we use a point source applied to the vertical displacement at (0.4 km, 1.75 km). The source function is the Ricker wavelet with a peak frequency of 30 Hz.

Fig. 11
figure 11

A 2D homogeneous model with a slope free surface. Inverted triangles on the free surface represent the receivers R1 and R2

Figure 12 shows the frequency-domain seismic wave field for the frequency of 19.1 Hz. It involves two components of the real part of displacement, namely horizontal (Fig. 12a) and vertical (Fig. 12b). The elastic wave field for the model with irregular surface can be simulated by our method. Figure 13 shows the particle displacement at receivers as shown in Fig. 11. The symbols P, S and R in Fig. 13 represent the P-wave, S-wave and Rayleigh wave, respectively. From Fig. 13a, only the P-wave and Rayleigh wave can be recognized. The reason why the S-wave cannot be recognized at a small offset is that travel times of the S-wave and Rayleigh wave are approximate and the energy of Rayleigh wave is much stronger than S-wave. At a large offset, we can recognize the P-wave, S-wave and Rayleigh wave in Fig. 13b. The disturbance in the seismograms calculated by our method and Jih’s time-domain method may be caused by artificial diffraction produced at the corner. The tiny disturbance has no impact for us to obtain the conclusion. The results in Fig. 13 are computed by our method and Jih’s time-domain method. These two results agree with each other well. The good agreement with Jih’s time-domain solution demonstrates the feasibility of our method.

Fig. 12
figure 12

Elastic wave field at frequency 19.1 Hz. a Horizontal component and b vertical component

Fig. 13
figure 13

Seismograms at different receivers: a the receiver R1 and b the receiver R2. Green line and blue line represent the results computed by our frequency-domain method plus Fourier transformation and Jih’s time-domain method, respectively

Figure 14 shows the structure of the impedance matrix when using the rigid boundary condition. The rigid boundary condition means that the displacements are zero on the fiction line. In order to describe the structure clearly, we rebuild a model similar to Fig. 11 except for the size. As we know, nonzero entries distribute on the diagonal of the impedance matrix when modeling with the flat free surface. According to Fig. 14a, entries along the diagonal are still nonzero. Figure 14b and c shows the structure in some parts in detail. We can see that the shape of the free surface has influence on the distribution of nonzero entries. Figure 15a is the structure of the matrix when using the free-surface boundary condition. Nonzero entries are still along the diagonals. Figure 15b and c shows the details of some parts of the matrix. Compared to Fig. 14, Fig. 15 shows that the matrix structure is affected not only by the shape of topographies but also by the discretization of the wave equation on the free surface.

Fig. 14
figure 14

Impedance matrix structure with the ridged boundary condition. a Distribution of the nonzero entries in the whole matrix, b distribution of the nonzero entries in the red rectangle and c distribution of the nonzero entries in the green rectangle

Fig. 15
figure 15

Impedance matrix structure with the free-surface boundary condition. a Distribution of the nonzero entries in the whole matrix, b distribution of the nonzero entries in the red rectangle and c distribution of the nonzero entries in the green rectangle

Numerical examples

We now perform numerical experiments on models with a more complex free surface. First, we build a model with irregular topography similar to a valley. Figure 16 shows the model. The dimensions of the model are also 2.5 km × 2.0 km, and the spatial intervals ∆x and ∆z are both 2.5 m. We place four transition points separately at (0 km, 0.7 km), (0.3 km, 1 km), (0.3 km, 1.5 km) and (0 km, 1.8 km). The depths of three flats are 0 km, 0.3 km and 0 km, respectively. The other three boundaries are still dealt with the PML boundary conditions. The P-wave velocity, the S-wave velocity, the Poisson ratio and the density are still 3500 m/s, 2020.7 m/s, 0.25 and 2000 kg/m3, respectively. The point source applied to the vertical displacement is at (0.4 km, 0.6 km), and the source signal is the Ricker wavelet with a peak frequency of 30 Hz.

Fig. 16
figure 16

A 2D homogeneous model with a valley-shaped free surface. Receivers R1, R2 and R3 are denoted by reversed triangles

For the frequency of 19.1 Hz, we show the \(u\) (Fig. 17a) and \(w\) (Fig. 17b) components of the displacements. To validate our method, we extract particle displacement at receivers shown in Fig. 16. Figures 18a–c shows the results at receivers R1–R3, respectively. From Fig. 18, we observe that the P-wave, S-wave and Rayleigh wave are simulated clearly using our method. They are indicated by arrows in Fig. 18. There is a little tiny disturbance in the seismograms calculated by our method and Jih’s time-domain method. They are caused by the artificial diffraction at corners probably. The tiny disturbance has no impact for us to obtain the conclusion. We also make a comparison between our method and Jih’s time-domain method (Fig. 18). According to the comparison between the green line and the blue line at all receivers, computation result with our method can match the result of Jih’s time-domain method very well except for the tiny amplitude error at peak position which is caused by different numerical schemes. This test proves that our method is also available to a more complex topography.

Fig. 17
figure 17

Elastic wave field at frequency 19.1 Hz. a Horizontal component and b vertical component

Fig. 18
figure 18

Seismograms at receivers R1–R3: a receiver R1; b receiver R2; c receiver R3. Green line and blue line represent the results computed by our frequency-domain method plus Fourier transformation and Jih’s time-domain method, respectively

To be close to the real terrain, we build a more complex free surface with both a valley and a ridge. This model is shown in Fig. 19. The size is still 2.5 km × 2.0 km with a grid interval of 2.5 m. There are eight transition points, and their positions are (0.05 km, 0.4 km), (0 km, 0.45 km), (0 km, 0.85 km), (0.05 km, 0.9 km), (0.05 km, 1.5 km), (0.1 km, 1.55 km), (0.1 km, 2.05 km) and (0.05 km, 2.1 km), respectively. The depths of three kinds of flat surfaces are 0 km, 0.05 km and 0.1 km, respectively. The P-wave velocity and the density are still 3500 m/s and 2000 kg/m3. The Poisson ratio is 0.25 and the corresponding S-wave velocity is 2020.7 m/s. The source time function is expressed by Ricker wavelet with 30 Hz as the peak frequency. The position of the point source applied to the vertical displacement is changed to (0.15 km, 0.5 km).

Fig. 19
figure 19

A 2D homogeneous model with a valley-ridge-shaped free surface. The reversed triangle denotes the receiver R1

For comparison, we still simulate the wave field at the frequency of 19.1 Hz. Figure 20 shows the horizontal and vertical components of the displacements. To provide more information, we extract particle displacement at R1 in Fig. 19. The P-wave, S-wave and Rayleigh wave are indicated by arrows in Fig. 21. They are still simulated successfully by our method for more complicated irregular free surface. From Fig. 21, it can be seen that a good agreement between the results of the proposed method and Jih’s time-domain method is achieved, especially for the phases. Therefore, the feasibility of the proposed method is approved in the modeling case of complex irregular topography. The tiny amplitude errors at the peak have no impact for us to demonstrate that our method can be applied with complex topographies.

Fig. 20
figure 20

Elastic wave field at frequency 19.1 Hz. a Horizontal component and b vertical component

Fig. 21
figure 21

Seismograms at receiver R1. Green line and blue line represent the results computed by our frequency-domain method plus Fourier transformation and Jih’s time-domain method, respectively

Conclusion

Based on a local rotated coordinate method and an average-derivative optimal approach, we proposed a new average-derivative scheme for implementing the irregular topography in the frequency domain. This technique specifies the treatment to the polygonal topography. We illustrated the idea of our method by a simple model with a 45° slope. The irregular free surface is decomposed into nine parts. We generalized the conventional average-derivative difference operator to the rotated coordinate aligned with the irregular free surface using a local rotated coordinate method and derived new average-derivative difference schemes on irregular topography in the frequency domain. Numerical experiments with this simple model demonstrate the feasibility of our method. We analyzed the factors affecting the structure of impedance matrix. These factors include the shape of the free surface and the format of discrete equations. We further demonstrated the effectiveness of our method with more complicated topographies. The conventional average-derivative optimal method is an accurate frequency-domain simulation scheme with a relatively low computational cost. Previously, it can only be applied to models with a horizontal free surface. Using our new scheme, the average-derivative optimal method can be applied to models with an irregular free surface.