Keywords

1 Introduction

Wave propagation problems often require solutions that are accurate in the far-field and for longer periods. In such situations, it is imperative to simulate flows resolving a wide range of spatial and temporal scales. For example, the challenging areas of direct numerical simulation (DNS) and large eddy simulation (LES) of turbulence, aeroacoustics, and fluid-structure interactions (FSI) could be cited. The severe computational requirements of such processes might be mitigated by adopting a highly accurate dispersion error-free numerical method. In this context, compact schemes offer an attractive choice because of their spectral like resolution [1]. These schemes offer higher order approximations to differential operators using compact stencils and implicitly relate various function values and their derivatives at discrete nodes. Compact discretizations are known to carry higher spectral resolution compared to the explicit methods. Although implicit they often lead to a diagonally dominant banded system. Indeed compact schemes leading to the tridiagonal system are most favoured because of their obvious computational advantages. Although compact schemes employ a stencil with fewer grid points, their implicit nature can involve a large number of points in the domain thereby making such schemes attractive.

Traditionally compact schemes are of central type [1, 2]. As such these schemes carry no dissipation error but do carry significant dispersion error [3]. Central compact schemes applied to problems with periodic boundary conditions are indeed efficient. However, for practical problems, periodic boundary conditions are often absent and one-sided approximations are required for boundary points. This forced upwinding near boundaries render instability to the entire discretization process [4]. Thus many a time convection dominated flow requires extra filtering or added numerical dissipation [3]. On the other hand, upwind biased compact schemes are seen to be robust and are used for the Navier-Stokes equation with great success [3,4,5,6]. The upwind biased nature of the compact scheme invariably introduces numerical dissipation and is found enough to control aliasing error [3]. Here it is important to remember that good quality numerical solutions schemes should not only resolve all scales present in the flow but also adequately capture the physical propagation speed of the individually resolved scales. Failure might lead to an extreme form of dispersion error often seen as unphysical q-waves. In this context importance of dispersion relation preservation (DRP) in conjunction with high accuracy approximations for acoustic problems are well documented [7].

In the last two decades development of upwind compact schemes to simulate fluid flow problems has seen significant attention. Among them, the works of Zhong [3], Sengupta et al. [4], and Bhumkar et al. [6] deserve special mention. The higher order compact finite-difference schemes developed by Zhong [3] were found to be stable and were less dissipative than a straightforward upwind scheme developed using an upwind-biased grid stencil. But in this work, the author did not attempt to optimize the scheme developed for interior as well as boundary closures. Sengupta et al. [4] analyzed various upwind compact schemes for spatial discretization and highlighted the importance of boundary closure for the overall stability of the scheme. The authors further suggested special boundary treatment to avoid the stability shortcomings of the schemes. Bhumkar et al. [6] stressed the importance of dispersion relation preserving nature of upwind compact schemes for good quality numerical simulation. They optimally reduced dispersion error and worked with varied stencils of lengths three to thirteen. But the authors dealt with wavenumber range \([0, 7\pi /8]\) instead of requisite range \([0, \pi ]\). Further, the work made little effort to derive stable and compatible boundary closures.

Issue of stability of various inner and boundary schemes was deliberated by Gustafsson, Kreiss, and Sundström [8]. The technique referred to as G-K-S stability theory provides conditions that schemes must satisfy to ensure stability. But its application to fully discrete higher order schemes with multistage time integration is highly involved [3, 9]. On the other hand, application to a semi-discrete hyperbolic system is easier. Unfortunately, a disturbing feature of this stability definition is that the solution need not remain bounded for all time, even though the actual solution remains bounded. The definition only ensures that the error remains uniformly bounded by an exponential amount for all time [9, 10]. Thus simulation resulting from such a scheme might lead to unstable modes in the numerical solution to dominate after a sufficiently long time and was amply demonstrated by Carpenter et al. [9]. Carpenter et al. [9] showed that the asymptotic stability of the upwind schemes with numerical boundary closures is necessary for the stability of long time numerical integration. This procedure requires that the eigenvalues of the spatial discretization matrices contain no positive real parts. Numerical computations often reveal that the matrices for compact upwind schemes with boundary conditions carry a full set of eigenvalues thereby elevating any further need of eigenvalue analysis.

