Computers & Fluids 36 (2007) 1159–1161 www.elsevier.com/locate/compfluid
Technical Note
A segregated-implicit scheme for solving the incompressible Navier–Stokes equations Po-Hao Kao, Ruey-Jen Yang
*
Department of Engineering Science, National Cheng Kung University, Tainan 70101, Taiwan Available online 17 January 2007
Abstract The proposed segregated-implicit (SI) scheme, which is based on the artificial compressibility method, is discretized by the finite difference numerical scheme and verified by simulating a shear-driven cavity flow. The current results demonstrate that the SI scheme is a simple algorithm capable of fast solving the incompressible Navier–Stokes equations. Ó 2007 Elsevier Ltd. All rights reserved.
1. Introduction A significant problem encountered when solving the incompressible Navier–Stokes equations is that the pressure is coupled implicitly with the divergence-free constraint on the velocity field in the continuity equation. In 1967, Chorin [1] proposed an artificial compressibility method to overcome this numerical difficulty. In this method, a pseudotime term is introduced into the continuity equation such that the original elliptic–parabolic type equations are transformed into hyperbolic–parabolic type equations for coupling the equations into a system. An implicit scheme with the artificial compressibility formulation and incorporating the ADI algorithm was applied by Choi and Merkle [2] and Kwak et al. [3] to the study of incompressible flow. More successful applications have lead to development of new computing procedures utilizing the method of artificial compressibility and upwind technique by Rogers and Kwak [4]. Soh and Goodrich [5] employed the artificial compressibility method and ADI schemes in constructing the time-accurate algorithms. Solving steady and time-accurate problems using artificial compressibility methods involves iterating and sub-iterating the equations until the divergence-free constraint on the velocity field is satisfied at the physical-time level. It has been shown in *
Corresponding author. Tel.: +886 6275 7575; fax: +886 6276 6549. E-mail address:
[email protected] (R.-J. Yang).
0045-7930/$ - see front matter Ó 2007 Elsevier Ltd. All rights reserved. doi:10.1016/j.compfluid.2006.11.001
Refs. [6,7] that the artificial compressibility method requires a fast convergence scheme at each physical-time step in order to satisfy the incompressibility condition. The present study proposes a simple method to formulate a segregated-implicit (SI) scheme, which readily transforms a block-tridiagonal matrix into several scalar-tridiagonal matrices. The developed scheme is then applied to simulate a steady shear-driven cavity flow. The relative performances of the fully implicit scheme using an ADI solver and the proposed SI scheme are then compared. 2. SI scheme formulation for steady model In Cartesian coordinates, the steady two-dimensional incompressible Navier–Stokes equations can be written as a pseudo-transient system by means of the artificial compressibility method which introduces pseudo-time dependent terms into each equation in dimensionless and conservation form as: 8 op ou ov > > b þ þ ¼0 > > os ox oy > > < ou o o op 1 o2 u o2 u 2 þ ðu Þ þ ðuvÞ þ ¼ þ ð1Þ os ox oy ox Re ox2 oy 2 > > > 2 2 > ov o o op 1 ov ov > > : þ ðuvÞ þ ðv2 Þ þ ¼ þ os ox oy oy Re ox2 oy 2 where u and v are the x- and y-direction velocity components, respectively, p is the static pressure, and Re is the
1160
P.-H. Kao, R.-J. Yang / Computers & Fluids 36 (2007) 1159–1161
Reynolds number, b is the artificial compressibility coefficient, and s is pseudo-time. The segregated-implicit (SI) scheme proposed in this study is designed as a semi-implicit scheme is shown to be more stable than explicit schemes and to be more computationally efficient than fully implicit schemes. When constructing the solver algorithm for practical applications, each equation of (1) is formulated in implicit discretization sequentially by each variable in the governing equations, i.e. u, v, and p, such as the scheme of ‘‘alternating-variable implicit’’. Under the proposed SI scheme, the block-tridiagonal matrix solver required in the fully implicit ADI scheme is segregated into several scalar-tridiagonal matrices. Therefore, the algorithm formulated by the SI scheme is expected to be computationally more efficient, and hence less time-consuming, than the fully implicit scheme using an ADI solver. In the present example of the two-dimensional modified incompressible Navier–Stokes equations (1), initially, the u-velocity in the x-momentum equation is discretized by the implicit scheme and linearized by (u2)k+1 = (u2)k + 2uk Æ Duk+1, where Duk+1 = uk+1 uk. Then a delta form for u-velocity in the x-momentum equations can be expressed as: o o 1 2 k kþ1 kþ1 k kþ1 ð2u Du Þ þ ðDu v Þ r ðDu Þ Du þ Ds ox oy Re k o 2 k o k k op 1 2 k ¼ Ds ðu Þ ðu v Þ þ ru ð2Þ ox oy ox Re kþ1
where k denotes the pseudo-time level. Implementing the ADI algorithm, the x-momentum equation can be formulated in two steps, as: x sweep : 1 þ Ds
2
o 1 o ð2uk Þ ox Re ox2
Du ¼ RHSx
ð3aÞ 2 o k 1 o ðv Þ y sweep : 1 þ Ds Dukþ1 ¼ Du oy Re oy 2 ð3bÞ k o o op 1 k þ r 2 uk where RHSx ¼ Ds ðu2 Þ ðuk vk Þ ox oy ox Re In the formulation of the x-momentum equations (3a) and (3b), u is unknown and is expressed implicitly as uk+1, while p and v are expressed explicitly as pk and vk. Eqs. (3a) and (3b) can be solved using a scalar-tridiagonal matrix solver, and hence the need for the more computationally intensive block-tridiagonal matrix solver is avoided. Similarly, the x- and y-direction velocity components (u and v) in the y-momentum equation are also discretized by the implicit scheme. In this case, the nonlinear term is linearized using (v2)k+1 = (v2)k + 2vk Æ Dvk+1, where Dvk+1 = vk+1 vk. And implementing the ADI scheme, the y-momentum equation can be also expressed in two steps as the delta form, i.e.
o kþ1 1 o2 ðu Þ Dv ¼ RHSy x sweep : 1 þ Ds ox Re ox2 y sweep : 1 þ Ds
2
o 1 o ð2vk Þ oy Re oy 2
ð4aÞ Dvkþ1 ¼ Dv
ð4bÞ k o 2 k o kþ1 k op 1 2 k þ rv where RHSy ¼ Ds ðv Þ ðu v Þ oy ox oy Re In the formulation of the y-momentum equation, v is unknown and is expressed implicitly as vk+1. However, p is expressed explicitly as pk, and u is obtained from the x-momentum equation, i.e. uk+1. Therefore, solving Eqs. (4a) and (4b) requires the use only of the scalar-tridiagonal matrix solver. Finally, the continuity equation is discretized by the fully implicit scheme for each variable in the governing equation, i.e. for p, u, and v. When Dpk+1 = pk+1 pk, the continuity equation can be expressed in the following delta form: Ds oukþ1 ovkþ1 þ Dpkþ1 ¼ ð5Þ b ox oy Since uk+1 and vk+1 are given by the x- and y-momentum equations, respectively, Eq. (5) can be solved without using any form of matrix solver. The spatial derivatives appearing in Eqs. (3a), (3b), (4a), (4b), and (5) are discretized via centered difference method. 3. Application to a steady cavity flow The proposed SI scheme was tested by computing a 2D shear-driven cavity flow generated by an impulsively started lid at Re = 400. The appropriate values of b for the case can be determined by the approximation which simplifying the governing equation to a one-dimensional linearized form and propagation characteristics of the pressure wave, as shown by Chang and Kwak et al. in Ref. [8]. The steady solution of the cavity flow computed both by the fully implicit scheme and by the SI scheme used the same convergence criteria, in which the relative error is set to be less than 106. The CPU time (seconds) presented below is based on the PC equipment using the AMD XP2000 CPU with 512MB DDR Ram. Fig. 1 plots the convergence of residuals of each variable for the cavity flow in the governing equation against the number of iterative steps. Fig. 1a presents the case of the fully implicit scheme using an ADI solver, while Fig. 1b presents the corresponding results for the proposed SI scheme. In both cases, it can be seen that the variable residuals decay from an initial value of 104 to a value of 1014 after 5000 iterative steps. Hence, specifying the same value for the artificial compressibility coefficient, b = 20, in the two different schemes yields similar convergence rates. The results presented above indicate that the fully implicit scheme using an ADI solver and the SI scheme yield the
P.-H. Kao, R.-J. Yang / Computers & Fluids 36 (2007) 1159–1161 10-3
10
10-5
-7
10-7
10-9
10
-3
10-5
P U V
Residuals
Residuals
10
1161
10-9
Fully Implicit Sch. using ADI Solver
-11
10-11 SI Sch.
10
-13
10
-15
1000
2000
3000
4000
5000
Iterative Steps 10-3
10
Residuals
-13
10
-15
0
5
10 CPU Time (Seconds)
15
Fig. 2. Variation of the variables’ residuals with computational time within 5000 steps of iteration.
-5
P U V
10-7
10
10
-9
10
-11
10
-13
10
-15
1000
2000
3000
4000
5000
Iterative Steps Fig. 1. Convergence of residuals with iterative steps using same grid system and b value in both schemes: (a) fully implicit scheme with ADI solver and (b) SI scheme.
same steady state solutions and a similar convergence rate for the case of steady shear-driven cavity flow. However, the fully implicit scheme requires the use of the computationally intensive block-tridiagonal matrix solver. Fig. 2 shows the convergence curves for the two schemes with respect to CPU time for the case of cavity flow. It is clear that the SI scheme consumes less computational time than that for the fully implicit scheme using an ADI solver. The results indicate that the ratio of the SI computation time to that of the fully implicit scheme is 1:6.64. 4. Conclusions The presented segregated-implicit (SI) algorithm provides a simple method to segregate the block-tridiagonal
matrix into several scalar-tridiagonal matrices, and hence the SI scheme has less computationally demanding. The results have shown that the steady SI scheme yields the same solutions and a similar convergence rate as the fully implicit scheme. However, it has been shown that the computational time requirements of the SI scheme are significantly less than those of the fully implicit scheme; for this application to the square cavity, a factor of 6 in saving computation time can be achieved. Furthermore, the SI scheme simplifies the formulation procedures since its does not involve complex matrix transformation. The proposed SI scheme can be easily extended to solve time-accurate and three-dimensional flow problems.
References [1] Chorin AJ. A numerical method for solving incompressible viscous flow problems. J Comput Phys 1967;2:12–26. [2] Choi D, Merkle CL. Application of time-iterative schemes to incompressible flow. AIAA J 1985;23(10):1518–24. [3] Kwak D, Chang JLC, Shanks SP, Chakravarthy SR. A threedimensional incompressible Navier–Stokes flow solver using primitive variables. AIAA J 1986;24(3):390–6. [4] Rogers SE, Kwak D. An upwind difference scheme for the incompressible Navier–Stokes equations. Appl Numer Math 1991;8:43–6. [5] Soh WY, Goodrich JW. Unsteady solution of incompressible Navier– Stokes equations. J Comput Phys 1988;79:113–34. [6] Kiris C, Kwak D. Aspect of unsteady incompressible flow simulations. Comput Fluids 2002;31:627–38. [7] Kwak D, Kiris C, Kim CS. Computational challenges of viscous incompressible flows. Comput Fluids 2004;34:283–99. [8] Chang JLC, Kwak D. On the method of pseudo compressibility for numerically solving incompressible flows. AIAA Paper 1984:84-0252.