COMPUTATIONAL METHODS IN ENGINEERING AND SCIENCE EPMESC X, Aug. 21-23, 2006, Sanya, Hainan, China ©2006 Tsinghua University Press & Springer A High Order Compact Difference Scheme for Solving the Unsteady Convection-Diffusion Equation Z. H. Xie*, J. G. Lin, J. T. Zhou College of Environmental Science and Engineering, Dalian Maritime University, Dalian, 116026 China Email: [email protected] Abstract A high order compact difference scheme based on the fourth order compact difference scheme in spatial discretization and the fourth order Runge-Kutta method in time integration is proposed for the numerical simulation of the unsteady convection-diffusion equation. The validity and effectiveness of the proposed method is tested by three application examples for a two-dimensional convection-diffusion problem with a Gaussian type pulse, a two-dimensional non-linear Burgers equation and the Taylor’s vortex problem. It is shown that the results obtained by proposed method agree very well with the analytical solutions and the proposed scheme is not only simple to implement and economical to use, but also is effective to simulate transport problems. Key words: convection-diffusion equations, Burgers equation, high order compact difference method, 2D, Taylor vortex INTRODUCTION In practical engineering applications, convection diffusion equations are generally used to describe the transport processes involving fluid motion, heat transfer, astrophysics, oceanography, meteorology, semiconductors, hydraulics, pollutant & sediment transport and chemical engineering. Various numerical finite difference schemes have been proposed to solve convection-diffusion problems approximately. There are two mainly numerical methods for Computational Fluid Dynamics(CFD) to solve the convection diffusion equations with respect to the temporal discretization, one is the explicit algorithm and the other is the implicit algorithm. Implicit schemes often exhibit unconditional stability for governing equations, but involve more complex code, more computational time and storage per iteration. Explicit schemes are usually conditionally stable, but are relatively easy to program, require less computational time and storage per iteration. To achieve higher spatial accuracy, recently, the high order compact schemes have been widely utilized for spatial discretizations. Lele [1] went through an extensive analysis of compact schemes and applied them for solution of compressible and incompressible flow problems. Afterward, Chu and Fan [2] derived sixth-order and eighth-order three point combined compact finite difference schemes based on the local and global Hermite polynomials interpolation. Mahesh [3] extended the derivation of Chu and Fan [2] to more than three point stencil and presented combined compact uniform grid finite difference schemes which evaluate both the first and the second derivative simultaneously. Hixon [4] proposed a family of small-stencil compact schemes based on a prefactorization method to reduce a non-dissipative central-difference stencil to two lower-order biased stencils which have easily solved reduced matrices. At the same time, Tolstykh and Lipavskii [5], Ma et al [6] developed the third and fifth-order upwind compact difference schemes. Ma and Fu [7] presented the super compact finite difference method which evaluates all the derivatives simultaneously. Boersma [8] presented the stagger compact schemes. From what has been discussed above, it is shown that all the present compact schemes are implicit and consider as unknowns at each discretization point not only the value of the function but also those of its first or higher derivatives. They will need more computational costs and are not considered as the exactly compact small-stencil schemes which only need three-point stencil. In this paper, a three-point explicit compact difference scheme is proposed. The present scheme employs the fourth-order accurate approximations for the first and second derivatives in the convection-diffusion equation and ⎯ 231 ⎯ coupling with the fourth-order Runge-Kutta method in time integration. Through the three application examples for a two-dimensional convection-diffusion problem with a Gaussian type pulse, a two-dimensional non-linear Burgers equation and the Taylor’s vortex problem, it is found that the proposed scheme is not only simple to implement and economical to use, but also is effective to simulate transport problems. GOVERNING EQUATION AND THE NUMERICAL METHOD 1. Governing equation The unsteady convection-diffusion equation for a variable φ in two-dimensional space can be written as ∂φ ∂φ ∂φ ∂ 2φ ∂ 2φ = −c x − cy + εx 2 + εy 2 , ∂t ∂x ∂y ∂x ∂y φ (0, x, y ) = φ0 ( x, y ), ( x, y ) ∈ Ω aφ + b ∂φ = f (t , x, y ), ∂n ( x, y ) ∈ Ω × (0, T ] (1) ( x, y ) ∈ ∂Ω, t ∈ (0, T ] where Ω is a rectangular domain, (0,T ] is the time interval, and φ0 and f are the initial and boundary conditions. a and b are arbitrary coefficient describing the boundary condition as a Dirichlet, Neumann or Robin type in the boundary normal direction n . cx ( y ) and ε x ( y ) denote the convection velocity and viscosity in the x( y ) -direction, respectively. 2. Spatial discretization A high order three-point explicit compact difference scheme is used to approximate the spatial derivatives of the vorticity transport equation. We first introduce the following operators: φi +1, j − φi −1, j d xφi , j = 2 , d yφi , j = φi , j +1 − φi , j −1 2 , d xxφi , j = φi +1, j + φi −1, j − 2φi , j , d yyφi , j = φi , j +1 + φi , j −1 − 2φi , j , where φi , j is the value of the function in the node (i, j ) , which i and j are the index of the x and y direction, respectively. Only fourth order of accuracy for the spatial derivative is considered in this paper and the proposed three-point explicit compact scheme for the first and second derivatives can be obtained as: ∂φi , j ∂x ∂φi , j ∂y ∂ 2φi , j ∂x 2 ∂ 2φi , j ∂y 2 = 1 1 (1 − d xx )d xφi , j Δx 6 + O ⎡⎣(Δx) 4 ⎤⎦ (2) = 1 1 (1 − d yy )d yφi , j Δy 6 + O ⎡⎣(Δy ) 4 ⎤⎦ (3) = 1 1 (1 − d xx )d xxφi , j 2 ( Δx ) 12 + O ⎡⎣(Δx) 4 ⎤⎦ (4) = 1 1 (1 − d yy )d yyφi , j 2 ( Δy ) 12 + O ⎡⎣(Δy ) 4 ⎤⎦ (5) where Δx and Δy are the grid spacing along the x and y direction, respectively. Then, the semi-discretized form of the unsteady convection-diffusion equation can be obtained as c ε ⎤ ε 1 1 1 1 ∂φ ⎡ cx = ⎢ − (1 − d xx )d x − y (1 − d yy )d y + x 2 (1 − d xx )d xx + y 2 (1 − d yy ) d yy ⎥ φ ∂t ⎣ Δx Δy 6 6 (Δx) 12 ( Δy ) 12 ⎦ (6) 3. Time discretization The spatial derivatives were discretized by a high order accurate method, so it should also use a high-order discretized procedure for the time integration. Hence, the fourth-order accurate Runge-Kutta method is used in this paper: ⎯ 232 ⎯ 1 ⎧ * n n ⎪φ = φ + 2 ΔtL(φ ) ⎪ ⎪φ ** = φ n + 1 ΔtL(φ * ) ⎪ 2 ⎨ ⎪φ *** = φ n + ΔtL(φ ** ) ⎪ 1 ⎪ n +1 n n * ** *** ⎪⎩φ = φ + 6 Δt ⎡⎣ L(φ ) + 2 L(φ ) + 2 L(φ ) + L(φ ) ⎤⎦ (7) where L(⋅) is the spatial discretized counterparts in Eq. (6). NUMERICAL EXAMPLES AND RESULTS 1. Convection-diffusion problem with a Gaussian type pulse To examine the validity and effectiveness of the present method, a widely studied unsteady problem concerning the convection-diffusion of a Gaussian pulse [9-13] is considered in Eq. (1) with the following initial condition: ⎡ ( x − 0.5) 2 φ (0, x, y ) = exp ⎢ − ⎢⎣ εx − ( y − 0.5) 2 ⎤ ⎥ εy ⎥⎦ (8) An analytical solution to this problem is ⎡ x − 0.5 − c t 2 ( y − 0.5 − c t )2 ⎤ ( 1 y x ) ⎥ exp ⎢ − φ ( t , x, y ) = − ⎢ ε x ( 4t + 1) ε y ( 4t + 1) ⎥ 4t + 1 ⎣ ⎦ (9) The Dirichlet boundary conditions are taken from the analytical solution. For the sake of comparison of our results with others, the values of various parameters shown in Table 1 are used herein. Table 1 The parameters for the convection-diffusion of a Gaussian pulse εx εy cx 0.01 m2/s 0.01 m2/s 0.8 m/s cy Ω 0.8 m/s 0 ≤ x ≤ 2, 0≤ y≤2 Δt Δx 0.00625 s 0.05 m Δy T 0.05 m 1.25 s The initial pulse and the pulse at t = 1.25 obtained by the present scheme are shown in Fig. 1. Numerical solutions are compared with the analytical solutions in the diagonal region at the final time step ( t = 1.25 ) in Fig. 2. 1 Φ 0.8 0.6 0.4 0.2 0 0 2 1.5 0.5 1 1 x 0.5 1.5 2 y 0 Figure 1: The initial and the numerical pulse at t = 1.25 ⎯ 233 ⎯ 0.18 Numerical Analytical 0.16 0.14 0.12 Φ 0.1 0.08 0.06 0.04 0.02 0 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 Figure 2: The comparison of the numerical and analytical results in the diagonal at t = 1.25 Contour plots of the exact and numerically approximated pulses in the sub-region 1 ≤ x, y ≤ 2 are drawn in Fig. 3. Fig. 3(b) show that the present scheme captures very well the moving pulse, yielding pulses centered at (1.5,1.5) and almost indistinguishable from the exact one displayed in Fig. 3(a). 2 2 1.9 1.9 1.8 1.8 0. 04 0. 1 0. 0 8 1.3 01 0. 01 0. 1.2 0.1 6 1.4 0. 0 8 1.3 1.5 4 0. 1 0. 1 1.4 0.06 y 0.06 y 1.6 16 0. 1.5 4 0. 1 12 0. 1.6 1.7 0. 12 04 0. 1.7 1.2 2 0.0 0.02 1.1 1 1.1 1 1.2 1.4 1.6 1.8 1 2 1 1.2 1.4 1.6 x x (a) exact (b) present scheme 1.8 2 Figure 3: Contour plots of the pulse in the sub-region 1 ≤ x, y ≤ 2 at t = 1.25 The L2 - norm of the errors produced by the present scheme, the P-R ADI scheme [10], the spatial third order nine-point compact scheme of Noye and Tan [11], the fourth-order nine-point compact scheme of Kalita et al [12], and the high order ADI scheme of Karaa and Zhang [13], are presented in Table 2. The results show that the present scheme provides the most accurate solution. Table 2 L2 -error norms at t = 1.25 delivered by five different schemes, with Δt = 0.00625 and Δx = Δy = 0.025 L2 -error norms Method 2.02 ×10−3 1.24 × 10−4 1.02 × 10−4 5.62 × 10−5 2.22 ×10−5 P-R ADI [10] Noye and Tan [11] Kalital et al [12] High order ADI [13] Present scheme 2. 2D Burgers problem we consider the following solution of a 2D Burgers problem over the square domain Ω = [0,1] × [0,1] for which an analytical solution can be devised and shown in [14]. ⎯ 234 ⎯ The problem is defined by the equations r r r 1 2r ut + (u ⋅ ∇)u = ∇ u, Re (10) ∂ ∂ r j and Re is the Reynolds number and with the following initial and boundary where u = (u , v) , ∇ = i + ∂x ∂y conditions: u ( x, y,0) = sin(π x)cos(π y ), v( x, y,0) = cos(π x)sin(π y ), u (0, y, t ) = u (1, y, t ) = 0, v( x,0, t ) = v( x,1, t ) = 0, (11) ∂u ∂u ∂v ∂v ( x,0, t ) = ( x,1, t ) = 0, (0, y, t ) = (1, y, t ) = 0 ∂n ∂n ∂n ∂n Since u and v are similar, only the results of u obtained on a uniform mesh of 30 × 30 with Δt = 1/ 40 from t = 0 to t = 1 for Re = 100 by the present method are shown in Fig. 4, which agrees well with the results of [14]. t=0.2s 1 1 0.5 0.5 0 U U t=0 0 -0.5 -0.5 -1 0 -1 0 0.2 0.2 0 0.4 0.6 y 0.4 y 0.6 0.8 0.2 0.6 0.4 0.6 0.8 0.8 1 0 0.4 0.2 x 1 0.8 1 1 t=0.6s t=1s 1 1 0.5 0.5 0 0 U U x -0.5 -0.5 -1 0 -1 0 0.2 0.2 0 0.4 0.6 y 0.4 y 0.6 0.8 0.8 1 0 0.4 0.2 0.2 0.6 0.4 0.6 0.8 x 0.8 1 1 x 1 Figure 4: Solution of u ( x, y, t ) of 2D Burgers equation for Reynolds number Re = 100 3. Taylor’s vortex problem Taylor in 1923 published a exact solution of the incompressible Navier-Stokes equations in terms of the streamfunction and vorticity [15]. In the present paper, the unsteady transport equation of vorticity is solved by proposed scheme and the Poisson equation of streamfunction is solved by the successive over relaxation iterative method. The initial conditions is taken as [6,12] u ( x, y,0) = − cos( Nx)sin( Ny ) and v( x, y,0) = sin( Nx)cos( Ny ) for 0 ≤ x, y ≤ 2π (12) The exact solution of this problem is given by u ( x, y, t ) = − cos( Nx)sin( Ny )exp −2 N 2 t / Re and v( x, y, t ) = sin( Nx)cos( Ny )exp −2 N 2 t / Re (13) where N is an integer. Fig. 5 depicts the computed Taylor’s vorticity contours for Δx = Δy = 2π / 64 , Re = 1000 and N = 4 at t = 2 with Δt = 0.01 . The variations of the horizontal velocity along the vertical centerline and the vertical ⎯ 235 ⎯ velocity along the horizontal centerline at time t = 10 and Re = 100 for N = 1,2,4 , along with the exact solutions are presented in Fig. 6(a) and (b). It is seen that our results are in good agreement with the exact solutions. 6 5 Y 4 3 2 1 0 0 1 2 3 4 5 6 X Figure 5: Vorticity contours for the Taylor’s vortex at t = 2 for N = 4 and Re = 1000 1 6 N=1 numerical N=2 numerical N=4 numerical N=1 exact N=2 exact N=4 exact 5 N=1 numerical N=2 numerical N=4 numerical N=1 exact N=2 exact N=4 exact 0.8 0.6 0.4 4 0 v y 0.2 3 -0.2 2 -0.4 -0.6 1 -0.8 0 -1 -0.8 -0.6 -0.4 -0.2 0 u 0.2 0.4 0.6 0.8 -1 1 0 1 2 3 4 5 6 x (a) Horizontal velocity along the vertical centerline (b) Vertical velocity along the horizontal centerline Figure 6: Comparison of the computed and the exact velocities for the Taylor’s vortex problem at t = 10 for N = 1,2, 4 and Re = 100 CONCLUSION A high order compact difference scheme based on the fourth order compact difference scheme in spatial discretization and the fourth order Runge-Kutta method in time integration is proposed for the numerical simulation of the unsteady convection-diffusion equation. The validity of the proposed method is firstly tested by a two-dimensional convection-diffusion equation with a Gaussian pulse type concentration. The L2 error norms are used to measure differences between the exact and numerical solutions and compared to those obtained by other methods. It is shown that the results obtained by proposed method agree very well with the analytical solutions and is more accurate than other methods. Then, a two-dimensional non-linear Burgers equation is used to validate the effectiveness of the proposed method used to solve the non-linear convection-diffusion equation, which also models well. Finally, the Taylor’s vortex problem is investigated by the proposed method. From the three test problems, it is shown that the ⎯ 236 ⎯ proposed high order compact difference scheme is an efficient and accurate method to simulate the transport problems and also can be applied to many engineering problems. Acknowledgements The support of acknowledged. the National Natural Science Foundation of China under Grant No. 50479053. is gratefully REFERENCES 1. Lele SK. Compact finite difference schemes with spectral-like resolution. Journal of Computational Physics, 1992; 103(1): 16-42. 2. Chu PC, Fan CW. A three-point combined compact difference scheme. Journal of Computational Physics, 1998; 140(2): 370-399. 3. Mahesh K. A family of high order finite difference schemes with good spectral resolution. Journal of Computational Physics, 1998; 145(1): 332-358. 4. Hixon R. Prefactored small-stencil compact schemes. Journal of Computational Physics, 2000; 165(2): 522-541. 5. Tolstykh AI, Lipavskii MV. On performance of methods with third- and fifth-order compact upwind differencing. Journal of Computational Physics, 1998; 140(2): 205-232. 6. Ma YW, Fu DX, Kobayashi N et al. Numerical solution of the incompressible Navier-Stokes equations with an upwind compact difference scheme. International Journal for Numerical Methods in Fluids, 1999; 30(5): 509-521. 7. Ma YW, Fu DX. Analysis of super compact finite difference method and application to simulation of vortex-shock interaction. International Journal for Numerical Methods in Fluids, 2001; 36(7): 773-805. 8. Boersma B J. A staggered compact finite difference formulation for the compressible Navier-Stokes equations. Journal of Computational Physics, 2005; 208(2): 675-690. 9. Xie ZH, Lin JG, You XD. Comparative investigation of some high-order explicit schemes combined with QUICK for the convection-diffusion equation. Journal of Hydrodynamics, Series A, 2005; 20(3): 346-356. 10. Peaceman DW, Rachford Jr HH. The numerical solution of parabolic and elliptic differential equations. Journal of the Society of Industrial and Applied Mathematics, 1959; 3: 28-41. 11. Noye BJ, Tan HH. Finite difference methods for solving the two-dimensional advection–diffusion equation. International Journal for Numerical Methods in Fluids, 1988; 26: 1615-1629. 12. Kalita JC, Dalal DC, Dass AK. A class of higher order compact schemes for the unsteady two-dimensional convection-diffusion equation with variable convection coefficients. International Journal for Numerical Methods in Fluids, 2002; 38: 1111-1131. 13. Karaa S, Zhang J. High order ADI method for solving unsteady convection-diffusion problems. Journal of Computational Physics, 2004; 198: 1-9. 14. Donea J, Roig B, Huerta A. High-order accurate time-stepping schemes for convection-diffusion problems. Computer Methods in Applied Mechanics and Engineering, 2000; 182: 249-275. 15. Taylor GI. On the decay of vortices in a viscous fluid. Philosophical Magazine, 1923; 46(6): 671-674. ⎯ 237 ⎯
© Copyright 2026 Paperzz