Documente Academic
Documente Profesional
Documente Cultură
u u 2 uv p u u + + = + ( ) + ( ) + Su t x y x x x y y v uv v 2 p v v + + = + ( ) + ( ) + Sv t x y y x x y y u v + + =0 x y t
where u and v are the horizontal and vertical components of the velocity respectively, p is the pressure, is the density of the fluid, is its dynamic viscosity and S are the source terms. These equations are generally unsolvable by hand due to non-linearity and pressure-velocity coupling issues [10]. Pressure-velocity coupling algorithms such as SIMPLE, SIMPLER, SIMPLEC or PISO are the most widely used methods to bypass these difficulties. Nevertheless the computational time and the accuracy of the solution is very dependant on the algorithm chosen and on the problem to solve. The aim of this research is to create an algorithm in Matlab, organized in specific organized blocks, in order to compare the cited algorithm for several 2D flow problems in details. II. THE ALGORITHMS A. PRELIMINARY Pressure-correction methods are preferred to other methods as they provide an efficient mean to deal with the role of the pressure in the Navier-Stokes and continuity equations. These equations are closely linked as each component of the velocity appears in every equation but there is no equation for the pressure [10]. All of the algorithms used start by guessing the pressure field and then gradually correct it until convergence is obtained, which deals efficiently with the problem. The finite volume method is used to discretise the equations. This method has several advantages over other discetisation schemes, the most important of which being that it satisfies any conservation properties of the partial differential equations that are being approximated, regardless of the mesh spacing or the truncation error, since the flux going into a control volume must equal the flux going out of it [10]. A staggered grid is used in order to prevent uncoupling of the pressure and the velocity or checker boarding [8]. Instead of storing all the variable at a single node, the components of the velocity are stored midway between the
I.
INTRODUCTION
The computation of fluid flows is very important in diverse fields ranging from medicine and the blood flow to engineering and the flow past a sports car or through a pipeline. All of these problems lead to solving the NavierStokes and continuity equations, which are presented here in their 2D unsteady form:
245
scalar nodes (which contains all the scalar variables such as the pressure, the temperature, etc) in the horizontal and vertical direction respectively. Scalar quantities are stored at locations with coordinate (I, J), u-velocity components at locations (i, J) and v-velocity components at locations (I, j). A staggered grid arrangement is presented below:
fields. If the pressure and velocity component corrections (with superscript ) are then defined as being the difference between the correct field (without superscripts) and the guessed field (with the superscript *):
(2)
Subtracting the discretised momentum equations for the correct velocity fields to the ones for the guessed fields and using (2) yields expressions for the velocity field corrections:
a i,J u 'i,J =
(3)
Fig. 1. Matlab output of the staggered grid arrangement: stars represent the scalar nodes, right-pointing arrows the u-velocity components and uppointing arrows the v-velocity components.
B. SIMPLE [8] The core of all the mentioned algorithms is SIMPLE, which consists of a guess and correct process until convergence of the solution. First the variables are guessed over the whole computational domain. The momentum equations are then discretised over the appropriate control volumes (centered around a u-velocity component for the u-momentum equation and around a v-velocity component for the vmomentum equation). For the 2D unsteady form of the Navier-Stokes equations this yields:
a i,J u i,J =
a nb u nb +
xy 0 0 ( I ,J + I01,J )u i,J 2t
(1)
246
more accurate than SIMPLE as it omits less significant terms, when it comes to correcting the velocity fields. E. PISO The PISO algorithm [2] was originally intended for noniterative computation of unsteady compressible flows. Nevertheless it has been adapted to solve iteratively steady state problems. In its iterative form PISO has the same sequence of operations as SIMPLE with an additional corrector step. The pressure and velocity fields are twice corrected in the process hence there is a considerable increase in computational effort at each iteration in comparison with SIMPLE. However it converges much faster and was shown to be fast and efficient despite the extra heavy computational effort required [2]. III. PERFORMANCES OF THE ALGORITHMS Each algorithm is different and therefore performs differently. Moreover the performance of each algorithm is dependant on the problem they are required to solve. For example for a benchmark laminar backward-facing step problem it was shown [3] that PISO performed twice faster than SIMPLE for a similar answer. On the other hand for the simple problem of a flow through a heated fin, an analysis on Star-CD shows that PISO takes four times more time than SIMPLE to find the same solution. A general comparative study of the SIMPLE and SIMPLER algorithms for steady flow problems [1] showed that although SIMPLER requires more computational effort, it has significant advantages when solving the momentum equations. More precisely SIMPLER performs 30% more calculations than SIMPLE but its faster convergence rate implies that it requires 30 to 50% less computer time to solve problems on average [1]. Further studies [3]-[6] on the SIMPLER, SIMPLEC and PISO algorithms for steady flow problems concluded that none of the three methods had a clear advantage over the others but that the performances of each algorithm was closely dependant on the flow conditions, the degree of coupling between the momentum and scalar equations, the under-relaxation factor, the discretisation scheme used and the numerical method adopted to solve the algebraic equations [4]. For problems in which there is no coupling between the momentum equations and a scalar variable, PISO exhibits the most robust convergence and takes less computational time than SIMPLER and SIMPLEC. For problems where the scalar variable is strongly coupled to the momentum equations SIMPLER and SIMPLEC perform better than PISO and PISO only yields correct solutions for small time steps. No clear pattern arises when SIMPLER and SIMPLEC are compared one to another. Both have robust convergence characteristics but none can
be said to be significantly superior to the other [4]. For non-iterative transient calculations PISO has advantages over the other algorithms firstly because it was developed for this particular purpose whereas SIMPLE, SIMPLER and SIMPLEC are iterative methods originally intended for steady problems [2], and secondly because the time accuracy of the second corrector step makes it very attractive [10]. Enhanced version of the mentioned algorithms or new algorithms altogether have been developed in order to minimize computational time and increase convergence robustness such as SIMPLEX, the MAC and the ICE family of algorithms but these, although they may perform better (SMAC is more efficient, faster and more accurate than PISO for transient calculations [5]) are not used as widely as the studied algorithms [10] and will therefore not be considered here. IV. THE MATLAB CODE In order to verify, confirm and push further the previously reported findings a very versatile Matlab code is developed. The code is composed of several specific functional blocks each of which is independent, which allows a thorough analysis of every step of each algorithm. Independent m-files are created for the discretisation of the convection and diffusion terms of the momentum equations. Several discretisation schemes may therefore be compared such as the central, the upwind or the hybrid scheme or higher schemes such as the QUICK and TVD schemes. For transient flow problems three temporal approximations are tested: the Euler explicit, Euler implicit and the Crank-Nicolsen schemes. In order to solve the set of algebraic equations the point and line Gauss-Seidel iterative methods are implemented and their relative merits are evaluated. The initial guess for the variables is part of an independent routine, allowing for a comprehensive study of the initial guess and its influence on the rest of the calculations. Each algorithm is coded independently and all the features mentioned above are implemented in each of them allowing for a thorough comparison of every aspect of each algorithm and of the influence of each specific block on the overall performances. The code is further intended for pedagogic use and is thereafter straightforward to use and understand. The link between every step of the algorithm is clearly highlighted and the user controls every step of the calculation from the choice of the geometry and the mesh size to the boundary conditions, the time step, the initial guesses, the temporal discretsation scheme, the spatial discretisation scheme for the convection and diffusion term independently, the
247
iterative solution method for the algebraic equations, the under-relaxation factor, the convergence factor and the maximum number of iterations. Since each m-file corresponds to a particular step of the algorithm it is easy to develop the code further by adding additional feature in the required m-files. REFERENCES
[1] Anderson, D. A., Tannehill, J. C. and Pletcher, R. H. (1984). Computational Fluid Mechanics and Heat Transfer, Hemisphere Publishing Corporation, Taylor & Francis Group, New York. [2] Issa, R. I. (1986). Solution of the Implicitly Discretised Fluid Flow Equations by Operator-Splitting, Journal of Computational Physics, Vol. 62, pp. 40-65. [3] Issa, R. I., Gosman, A. D. and Watkins, A. P. (1986). The Computation of Compressible and Incompressible Recirculating Flows, Journal of Computational Physics, Vol. 62, pp. 66-82. [4] Jang, D. S., Jetli, R. and Acharya, S. (1986). Comparison of the PISO, SIMPLER and SIMPLEC Algorithms for the Treatment of the Pressure-Velocity Coupling in Steady Flow Problems, Numerical Heat Transfer, Vol. 19, pp. 209-228. [5] Kim, S. W. and Benson, T. J. (1992). Comparison of the SMAC, PISO and Iterative Time-Advancing Schemes for Unsteady Flows, Computational Fluids, Vol. 21, No. 3, pp. 435-454. [6] Latimer B. R. and Pollard A. (1985). Comparison of PressureVelocity Coupling Solution Algorithms, Numerical Heat Transfer, Vol. 8, pp. 635-652. [7] Patankar S. V. (1980). Numerical Heat Transfer and Fluid Flow, Hemisphere Publishing Corporation, Taylor & Francis Group, New York. [8] Patankar S. V. and Spalding, D. B. (1972). A Calculation Procedure for Heat, Mass and Momentum Transfer in Three-dimensional Parabolic Flows, Int. J. Heat Mass Transfer, Vol. 15, p. 1787. [9] Van Doormal, J. P. and Raithby G. D. (1984). Enhancements of the SIMPLE Method for Predicting Incompressible Fluid Flows, Numerical Heat Transfer, Vol. 7, pp. 147-163. [10] Versteeg H. K. and Malalasekera W. (2007). An Introduction to Computational Fluid Dynamics: The Finite Volume Method. Second Edition. Pearson. pp. 179-266.
248