In this work, we develop a new upwind compact scheme that employs a stencil of size three and is third order accurate. The scheme is termed (3, 3) as it discretizes spatial derivative at a nodal point using functional value at three grid points and its gradients also at those three points. The scheme thus developed is supplemented by newly developed boundary closures which render the scheme globally third order accurate. As our main motivation is to arrive at a scheme efficient for long time simulation in situations involving convection and diffusion we carry out asymptotically stability analysis of the scheme. Finally, numerical investigation help establish the efficiency of the newly proposed algorithm. All computations are done using in-house C-codes run on a system supported by Intel Core i3 processor with 4 GB RAM.

2 Upwind Compact Spatial Discretization

The model equation often used in deriving the upwind schemes is the linear wave equation

$$\begin{aligned} \frac{\partial u}{\partial t}+c\frac{\partial u}{\partial x}=0,\;\;\; a\le x \le b,\;\;\;t>0, \;\;\;c>0. \end{aligned}$$
(1)

This equation is complemented with the Dirichlet boundary condition

$$\begin{aligned} u(a,t)=g(t), \end{aligned}$$
(2)

and initial condition

$$\begin{aligned} u(x,0)=f(x). \end{aligned}$$
(3)

Traditionally first order spatial derivative in Eq. (1) at an interior grid point say jth node with uniform grid spacing h can compactly be approximated as

$$\begin{aligned} \sum _{l=-M}^{M}b_lu'_{j+l}=\frac{1}{h}\sum _{l=-N}^{N}a_lu_{j+l}, \end{aligned}$$
(4)

where \(u'_j\) is the numerical approximation of \((\partial u/\partial x)_j\). Compact schemes are known to attain higher spectral resolution on a coarser mesh. The scheme here uses a total of \(2M+1\) and \(2N+1\) grid points on left and right respectively leading to a banded system of equations with bandwidth \(2M+1\). In this study, we are interested to estimate gradients using only the adjacent grid points. Such a choice is inherently advantageous as it leads to a tridiagonal system and is computationally efficient. Thus in our case \(M=1=N\) leading to (3, 3) system. The system is given by the Eq. (4) and is often expressed in linear algebraic form

$$\begin{aligned} \boldsymbol{M}_1\boldsymbol{u}' = \frac{1}{h} \boldsymbol{M}_2\boldsymbol{u} \end{aligned}$$
(5)

where \(\boldsymbol{u}=(u_0, u_1, ..., u_n)^T\). We strive to evaluate the coefficients \(a_l\) and \(b_l\) of the upwind schemes in such a manner that the order of the schemes is one less than the maximum achievable order of the central stencil. Thus opting to go with third order accuracy and hence we are left with a free parameter called \(\varrho \). This free parameter is set as the coefficient of the leading truncation term i.e.

(6)

Equation (6) contains five unknowns, namely \(b_{-1},\; b_{1},\; a_{-1},\; a_{0},\; a_{1}\). For uniqueness \(b_0\) is set to unity. One needs five equations to obtain these coefficients. By using the Taylor series expansion and equating the coefficients upto third order on both sides of Eq. (6) we get,

$$\begin{aligned} a_{-1}+a_{0}+a_{1}=0,\end{aligned}$$
(7)
$$\begin{aligned} -a_{-1}+a_{1}-b_{-1}-b_{1}=1,\end{aligned}$$
(8)
$$\begin{aligned} a_{-1}+a_{1}+2b_{-1}-2b_{1}=0,\end{aligned}$$
(9)
$$\begin{aligned} -a_{-1}+a_{1}-3b_{-1}-3b_{1}=0,\end{aligned}$$
(10)
$$\begin{aligned} a_{-1}+a_{1}+4b_{-1}-4b_{1}=\varrho . \end{aligned}$$
(11)

In terms of \(\varrho \) the other coefficients are given by

$$\begin{aligned} b_{\pm 1}=\mp \frac{\varrho }{4} + \frac{1}{4},\;\;\;a_{\pm 1}=-\frac{\varrho }{2}\pm \frac{3}{4},\;\;\; a_{0}=\varrho . \end{aligned}$$
(12)

We intend to choose \(\varrho \) in such a manner that the associated upwind scheme carries minimum dispersion error. Subsequent to the work of Haras and Ta’asan [11] we start by taking \(u_j=e^{I \omega (jh)}\) in the Eq. (4) and obtain

$$\begin{aligned} I\omega _{eq} h (b_{-1} e^{-I\omega h}+1+b_{1} e^{I\omega h})=(a_{-1} e^{-I\omega h}+ a_{0} +a_{1} e^{I\omega h}) \end{aligned}$$
(13)

where \(\omega \) and \(\omega _{eq}\) are the exact and approximate wavenumber respectively. In general, \(\omega _{eq}\) is a complex quantity and its difference from \(\omega \) could be minimized over wavenumber domain \([-\pi , \pi ]\). Subsequently, the expression for the real part of \(\omega _{eq}\) denoted here as \(Re[\omega _{eq} h]\) is used to define error function E as

$$\begin{aligned} E=\int _{-\pi }^{\pi }(\omega h - Re[\omega _{eq} h])^2 |u_0(\omega h)|^2 d(\omega h). \end{aligned}$$
(14)

Here \(u_0\) is the weight function and we are inclined to work with \(u_0(\omega h)=e^{-\omega ^2 h^2}\) as such a choice entails a higher emphasis on smaller values of \(\omega h\). Thus the error function in terms of \(\varrho \) is

$$\begin{aligned} E=\int _{-\pi }^{\pi }\left[ \frac{2\varrho \sin x(\varrho -\varrho \cos x)+3\sin x(2+\cos x)}{\varrho ^2\sin ^2 x+(2+\cos x)^2}-x\right] ^2 e^{-2 x^2} dx. \end{aligned}$$
(15)

We minimize the dispersion error function E with respect to \(\varrho \) and obtain \(\varrho =0.8300949493\) as the point of minima. The corresponding value of the other coefficients is given in Table 1 leading to compact upwind discretization for interior nodes. On the other hand choice, \(\varrho =0\) leads to central fourth order Padé scheme.

Table 1. Third order low dispersion upwind compact scheme.

2.1 Boundary Formulation

Considering that there are \(n+1\) grid points \(j = 0, 1, ..., n\) laid out in one direction, it is imperative to develop independent and adequate boundary closures for the two extreme nodes. Our scheme being (3, 3) the discretization developed earlier could be implemented at all other nodes. We present below the procedure adopted to obtain closure at \(j=0\). This approximation is proposed to be obtained from a relation of the form

$$\begin{aligned} u'_{0}+b_{1}u'_{1}=\frac{1}{h}(a_{0} u_{0}+a_{1} u_{1}+a_{2} u_{2}+a_{3} u_{3}) \end{aligned}$$
(16)

to preserve the overall tridiagonal nature and third order truncation error of the system. Introducing additional free parameter and writing the modified differential equation as discussed earlier for the interior nodes the constraints satisfying third order accuracy here are

$$\begin{aligned} a_{0}+a_{1}+a_{2}+a_{3}=0,\end{aligned}$$
(17)
$$\begin{aligned} a_{1}+2a_{2}+3a_{3}-b_{1}=1,\end{aligned}$$
(18)
$$\begin{aligned} a_{1}+4a_{2}+9a_{3}-2b_{1}=0,\end{aligned}$$
(19)
$$\begin{aligned} a_{1}+8a_{2}+27a_{3}-3b_{1}=0,\end{aligned}$$
(20)
$$\begin{aligned} a_{1}+16a_{2}+81a_{3}-4b_{1}=\varrho . \end{aligned}$$
(21)

In terms of \(\varrho \), the other coefficients are given by

(22)

Subsequently the error function E in terms of \(\varrho \) for the scheme in Eq. (16) is

(23)

As earlier minimization of the error function with respect to \(\varrho \) leads to \(\varrho =1.7297342886\). The corresponding value of the other coefficients is given in Table 1. Note that the closure at \(j=n\) is the mirror image of the above procedure and hence its derivation is avoided. Nevertheless, the coefficients could be found in Table 1.

2.2 Stability

As compact finite difference schemes require additional approximations at grid points near the boundaries of the computational domain its analysis should invariably include boundary closures. In this work, we carry out asymptotic stability analysis of the upwind scheme in conjunction with Dirichlet boundary closures by computing the eigenvalues of the matrices obtained by spatial discretization of the wave equation. As we discuss the upwind scheme Neumann boundary condition is not deliberated on [3, 4, 9]. In periodic domain the scheme is automatically stable. The asymptotic stability, which requires that the eigenvalues of the spatial discretization matrices contain no positive real parts, is necessary for the stability of long time integration of the equation. The newly developed low dispersion unwind compact scheme having global third order accuracy can be expressed in compact form as

$$\boldsymbol{M}_1 \boldsymbol{u}'=\frac{1}{h}\boldsymbol{M}_2 \boldsymbol{u}$$

where \(\boldsymbol{M}_1\) and \(\boldsymbol{M}_2\) are \((n+1)\times (n+1)\) matrices with \(\boldsymbol{M}_1\) being tridiagonal. In these two matrices, the first and the last row correspond to the first and the last column of Table 1 whereas the other elements directly correspond to the middle column of the same table. Using the boundary condition the semi-discrete form of the prototype PDE given by Eq. (1) can be expressed as

$$\begin{aligned} \frac{\partial \tilde{\boldsymbol{u}}}{\partial t}+\frac{c}{h}\tilde{\boldsymbol{C}}\tilde{\boldsymbol{u}}+\frac{c}{h}\tilde{\boldsymbol{M}_1}^{-1}\boldsymbol{B} g(t)=0 \end{aligned}$$
(24)

where \( \tilde{\boldsymbol{u}}=(u_1, u_2, ..., u_n)^T\). \(\tilde{\boldsymbol{C}}=\tilde{\boldsymbol{M}_1}^{-1}\tilde{\boldsymbol{M}_2}\) with \(\tilde{\boldsymbol{M}_1}\) and \(\tilde{\boldsymbol{M}_2}\) reduced from \(\boldsymbol{M}_1\) and \(\boldsymbol{M}_2\) on account of boundary condition Eq. (2) being applied. For completeness we report below the matrices \(\tilde{\boldsymbol{M}_1}\) and \(\tilde{\boldsymbol{M}_2}\) as also the vector \(\boldsymbol{B}\).

In the above expressions superscript is used to denote the corresponding boundary nodes related to the first and last column in Table 1. The first row of the vector \(\boldsymbol{B}\) documents dependence of the discretization on the boundary condition. The asymptotic stability condition for the semi-discrete equations requires that all the eigenvalues of the matrix \(-\tilde{\boldsymbol{C}}\) contain no positive real parts. The same computed on an \(81\times 81\) grid is depicted in Fig. 1(a). It is heartening to see that all the eigenvalues of the matrix have negative real parts rendering our newly developed scheme asymptotically stable. Figure 1(b) shows the eigenvalue spectrum for the fourth order Padé scheme (\(\varrho =0\)) with fourth order boundary closure. This figure presented for the sake of comparison clearly shows that there are eigenvalues with positive real part rendering the scheme asymptotically unstable.

3 Numerical Examples

3.1 Problem 1: Propagation of Sinusoidal Wave

Following Carpenter et al. [9] we consider the propagation of sinusoidal wave \(u(x,t)=\sin 2\pi (x-t)\) in the bounded domain \([-1, 1]\). The boundary and initial conditions are

$$\begin{aligned} u(-1,t)= & {} \sin 2\pi (-1-t),\;\; t> 0\end{aligned}$$
(25)
$$\begin{aligned} \mathrm{and}\;\;\;u(x,0)= & {} \sin 2\pi x,\;\;-1\le x\le 1 \end{aligned}$$
(26)

respectively. We have used 41 grid points for computing the solution up to time \(t=60\). For this problem, time is advanced with the fourth order four stage explicit R-K scheme. For spatial discretization apart from newly developed (3, 3) scheme we also use Padé approximation discussed earlier. Simulations are run for CFL numbers (\(N_c\)) 0.25 and 0.5. In Figs. 2(a) and (b) we have plotted time evolution of \(L^2\)-norm error for new (3, 3) scheme. From these figures, we see that error quickly settles down to a periodic profile with a small amplitude implying asymptotic stability of the scheme. In Figs. 3(a) and (b) we have plotted \(L^2\)-norm error for \(N_c=0.25\) and 0.5 computed using fourth order central Padé scheme with fourth order boundary closure. Although theoretically, the schemes carry higher order of accuracy an unbounded error growth is registered for the scheme documenting asymptotically unstable nature of the scheme. This test case establishes the efficiency of the strategy advocated here. A comparison of the CPU time and error reported at \(t=60\) is presented in Table 2. Padé scheme is found to consume CPU time almost four times that of newly developed (3, 3) scheme. This may be attributed to its higher error leading to more iterations for convergence.

Fig. 1.
figure 1

Eigen value spectra (a) New (3, 3) scheme for \(\varrho =0.8300949493\), (b) Fourth order central Padé scheme for \(\varrho =0\).

Table 2. Error and CPU time at \(t=60\).
Fig. 2.
figure 2

Time evolution of \(L^2\)-norm error for new (3, 3) scheme at (a) \(N_c=0.25\), (b) \(N_c=0.5\).

Fig. 3.
figure 3

Time evolution of \(L^2\)-norm error for central Padé scheme at (a) \(N_c=0.25\), (b) \(N_c=0.5\).

3.2 Problem 2: Convection of Wave Combination

Next we consider convection of combination of two waves of wavenumbers \(2\pi k_1\) and \(2\pi k_2\) [12]. The initial condition is given by

$$\begin{aligned} u(x,0)=e^{-\frac{(x-x_m)^2}{b^2}}\times [\cos (2\pi k_1(x-x_m))+\cos (2\pi k_2(x-x_m))] \end{aligned}$$
(27)

where \(x_m=90\), \(b=20\), \(k_1=0.125\) and \(k_2=0.0625\). Solution is computed up to \(t=300\) for \(N_c=0.5\) and 1.0. In this problem, time discretization is carried out using the implicit two stage fourth order Gauss-Legendre scheme (IRK24) [13]. This serves as a test case for the newly developed scheme in conjunction with implicit time discretization. Numerical solutions are shown in Fig. 4. \(L^2\)-norm error between numerical and exact solutions at \(t=300\) is found to be approximately \(4.66\times 10^{-2}\) for both the cases. CPU time for this problem with \(N_c\) values 0.5 and 1.0 is 1.2 s and 0.6 s respectively.

Fig. 4.
figure 4

Numerical solution at \(t=300\) for (a) \(N_c=0.5\), (b) \(N_c=1.0\).

3.3 Problem 3: Convection-Diffusion of Gaussian Pulse

Finally, we study unsteady two-dimensional convection-diffusion equation with zero source term given by

$$\begin{aligned} a\frac{\partial \psi }{\partial t}-\frac{\partial ^2 \psi }{\partial x^2}-\frac{\partial ^2 \psi }{\partial y^2}+c\frac{\partial \psi }{\partial x}+d\frac{\partial \psi }{\partial y}=0. \end{aligned}$$
(28)

We consider a Gaussian pulse in a square domain [0,2] \(\times \) [0,2] following Sen [14] whose analytical solution is

$$\begin{aligned} \psi (x,y,t)=\frac{1}{4t+1}\;\text{ exp }\bigg [-\frac{(ax-ct-0.5a)^2}{a(4t+1)}-\frac{(ay-dt-0.5a)^2}{a(4t+1)}\bigg ]. \end{aligned}$$
(29)

Initially, the Gaussian pulse is centered at (0.5, 0.5) with pulse height 1. Dirichlet boundary conditions are used for this problem along all boundaries. The usual procedure to approximate the diffusion terms \(\psi _{xx}\) and \(\psi _{yy}\) is to use explicit central differencing. Such a technique lead to loss of high accuracy of the discretized governing equation, which is achieved by the compact schemes on the convective terms. Further, as we emphasize dispersion error reduction it is important to employ a suitable discretization for the diffusion terms. Recently Sen [14] developed a central compact fourth order discretization for second order derivative. This approximation was found to carry good numerical dispersion and dissipation characteristics. Further, it uses functional values and their gradients in a three-point stencil. Hence the strategy developed by Sen [14] is seen to be particularly suitable in this context. Of course, to compute \(\psi _{x}\) and \(\psi _{y}\), we employ the newly developed (3, 3) scheme. Time advancing is carried out with the implicit Crank-Nicolson method. For this simulation convection coefficients are fixed at \(c=d=80\) with \(a=100\). Computations are done for three different grids \(21\times 21\), \(41\times 41\), and \(81\times 81\). Errors in \(L_1, L_2\), and \(L_{\infty }\) norms at time \(t=0.5\) and \(t=1.0\) are shown in Table 3. In this table, we also present CPU time. With grid size decreasing by a factor of two the associated algebraic system increasing by a factor of four. Additionally, as the temporal step is reduced by a factor of four, CPU time as expected increases by a factor of sixteen. In Fig. 5 we compare the analytical solution with the solution computed using the newly developed scheme in the region \(0.8\le x,y\le 1.8\). An excellent comparison can be seen in this figure.

Table 3. \(L_1, L_2\) and \(L_{\infty }\)-norm error and CPU time with \(\delta t=h^2=k^2\).
Fig. 5.
figure 5

Comparison of numerical (solid, blue) and analytical (dashed, red) contour at \(t=1.0\). (Color figure online)

4 Conclusion

In this work, we have developed a new (3, 3) dispersion relation preserving third order optimized upwind compact scheme. The scheme is obtained by minimizing phase error over the entire wavenumber range. Subsequently, the boundary closures with optimum dispersion accuracy are also developed. Overall the scheme is found to be asymptotically stable. Three numerical tests are envisaged to illustrate the importance of dispersion relation preserving character and stability of the newly developed spatial discretization. They duly demonstrate the efficiency and accuracy of the scheme proposed.