## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

M5351 DYNAMICS OF OCEAN SYSTEMS I

**An Introduction to CFD
**

（数値流体力学入門）

by Changhong HU

hu@riam.kyushu-u.ac.jp

**Research Institute for Applied Mechanics, Kyushu University
**

6-1 Kasuga-koen, Kasuga, Fukuoka 816-8580, JAPAN

1

CONTENTS

1. General introduction 2. Governing equations 3. Basics of discretization 4. Finite difference method 5. Finite volume method 6. Upwind schemes 7. CIP method 8. Numerical methods for incompressible flows 9. Solution of linear system 10. Problems with complex geometries 11. Free surface flows 12. Turbulence modeling Appendix A. Sample program for 2D flow around a square cylinder

2

References

Text Books [1] [2] [3] [4] [5] [6] [7] [8] [9] 数値流体力学編集委員会編「数値流体力学シリーズ１～６」東大出版会（1995） 荒川忠一「数値流体工学」東大出版会（1994） 越塚誠一「数値流体力学」培風館（2001） 八田夏夫「流れの計算」森北出版（1996） J.H. Ferziger and M. Peric, Computational Methods for Fluid Dynamics, Springer (2002) J.D. Anderson, Jr, Computational Fluid Dynamics, the Basics with Applications, McGraw-Hill, (1995) S.V. Patankar, Numerical Heat Transfer and Fluid Flow, McGraw-Hill, Transfer, McGraw-Hill, (1984) H.Tennekes and J.L. Lumley, A First Course in Turbulence, The MIT Press (1972) [10] J.F. Tompson, Numerical Grid Generation, North-Holland, New York (1985) [11] 矢部孝，内海隆之，緒方陽一「ＣＩＰ法」森北出版（2003） (1980) D.A. Anderson, J.C. Tannchill and R.H. Pletcher, Computational Fluid Mechanics and Heat

CFD Journals [1] [2] [3] [4] [5] [6] [7] [8] Journal of Computational Physics International Journal of Computational Fluid Dynamics International Journal for Numerical Methods in Fluids International Journal for Numerical Methods in Engineering Computer and Fluids SIAM J. on Numerical Analysis Mathematics of Computation Computer Method in Applied Mechanics and Engineering

3

1. INTRODUCTION

Computational fluid dynamics (CFD) is widely used by both academics and industries as an efficient tool to predict fluid motion and heat transfer. It has been an equal important tool as experiment and theory for fluid dynamics research as shown in Fig. 1.1. Many applications of CFD to ship and ocean engineering problems can also be found in recent years, such as prediction of ship resistance, ship-wave interaction, hot gas movement from a ship fire, etc. In this lecture we will study the basics of CFD method and its applications in some hydrodynamic problems. This lecture is for beginners who are interested in but may have not learned CFD before.

Experiment Fluid dynamics research Theory CFD

**Fig.1.1. Research tools for fluid dynamics 2. GOVERNING EQUATIONS
**

In this manuscript we adopt the Cartesian tensor indicial notation. For coordinates we use

xi , i = 1, 2, 3 . For velocities we use ui , i = 1, 2, 3 . Sometimes we write x, y, z in place of x1 , x2 , x3 , and u, v, w in place of u1 , u2 , u3 . When describing finite difference schemes, we use i, j, k and n to indicate the cell addresses in x-, y- , z-direction and the time level, respectively. Vector expression is also used such as u = ue x + vex + wex The governing for a compressible fluid can be written as:

∂ρ ∂ (ui ρ ) + =0 ∂t ∂x i

⎛ ∂u i ⎞ ⎟ ⎜ ∂u i ⎟ = − ∂p + f + ∂ ⎜ + uj ρ⎜ ⎟ i ⎟ ⎜ ∂t ∂x j ⎠ ∂x i ∂x j ⎟ ⎝ ⎞ 2 ⎛ ⎟ ⎜2μS ij − μδij Skk ⎟ ⎟ ⎜ ⎠ ⎝ 3

(2.1)

(2.2)

Numerical methods for incompressible flows .1) – (2. ∂φ p 1 + + ui ui + f i ∂t ρ 2 = const.3). coupled and very difficult to solve. p is the pressure and and μ is the fluid viscosty. fi denotes a body force such as the gravity force. Bernoulli’s Eq.6) ∂ 2φ =0 ∂xi ∂xi Laplace’s Eq. where ρ is the density.3) and the temperature difference is also small ( △ T<30℃). ∂ui =0 ∂xi ∂2 p ∂ ⎛ ∂u ⎞ =H −ρ ⎜ i ⎟ ∂xi ∂xi ∂t ⎝ ∂xi ⎠ Poisson Eq. One of the simplest models is the potential flow. no general solution has been found until now. For many problems. ∂ui =0 ∂x i ∂ui ∂t + uj ∂ui ∂x j =− ∂ 2ui 1 ∂p + fi +ν ρ ∂x i ∂x j ∂ x j (2. Viscous flow method (2.4 ∂E ∂E ∂Q ∂qi ∂ + ui = − + ρui fi + ∂t ∂x i ∂x i ∂t ∂x j ⎡ ⎤ ⎛ ⎞ 2 ⎟⎥ ⎜2μSij − μδij S kk ⎟ ⎢−pui δij + ui ⎜ ⎟ ⎝ ⎠⎥⎦ ⎢⎣ 3 (2. The continuity equation (2. The governing equations (2. Then there exists a velocity potential φ . (2. the Mach number is low (Ma < 0. Since for most of hydrodynamic problems associated with ship and ocean engineering. ui is the velocity. we assume the fluid density is constant and neglect the effect of temperature. such assumption does not introduce large error. The flow is assumed to be inviscid and irrotational. In fact. such that the velocity vector can be defined as u = ∇φ .2) is the momentum equation (Navier-Stokes equation) and (2. The governing equations for incompressible flow can be as follows.4) (2. In the applications of our interest. simplification of these equations is possible and the simplified equations are used for CFD. E denotes the internal energy.1) is the continuity equation. That is.4) becomes Laplace equation for φ as: ∇ 2φ = 0 Potential flow method Basic Equations. In the energy equation (2.3) Equation (2.3) are non-linear. Analytical based method Dui = Dt ∂ 2ui 1 ∂p − +ν − fi ρ ∂ xi ∂ x j∂ x j Direct integration of N-S equation CFD method by narrow interpretation Fig.3) is the energy equation. incompressible assumption can be made.1. Q is the heat release rate.5) These governing equations can be further simplified.2.

which is used to obtain the pressure after the velocity potential is solved. 2.1. fi = − ρ gδ i 3 .7) for simplicity. which is generally interpreted as the CFD method.5 The momentum equation (2. in which we only consider gravity force for the body force. tˆ = . the Reynolds number and the Froude number.8) Froude number: Fr 2 = U 2 ρU 2 inertia force = = gL ρ gL gravity force (2. which are defined as follows. 2.7) can be written in different forms for convenience of numerical solutions.9) By considering the continuity equation. and L is the reference length.5) can be integrated to give the Bernoulli equation. A typical nondimensionalizing procedure is ˆi = x xi u t ˆi = i .2. L U LU ˆ= p p ρU 2 where the nondimensional variables are denoted by a hat. what we are going to discuss in this lecture is the numerical method for viscous flow. ρ ∂ui ∂t + ρu j ∂ui ∂x j = − ∂p ∂ xi + μ ∂ 2 ui ∂ x j∂ x j − ρ gδ i 3 Source term Transient term Advection term Pressure term Diffusion term Local rate of increase Rate of convection Pressure force Rate of molecular Rate of internal diffusion generation ρ Dui Dt mass × acceleration Sum of forces Fig. In this equation we have two important ρUL ρU 2 inertia force = = μ μ U L viscous force (2. the Navier-Stokes equation (2.5) is shown in Fig. 2. The physical explanation of Navier-Stokes equation (2.e.7) From now we will eliminate the hat in (2. For example: .2.5) can be ˆi ˆ ˆi ˆ ∂u ∂u 1 ∂ 2u 1 ∂p ˆj i = − +u + + 2 δi3 ˆj ˆi ˆ j ∂x ˆ j Fr ∂t ∂x ∂x Re ∂x parameters. U is the reference velocity. As shown in Fig. u . The nondimensional form of equation (2. Navier-Stokes equation as Newton’s second low for fluid The governing equations are often put into nondimensional form. Reynolds number: Re = (2. The numerical solution of potential flow model is carried out by analytical based methods. i..

the partial derivative is replaced by an algebraic difference expression. let ui stands for the velocity at grid point i.1) is an good approximation. 3.1. In his case.10) ⎡ ⎤ ⎛ ∂u ∂u j ⎞ 1 ⎜ ∂ ⎢ ⎟ x3 ⎥ i ⎟ ⎜ Conservation Form: + + ⎟ ⎢u u + pδij − ⎟ − Fr 2 δi 3 ⎥⎥ = 0 Re ⎜ ∂x j ⎢ i j ∂x i ⎠ ∂t ⎟ ⎜ ⎝ ∂x j ⎣ ⎦ (2.12) 3.2) From (3. is a practical way to obtain an approximate solution. Concept of finite difference For small spacing of grid points Δx . For instance.1 which shows a one dimensional case.6 Divergence Form: ∂ui ∂t ∂ui + uj ∂ ui ∂x j =− 2 ∂p 1 ∂ ui 1 + + 2 δi 3 ∂x i Re ∂ x j ∂ x j Fr (2. This can be illustrated in Fig. we need to approximate the derivatives of the partial differential equations using the values at discreted grid points.11) Rotational Form: ∂ui ⎛ ∂u ∂u ⎞ ⎟ ⎜ ⎟=− ∂ ⎜ i − j⎟ + uj ⎜ ⎟ ⎜ ∂t ∂x i ⎠ ∂x i ⎟ ⎝ ∂x j 2 ⎛ ⎞ 1 1 ∂ ui 1 ⎟ ⎜p + u j u j ⎟ + + 2 δi 3 ⎟ ⎜ ⎝ ⎠ Re ∂ x j ∂ x j Fr 2 (2. ux ( x ) = ∂u ( x ) u ( x + Δx ) − u ( x ) = lim Δx → 0 ∂x Δx u ( x + Δx ) (3. To do a numerical calculation. Numerical solution. equation (3. the velocities at neighboring grid points can be expressed in terms of a Taylor series expanded about point i as: 2 3 4 ⎛ ∂u ⎞ ( ±Δx ) ⎛ ∂ u ⎞ ( ±Δx ) ⎛ ∂ u ⎞ ( ±Δx ) ⎛ ∂ u ⎞ ui ±1 = ui + ( ±Δx ) ⎜ ⎟ i + ⎜ 2 ⎟ i+ ⎜ 3 ⎟ i+ ⎜ 4 ⎟ i+" 2! ⎝ ∂x ⎠ 3! ⎝ ∂x ⎠ 4! ⎝ ∂x ⎠ ⎝ ∂x ⎠ 2 3 4 (3.2) we can obtain some commonly used schemes for finite difference method (FDM): Forward difference . 3. A general way to construct a finite difference expression of partial derivative is using Taylor expansion. BASICS OF DISCRETIZATION The above described partial differential equations have generally no analytical solutions.1) u ( x) x x + Δx Fig. which gives answer at discrete points (grid points) in a computation domain.

more grid points may be required.7) (3. e.g. .2).7 ( u x )i = Backward difference ui +1 − ui + O ( Δx ) Δx ui − ui −1 + O ( Δx ) Δx ui +1 − ui −1 + O ( Δx 2 ) Δx (3. The second term in (3.8) In discretization of advection term of a transportation equation.. (3.5) Note that in these expressions.2.5) means the order of truncation error.4) ( u x )i = (3. such as the Navier-Stokes equation. The expression of ui ± 2 by Taylor expansion is ui ± 2 2 3 4 ⎛ ∂u ⎞ ( ±2Δx ) ⎛ ∂ u ⎞ ( ±2Δx ) ⎛ ∂ u ⎞ ( ±2Δx ) ⎛ ∂ u ⎞ = ui + ( ±2Δx ) ⎜ ⎟ i + ⎜ 2 ⎟ i+ ⎜ 3 ⎟ i+ ⎜ 4 ⎟ i+" 2! ⎝ ∂x ⎠ 3! ⎝ ∂x ⎠ 4! ⎝ ∂x ⎠ ⎝ ∂x ⎠ 2 3 4 (3. The neglected terms cause u Backward ui −1 ui Exact ui +1 Central Δxi Forward Δxi +1 i-1 i i+1 x Fig. derivative and its finite difference approximations truncation errors of the schemes. For constructing finite difference scheme for higher order derivatives. an upwind difference scheme is often used. 3. The significance of those schemes can be shown in Fig.2.6) Then we obtain: ⎛ ∂ 2u ⎞ ui +1 − 2ui + ui −1 Δx 2 ⎛ ∂ 4u ⎞ ui +1 − 2ui + ui −1 − + O ( Δx 2 ) ⎜ 2 ⎟ i= ⎜ 4 ⎟ i+ " = 2 2 Δx Δx 12 ⎝ ∂x ⎠ ⎝ ∂x ⎠ ⎛ ∂ 3u ⎞ ui + 2 − 2ui +1 − 2ui −1 + ui − 2 Δx 2 ⎛ ∂ 5u ⎞ ui + 2 − 2ui +1 − 2ui −1 + ui − 2 − + O ( Δx 2 ) ⎜ 3 ⎟ i= ⎜ 5 ⎟ i+" = 3 3 2 Δx 4 ⎝ ∂x ⎠ 2 Δx ⎝ ∂x ⎠ (3.3) – (3. we only use some of the terms in Eq.3.3) ( u x )i = Central difference (3. Taking the following linear advection equation as a simple example. O ( Δx ) means first-order-accurate.

stability and convergence. The first order upwind difference for the advection term of (3. for numerical solution. (3.g. the equation describes the propagation of a wave in the positive direction of x-axis. There are several important properties of numerical solution method. (3. We list some often-used schemes below using the following time-dependent equation: ∂u = f (u ) ∂t Euler explicit Euler implicit (3.13) should become (3. If c is positive.11) It is clear that the first order upwind scheme introduces a term that is proportional to second order The remaining issue of the discretization is about the time term.9).. ui n +1 n . are discussed below. It says that the discretized equation should become the original partial differential equation as the time step and the grid spacing tend to zero.12) ui n +1 − ui = f (u n ) i Δt − ui = f ( u n +1 ) i Δt n n First order accuracy First order accuracy ui n +1 Crank-Nicolson ui n +1 n f ( u n +1 ) + f ( u n ) − ui i i = 2 Δt Second order accuracy By using the above-described discretization techniques. Navier-Stokes equation. − ui u n − uin−1 +c i =0 (3. e.9) can be built by using one-side difference scheme as: ⎧ ui − ui −1 + O ( Δx ) c > 0 c ⎪ ⎛ ∂u ⎞ ⎪ Δx c ⎜ ⎟ i= ⎨ ⎝ ∂x ⎠ ⎪ ui +1 − ui + O ( Δx ) c < 0 c ⎪ Δx ⎩ Equation (3. Here three of them.9) where c is the advection velocity. If equation (3.10) can be written in the following compact form: (3. Eq. we can obtain a finite difference expression of a partial differential equation.9) is discretized by the Euler explicit and the upwind difference scheme. Consistency is the condition on structure of numerical formulation.13) Δt Δx The consistency property means when Δt → 0 and Δx → 0 . consistency. the following discretized equation can be obtained for the case of c>0.10) c Δx ui +1 − 2ui + ui −1 u −u ⎛ ∂u ⎞ c + c ui − ui −1 c − c ui +1 − ui c ⎜ ⎟ i= + = c i +1 i −1 + Δx Δx Δx 2 2 2 2Δx 2 ⎝ ∂x ⎠ derivative.8 ∂u ∂u +c =0 ∂t ∂x (3.

14) become i n +1 = u i n − C ( u in − u in−1 ) u Extracting (3. we have the equation about the error. we have ⎛ ui n +1 − ui n u n − uin−1 ⎞ Δt Δx n n n Δx → 0 +c i → 0 ( uxx )i + O ( Δt 2 .9 Taking the following Taylor expansion.18) .13).16) (i = 1.16). εin. 2.16) is a linear equation.k = νk substitute it to (3. Again taking Eq. Δt →0 Stability is the condition on solution of numerical scheme. we only need to consider one component. (3. we have n +1 jki Δx n jki Δx n jki Δx n jk (i −1)Δx νk e = νk e − C (νk e − νk e ) (3. N ). we have ui where C = n +1 = ui − C ( uin − uin−1 ) n (3. j = −1 (3. which is one of the key parameters in CFD.14) c Δt is called the Courant number.15) from (3. It says that the errors should not be magnified in the numerical solution and a bounded solution to the discretized equation can be obtained.13). Δt 2 n u = u + Δt ( ut )i + ( utt )i + " 2 Δx 2 n n uin−1 = uin + Δx ( u x )i + ( uxx )i + " 2 n +1 i n i n and substitute these expressions to Eq. (3.13) as an example. and As (3. Suppose Δx n the actual solution of ui as can be divided into an exact solution part and an error or disturbance part i + ε i ui = u n n n From (3. (3.14). Δx 2 ) ⎯⎯⎯ ⎜ ⎟ − ( ut + cu x )i = ( utt )i + Δ Δ t x 2 2 ⎝ ⎠ The truncation error becomes zero. and the consistency condition is satisfied for the discretization by Eq. (3.17) n jki Δx e . ". The most popular method to analyze the stability of a numerical scheme is the Von Neumann method.15) ε i n +1 = ε i n − C ( ε in − ε in−1 ) The disturbance can be expressed by a Fourier series as: n jkiΔx εi n = ∑ νk e . k =1 N (3.

4. it says that the numerical solution of the discretized equation should tend to the exact solution of the original partial differential equation as the time step and the grid spacing tend to zero.10 ζ= n +1 νk ν n k = 1 − C (1 − e − jk Δx ) (3.2) y i-1. Discrete grid points for finite difference method . the error between them is in = uin − u i Δx . Let ui n i Δx .4. n Δt the numerical solution of the discretized equation and u ( ) the exact solution of the partial differential equation. FINITE DIFFERENCE METHOD (FDM) In this chapter we use the following two-dimensional incompressible Navier-Stokes equation as an example to demonstrate the finite difference method.18) The condition of stability requires ζ ≤1 → 0 ≤ C ≤1 Convergence is the condition on solution of the numerical scheme.j i. j Δy i. ∂u ∂p ∂u ∂u 1 ⎛ ∂ 2u ∂ 2u ⎞ +u +v =− + + ⎜ ⎟ ∂t ∂x ∂y ∂ x Re ⎝ ∂ x 2 ∂ y 2 ⎠ ∂v ∂p ∂v ∂v 1 ⎛ ∂ 2v ∂ 2v ⎞ +u +v =− + + ⎜ ⎟ ∂t ∂x ∂y ∂ y Re ⎝ ∂ x 2 ∂ y 2 ⎠ (4.j+1 i+1.j i+1.1.j i-1.j+1 i+1.1) (4.j-1 ui .j-1 x Fig.j-1 Δx i. n Δt ε The convergence condition requires n Δt → 0 i Δx →0 ( ) =0 lim ε at fixed values of xi = iΔx and tn = nΔt .j+1 i-1.

j 2 n i −1. j ⎛ ∂p ⎞ = + O( Δx 2 ) ⎜ ⎟ 2Δx ⎝ ∂x ⎠i . The flow variable value for each control volume is defined at the volume center. Therefore (i. j − 2uin. j −1 ⎛ ∂u ⎞ = + O (Δy 2 ) ⎜ ⎟ ∂ Δ 2 y x ⎝ ⎠i . j Δt + uin. j uin+1. (4. j) is the right point. (i-1. j) indicates an grid point in the computation domain. and (i+1. j +1 − uin. j −1 (4.2) can be obtained in a similar way. j − pin−1. Δx 2 . j pin+1. j 2 =− pin+1. + j − ui . j) is the left point. j + vin.1) is as follows. Δy 2 ) ⎟ ⎟ Δx Δy ⎠ The discretized equation for Eq. j+1) is the above point. these partial differential equations are replaced by a system of algebraic equations by the following discretization procedure. j + uin. The finite difference method solves the Navier-Stokes equations in a discrete way. n i +1.1) is written as follows for FVM. j 2Δx ⎞ + + O ( Δt . j The resulting discretized equation for Eq. Interpolation is used to approximate the value at the volume surface.1. FINITE VOLUME METHOD (FVM) Instead of using a grid in FDM.3) Equation (4. i.. j = + O (Δt ) ⎜ ⎟ Δt ⎝ ∂t ⎠i . + ⎛ ∂u ⎞ j − ui . Discretization of the derivatives in Eq. j −1 2Δy − 2u + u n i. j 1 ⎛u + ⎜ Re ⎜ ⎝ − 2u + u n i . (i. Eq. j uin+1. (4. j +1 − uin. the computation domain is covered by a grid. in finite volume method the computation domain is divided into a number of control volume as shown in Fig. j − uin−1. j u n i .1) can be as follows using the values at grid points: 1 n uin. j uin. j +1 − 2uin. j-1) is the lower point. j ⎛ ∂ 2u ⎞ + O (Δx 2 ) ⎜ 2⎟ = 2 Δx ⎝ ∂x ⎠i .1. j +1 uin. For example. j + uin−1. j uin+1. Further FVM uses governing equations that are written in a conservation form. (4. j − pin−1. The grid points are noted by an index i which runs in the x direction and an index j which runs in the y direction. 4. j uin. j − uin−1. j ⎛ ∂u ⎞ = + O (Δx 2 ) ⎜ ⎟ 2Δx ⎝ ∂x ⎠i . 1 n uin. j −1 ⎛ ∂ 2u ⎞ = + O ( Δy 2 ) ⎜ 2⎟ 2 y y ∂ Δ ⎝ ⎠i .11 As shown in Fig. j 2 Δx n i. (i. 5. and solution of them gives an approximate flow field expressed by the values at the grid points. .3) is a system of algebraic equations.e. 5. (4.

j − 1 ⎝ ⎝ 2 2 n n (5. the upwind scheme for advection term is widely used in the computation of flows in high Reynolds number. j x Fig.j i +1/2. j Δt 1 ∂u ⎞ 1 ∂u ⎞ ⎛ 2 ⎛ ΔxΔy + ⎜ u 2 + p − Δy ⎟ 1 Δy − ⎜ u + p − ⎟ Re ∂ x ⎠i + . Here we discuss some popular upwind schemes.1. j ⎝ ⎝ 2 2 ⎛ ⎛ 1 ∂u ⎞ 1 ∂u ⎞ + ⎜ uv − Δx − ⎜ uv − Δx = 0 ⎟ ⎟ Re ∂ y ⎠i . j 2 . + j − ui . 5.3) where the velocities at the volume surface can be obtained by a linear interpolation as: u n 1 i+ . j 2 = uin−1. Comparing to the central difference scheme. UPWIND SCHEME In modern CFD. j+1 i. j + 1 Re ∂ y ⎠i . Notation used for a control volume 6. 5.1) The discretized equation can be obtained by integration of (5.1) over a control volume: + ⎜u ∫∫ ⎢ ⎣ ∂t ∂ x ⎝ S ⎡ ∂u ∂ ⎛ 2 + p− 1 ∂u ⎞ ∂ ⎛ 1 ∂ u ⎞⎤ ⎜ uv − ⎟ ⎥dS = 0 ⎟+ Re ∂ x ⎠ ∂ y ⎝ Re ∂ y ⎠ ⎦ n n (5. j + uin. we have n 1 uin. j-1/2 i. j-1 Δy i -1. u n 1 i− .… y Δx i. j i +1. j+1/2 i -1/2.2) According to the notation shown in Fig. j + uin. and less oscillations in the solution. the upwind scheme generally gives more accurate prediction of propagation of information in a flow. 6. j Re ∂ x ⎠i − 1 . j 2 .1 Upwind Schemes for FDM We consider a one dimensional advection equation with a constant advection velocity u: . j i. j i. j 2 = uin+1.1.12 ∂u ∂ ⎛ 2 1 ∂u ⎞ ∂ ⎛ 1 ∂u ⎞ + ⎜ uv − ⎟=0 ⎜u + p − ⎟+ ∂t ∂ x ⎝ Re ∂ x ⎠ ∂ y ⎝ Re ∂ y ⎠ (5.

1) The first order upwind scheme has been given by (3. ⎧ 2 fi +1 + 3 f i − 6 f i −1 + fi − 2 u ⎪ ⎛ ∂f ⎞ ⎪ 6Δx u ⎜ ⎟ i= ⎨ ⎝ ∂x ⎠ ⎪ − fi + 2 + 6 f i +1 − 3 fi − 2 fi −1 u ⎪ 6Δx ⎩ Or in compact form we have if u > 0 (6. the second term is proportional to ∂ 4 f ∂x 4 . 6. 6. The first order upwind differencing can be written as: . the conservation form of the 1-D advection equation (6. For computation of high Reynolds number flow. it is only used for relatively low Reynolds number problems. the advection term of (6.4) f i −1 f i −1 2 fi f i +1 2 f i +1 xi −1 2 xi xi +1 2 Fig. works as numerical diffusion term. which is proportional to the advection velocity and the grid spacing.2 Upwind Schemes for FVM In FVM.10) and (3.1.1 Control volume for 1-D case Using the control volume shown in Fig.2) if u < 0 3 − fi + 2 + 8 fi +1 − 8 f i −1 + fi − 2 u Δx fi + 2 − 4 fi +1 + 6 fi − 4 f i −1 + fi − 2 ⎛ ∂f ⎞ − u ⎜ ⎟ i= u 12Δx 3 4 Δx 4 ⎝ ∂x ⎠ (6. the first term represents a central difference.3).13 ∂f ∂f +u =0 ∂t ∂x (6.1) is used: ∂ (uf ) ∂f + =0 ∂t ∂x (6.4) can be discretized as: ∂ (uf ) 1 ∂x i Δx ⎡ ⎤ ⎢(uf )i + 1 − (uf )i − 1 ⎥ ⎢⎣ 2 2⎥ ⎦ (6. the following third order upwind scheme is often used. As the first order scheme may introduce too much numerical diffusion. 6.11).3) In the right hand side of(6.5) The basic idea of upwind scheme for FVM is to use an upwind side value to approximate the volume surface value f i+ 1 2 or f i− 1 2 .

CIP METHOD 7. using an upwind differencing technique for the advection term of Navier-Stokes equations is necessary for a stable numerical calculation. We find that the profile of f becomes smoother after time stepping.1 The Principle of CIP Method As described in the previous chapter. About 20 years ago CIP method was also presented for the first time as a high order upwind scheme..7) 7. The cost of the use of upwind scheme is introducing excessive numerical diffusion and associated inaccuracies. e. et al. ⎨ ⎪ fi − 1 = fi ⎩ 2 ⎧ f 1 = fi ⎪ i+ 2 for u<0 ⎨ ⎪ f i − 1 = f i −1 ⎩ 2 ⎧ ⎪ u (f − f ) u > 0 ⎪ i −1 ⎤ ⎪ Δx i − (uf )i − 1 ⎥ ⎪ ⎨ u ⎥ ⎪ 2⎦ ⎪ ( fi +1 − fi ) u < 0 ⎪ ⎪ ⎩ Δx or in a unified form.1 (a) – (c). which uses a quadratic interpolation to express f For example: i+ 1 2 or f i− 1 2 .g. The reason for this .6) A widely used high order upwind scheme is known as the QUICK scheme (Quadratic interpolation for Convective Kinematics).14 ⎧ f 1 = f i +1 ⎪ i+ 2 for u>0. results in numerical diffusion. ∂ (uf ) 1 ⎡ ⎢(uf )i + 1 2 ∂x i Δx ⎢⎣ (6. As shown in Fig 7. To explain the CIP method we start from the following 1D advection equation: ∂f ∂f +u =0 ∂t ∂x (7. which can be constructed by adjacent two grid points. We can use different finite difference schemes for numerical solution of this equation. a first-order upwind scheme. QUICK.1) This equation represents a translational motion of a wave with velocity u. f i+ 1 2 ⎧ 3 6 1 ⎪ ⎪ fi +1 + fi − fi−1 ⎪ 8 8 8 =⎪ ⎨ ⎪ 1 6 3 ⎪ − fi +2 + fi +1 + fi ⎪ ⎪ 8 8 ⎩ 8 u>0 u<0 Then we have ⎧ u 3 3 7 1 ⎪ ⎪ ( fi +1 + fi − fi−1 + fi−2 ) u > 0 ⎪ ∂ (uf ) Δx 8 8 8 8 ⎪ ⎨ ⎪ u 1 7 3 3 ∂x i ⎪ (− fi +2 + fi +1 − fi − fi−1 ) u < 0 ⎪ 8 8 8 8 ⎪ ⎩ Δx (6. Efforts to reduce such numerical diffusion have resulted in many high order upwind schemes. TVD.

1) with respective to x. For the case of u > 0 we may approximate a profile for f n inside the upwind cell [ xi −1 . (reproduced from Yabe. 1 (d). It uses the grid point value and its spatial derivative (gradient) in two grid points to form a cubic polynomial to approximate the profile. For simplicity we assume a constant advection velocity.1. Then Eq. et al. (c) When (b) is linearly interpolated.2) has the same form as Eq. (d) In the CIP. (7. the spatial derivative also propagates and the profile inside a grid cell is retrieved. shows a different way from the conventional high-order schemes to reconstruct the profile inside a grid cell. However. The CIP scheme. shown in (b) at discretized points. (7. +u = −g ∂t ∂x ∂x (7. which is illustrated in Fig. such high-order scheme generally has the problem of overshooting. We can build a high-order upwind scheme by using more than two grid points to reconstruct the profile inside the grid cell. JCP) By differentiating Eq. (a) The solid line is the initial profile and the dashed line is an exact solution after advection. (7. The principle of the CIP method.3) .2) where g = ∂f ∂x . 3 2 (7. we have the equation about the spatial derivative as ∂g ∂g ∂u .7.15 numerical diffusion is that by linear interpolation the information about the profile inside the grid cell is lost. u Δt (a) (b) (c) (d) gradient Fig.1). xi ] as Fi n ( x ) = ai ( x − xi ) + bi ( x − xi ) + ci ( x − xi ) + di . numerical diffusion appears.

5) CIP was at first interpreted as ‘Cubic-Interpolated Propagation’. 3. the time evolution of the function f and g can be obtained by using the following Lagrangian invariants. CIP Formulation in Multi-dimensions . development of CIP method has resulted in many schemes that not only use cubic but also other order of polynomials.. This means that to achieve a certain computational accuracy less grid number may be used by CIP scheme than by conventional high-order upwind schemes. However. CIP uses function as well as its spatial derivatives as dependent variables for constructing profile. n n fi − and gin−1 . Comparing to conventional upwind schemes CIP has the following features: 1. (7. Therefore. CIP was recently interpreted as ‘Constrained Interpolation Profile’.3) can be determined by using known quantities fi n .4) Therefore we call the CIP scheme as a Semi-Lagrangian method.16 u Δt Fi n fi n +1 fi n Fi n+1 xi −1 Fig. It is not difficult to obtain 1 . i. the calculation costs do not increase even if the additional variables (spatial derivatives) are introduced. 7. 7. 2.2. gin +1 = dFi n ( xi − u Δt ) dx . xi CIP scheme as a kind of Semi-Lagrangian method As shown in Fig. which can be easily imagined from the above discussion. Owing to the use of spatial derivatives the profile inside a grid cell can be well reconstructed. (7.7. Sub-cell resolution. a cubic polynomial can be determined by using the information at grid points that belong to one grid cell. di = f i n .2. Δx 2 Δx 3 ci = gin . (7.2 the profile at the time step n+1 is obtained by shifting the profile with −u Δt . gi n n gin + gin−1 2 ( f i − f i −1 ) − .e. Compact high order scheme. According to the procedure shown in Eq. fi n +1 = Fi n ( xi − u Δt ) . n n 2 gin + gin−1 3 ( f i − f i −1 ) − Δx 2 Δx ai = bi = (7. The four unknown coefficients in Eq.4).

jw). by using a fractional step method. and (iw.7) can be treated in a different calculation step. x2 j ) (u1 . (7. which can be determined by the known values of χ n and (∂ χ ) ξ n at grid points (i. iw=i-sign(u1).η 2 ) χ n +1 ( x1i . (7. . ∂ξ ∂xi where ∂ξ χ = ∂χ ∂xi . and the value of χ n at the grid point (iw.17 We write a general advection equation about a function χ and the equation about its spatial derivative as ∂χ ∂χ + ui =0. Here. ∂t ∂xi ∂ ( ∂ξ χ ) ∂t + ui ∂ ( ∂ξ χ ) ∂xi =− ( i = 1. jw). jw). x2 jw ) ˆ1 = x1i − u1Δt x ˆ2 = x2i − u2 Δt x x2 χ x1 ( x1i . We shall give the cubic polynomials for two. As shown in the next section. There are 10 unknown coefficients in Eq. (iw.3. jw=j-sign(u2). We can find an upwind cell with four grid points. let us consider a grid point (i. u2 ) Fig. Here the superscript ‘n’ denotes the current time level.8). the right hand side (RHS) term of Eq. jw). j). CIP Interpolation for two-dimensional case For a two-dimensional case. Cmn . 7. x3 ).3. x2 jw ) ˆ1 . j). x2 j ) ( x1iw . η 2 = x2 − x2 j . x2 .and three-dimensional cases. Then the time evolution of χ and ∂ξ χ can be done by the CIP scheme described in the previous section. Χ n (η1 . 3 ) . The concept of CIP interpolation for two-dimensional case is shown in Fig. 2. j).η 2 ) = C30η1 + C21η1 η 2 + C12η1η2 + C03η2 3 2 2 2 2 3 + C20η1 + C11η1η 2 + C02η 2 + C10η1 + C01η2 + C00 . x ˆ2 ) (x ( x1i . (7. j) and (i. (iw. Then a cubic polynomial to approximate the spatial distribution of the function χ in the upwind cell can be written as Χ n (η1 . (i.6) (7. j).8) where η1 = x1 − x1i .7. x2 j ) ( x1iw .7) ∂ui ∂χ . ( ξ = x1 . (i. (7.

Therefore in our numerical method we use Eq.η2 . j). j. jw. j.9) is negligible. and the value of χ n at the grid points (iw. kw). A cubic polynomial determined by using all continuity conditions can be as follows: Χ n (η1 . we can write a cubic polynomial that is determined by 32 continuity conditions as follows.8). (iw. k) and (i.η2 .11) + C200η1 + C020η2 + C002η3 + C110η1η 2 + C011η2η3 + C101η1η3 2 2 2 + C100η1 + C010η2 + C001η3 + C000 Once the interpolation function is determined. (iw. k). can be determined by using the known values of χ n and (∂ χ ) ξ n at the grid points (i.6) and (7. kw) and (iw. k). Since there are 32 continuity conditions that can be used for one cell.10) contains 20 terms. (i. kw). j. For the same reason we also use a less-term formula for three-dimensional case as described below. k). The profile near (iw. kw). jw. The cubic polynomial we are using to approximate the profile in the upwind cell is Χ n (η1 . jw. j. (iw.18 It should be noted here that as we do not use the continuity condition for (∂ χ ) ξ n at the grid point (iw. (i. which is the farthest grid point from the concerning point (i. jw. jw.η2 ) = C31η1 η2 + C13η1η2 + C30η1 + C21η1 η2 + C12η1η2 + C03η2 3 3 3 2 2 3 + C20η1 + C11η1η 2 + C02η 2 + C10η1 + C01η 2 + C00 2 2 . (7. although we do not use it in our computation model.7) is . (7. j. we can find an upwind cell with eight grid points. (7. jw. Clmn . j. (7. kw). jw) . the advection calculation by Eqs (7. (i. k). kw).η3 ) = C311η1 η2η3 + C131η1η2 η3 + C113η1η 2η3 3 3 3 3 3 3 3 3 3 + C310η1 η2 + C301η1 η3 + C130η1η2 + C031η2 η3 + C103η1η3 + C013η 2η3 + C211η1 η 2η3 + C121η1η 2 η3 + C112η1η 2η3 2 2 3 3 3 2 2 2 2 + C300η1 + C030η2 + C003η3 + C111η1η2η3 + C210η1 η 2 + C021η2 η3 + C102η1η3 + C120η1η2 + C012η2η3 + C201η1 η3 2 2 2 . kw). k). j. jw) may not be correct by Eq.8) and (7. k). Let us consider a grid point (i. (i. kw) and (iw. Χ n (η1 . k). Here. (iw. The 20 unknown coefficients. (iw. (7.8) for the sake of simplicity.9) However.η3 ) = C300η1 + C030η2 + C003η3 + C111η1η2η3 3 3 3 + C210η1 η 2 + C021η2 η3 + C102η3 η1 + C120η1η2 + C012η 2η3 + C201η3η1 2 2 2 2 2 2 + C η + C020η2 + C002η3 + C110η1η 2 + C011η2η3 + C101η1η3 2 200 1 2 2 . (i. k) for three-dimensional case. jw. Eq. jw. j. (7. (i. j. kw=k-sign(u3).10) + C100η1 + C010η2 + C001η3 + C000 where η3 = x3 − x3k . numerical tests showed that the difference between the results using Eqs (7.

4. ( ∂ x1 x2 χ ) . jw ˆ2 . jw . jw ∂x2 ∂x2 ( ) . x2 j ) (u1 . j ( n i . C-type CIP Step 1 ˆ2 ) = CIP 1D χ in. 7. x n i. ( ∂ x2 χ ) . x2 jw ) ( x1iw . . u2 ) (a) A-type CIP (b) C-type or M-type CIP Fig. ( ∂ x1 χ ) . ( x1i . . . x ˆ2 ) (x step 2 step 1 ( x1iw . x n n i. x CIP 1D ( ∂ x1 χ ) . x2 j ) ( x1iw . ( ∂ x1 x2 χ ) n i .19 carried out by a semi-Lagrangian procedure as χ n +1 ( x ) = Χ n ( x − u n Δt ) . x2 jw ) ( x1iw . x2 = x ) ∂ x1 x2 Ai = n n n n ∂ ∂ ˆ2 ) = ˆ2 . x2 jw ) ( x1i . . ( ∂ x1 x2 χ ) .12) (7. x2 = x . ( ∂ x1 x2 χ ) . ∂ x1 χ n ( x1i . by which the multi-dimensional CIP calculation can be done by repeating one-dimensional CIP calculation. x2 j ) ˆ1 . x CIP 1D χ in. jw i j i ∂x2 ∂x2 ( ) ˆ2 ) = CIP 1D ( ∂ x1 χ ) . which is called A-type CIP scheme. x2 = x ) ∂ x2 Ai = n n ∂ n ∂ ˆ2 ) = ˆ2 . x ˆ2 ) (x ( x1i . u2 ) (u1 . χ in. j i. (7. jw ˆ2 . The concept is shown in Fig. . ( ∂ x2 χ ) . ( ∂ x2 χ ) . j . jw .7. x2 j ) ˆ2 ) ( x1i . x2 = x i j i j i jw i . ∂ξ The above-described method is the most popular way for multi-dimensional formulation of CIP scheme. χ in. χ ( x1i .13) ( ∂ξ χ ) n +1 ( x) = ∂Χ n ( x − un Δt ) . x2 j ) ( x1i . j ( n i . Another multi-dimensional extension method is to make use of a directional splitting method. C-type and M-type CIP schemes in two dimensions Here we introduce two such kind of CIP method: C-type CIP and M-type CIP. x ˆ1 . jw . ( ∂ x2 χ ) Ai = χ n ( x1i . ( ∂ x1 χ ) ∂ x1 Ai = ∂ x1 χ n ( x1i . j . Concept for A-type. x2 jw ) χ n +1 (x 1i . .4 for a two-dimensional case.

∂ x2 Aiw . x CIP 1D χ in. Here we have used a linear interpolation denoted as FDM_1D. ( ∂ x1 χ ) n i. ∂ x1 Aiw . jw ˆ2 . x1 = x1 ) . M-type CIP Step 1 ˆ2 ) = CIP 1D χ in. 1 1 1 ∂ x1 χ in. ∂ x Ai . ∂ x Aiw . 1 ∂ x1 x2 χ in. ∂ x Ai . ∂ x1 Aiw . 1 1 1 ∂ x1 χ in. should be introduced. The demerit is some extra dependent variables. However. ( ∂ x2 χ ) Ai = χ n ( x1i . For the sake of simplicity M-type scheme is often used in multi-dimensional computations. ∂ x1 Ai . + j = ∂ ˆ1 ) . The merit is its easy extension to multi-dimensions. . a so-called M-type CIP scheme was developed. for two-dimensional case the second order derivative ∂ x1 x2 χ . To avoid using higher order spatial derivatives. x1 = x1 ) . Aiw . + j = ∂ ˆ1 ) . + j = ∂ ˆ1 ) . CIP 1D ( Ai . ∂ x2 Aiw . + j = CIP 1D ( Ai . j . ∂ x1 x2 Ai . jw ˆ2 . + j = CIP 1D ( ∂ x2 Ai . x2 = x ) ∂ x2 Ai = n n ∂ n ∂ ˆ2 ) = ˆ2 . ( ∂ x2 χ ) . . ( ∂ x2 χ ) . ( ∂ x2 χ ) . x1 = x ∂x1 1 ˆ ∂ x2 χ in. CIP 1D ( Ai . Aiw . jw ∂x2 ∂x2 ( ) ∂ x1 Ai = FDM 1D ( ∂ x1 χ ) . The precision of M-type CIP scheme may be less than A-type and C-type CIP schemes. χ ( x1i . + j = FDM 1D ( ∂ x2 Ai . x n i. x1 = x ∂x1 The C-type CIP is as same accurate as the A-type CIP. x2 = x i j i . ∂ x1 Ai . χ in. ∂ x Aiw . Aiw . j ( n i . + j = CIP 1D ( Ai . Aiw . j . ∂ x1 x2 Aiw . . . x1 = x ∂x1 1 ˆ ∂ x2 χ in. ∂ x1 x2 Aiw . numerical experiments have shown that the difference in the computation results by the three schemes is not remarkable. ∂ x2 Aiw . χ in. jw . j ( n i . x2 = x ) Step 2 1 ˆ χ in. x1 = x1 ) . CIP 1D ( ∂ x2 Ai . ∂ x1 x2 Ai .20 Step 2 1 ˆ χ in. jw . x1 = x1 ) .

as an example to learn how to code a Fortran program for a CFD calculation of an incompressible flow. NUMERICAL METHODS FOR INCOMPRESSIBLE FLOW One of the difficulties in solving incompressible flow is that there is no independent equation for the pressure. Further. In the following. To explain the MAC method the following vector form of the governing equation is used. but provides a kinematic constraint for velocity field.1. and can still be found in many applications. List of numerical method for incompressible A list of currently often-used numerical methods for incompressible flows is shown in Fig. SOLA) SIMPLE (Semi-Implicit Method for Pressure-Linked Equations) SIMPLER (SIMPLE Revised) FS (Fractional Step) Patankar (1980) Yanenko (1971) Fig. p) as follows. Effects to solve such difficulty have resulted in many numerical methods for incompressible flow in the past several decades.1. we describe a method for an uniform flow past a square. the continuity equation is not a dynamic equation. most of these methods apply a way to construct the pressure field so as to satisfy the continuity equation.21 8. 8. We shall use the MAC method.2) =− MAC (Marker-And-Cell) Projection Method SMAC (Simplified MAC) Harlow and W Welch elch (1965) Chorin (1968) MAC Family Amsden and Harlow (1970) Hirt and Cook (1972) Patankar (1980) HSMAC (Highly Simplified MAC. To treat the difficulty of pressure-velocity coupling. ∂ui ∂x i ∂ui ∂t + uj ∂u i ∂x j =0 2 1 ∂ ui ∂p + Re ∂ x j ∂ x j ∂x i (8. In this lecture we shall discuss the methods using governing equations of primitive variables (u.1) (8. . an old method that has initiated many modern incompressible flow solvers. whose gradient contributes to the momentum equations. 8.

The pressure is solved by Equation (8. i. This leads to the second feature.5).3) (8.e.3).6) The third feature is the use of staggered mesh as shown in Fig. in which the pressure and the velocity components are defined at different locations.4) There are 3 significant features for MAC method. We have ∇ 2 p n +1 = − D n +1 − D n 1 2 n + ∇ D −∇⋅⎡ ∇ ⋅ ( unu n )⎤ ⎣ ⎦ Δt Re (8.2. let D n +1 = 0 . let the velocity divergence at the current time step remain in (8. 8. (8.5) to satisfy the continuity equation (8. . a cycle-to-cycle self-adjustment procedure..5) where D = ∇ ⋅ u is the divergence of the velocity field. In (8. The biggest advantage of staggered arrangement is the strong coupling between the velocities and the pressure. In Cartesian coordinates.5) to modify the pressure distribution. The pressure equation to be solved becomes ∇ 2 p n +1 = Dn 1 2 n + ∇ D −∇⋅⎡ ∇ ⋅ ( unun )⎤ ⎣ ⎦ Δt Re (8.22 ∇⋅u = 0 ∂u 1 + ∇ ⋅ ( uu ) = −∇p + Δu ∂t Re (8. the staggered arrangement offers several advantages over the collocated arrangement in which all variables are defined at the same grid point.4). This helps to avoid numerical oscillations in pressure and velocity field. The first feature is that a pressure equation is derived by taking divergence of Eq. but D n = ∇ ⋅ u n ≠ 0 .

8) + ( 8. It should be noted that as shown in the figure 8. The governing equations for a 2-D incompressible flow can be as: ∂u ∂v + =0 ∂x ∂ y (8. j +1 2 1 j+ 2 j 1 2 i− 1 2 ui +1 2. + ∂x ∂y ∂D D n +1 − D n Dn . then in Eq. the control volume for the pressure and the velocity components are in different locations due to the staggered arrangement.23 CV of v CV of p vi . j CV of u pij j− i i + 1 2 Fig. (8. Here we write the discretized equations for coding a computation program using MAC method to solve a uniform past a square cylinder. Staggered arrangement of velocity components and pressure We shall use the finite volume method for discretization. ≈− Δt ∂t Δt .2.9) ⎛ ∂ 2u ∂ 2u ⎞ ∂u ∂u 2 ∂uv ∂p 1 ⎜ + + =− + ⎟ ⎜ 2 + 2⎟ ⎟ ∂t ∂x ∂y ∂x Re ⎜ ∂y ⎠ ⎝ ∂x ∂v ∂uv ∂v 2 ∂p 1 ⎛ ∂ 2v ∂ 2v ⎞ ⎟ ⎜ + + =− + + ⎟ ⎜ ⎟ ∂t ∂x ∂y ∂y Re ⎜ ⎝ ∂x 2 ∂y 2 ⎠ ∂ ∂ ( 8.10).10) where D = ∂u ∂v . 8.9 ) ∂x ∂y The Poisson equation about the pressure is derived by taking ⎛ ∂ 2D ∂ 2D ⎞ ∂2 p ∂2 p ∂2u 2 ∂ 2v 2 ∂ 2uv ⎟ − ∂D ⎜ ν + = − − − 2 + + ⎟ ⎜ 2 2 2 2 2 2 ⎟ ⎜ ∂x ∂y ∂x ∂y ∂x ∂y ∂y ⎠ ∂t ⎝ ∂x (8. we assume D n +1 = 0 .8) (8. According to MAC method.2.7) (8.

8) and (8.7) .j i+ .j 2 )} (8. j − ui.10) can be carried out by finite volume method as follows. a upwind scheme is required for such advection term. j (u 1 − u 3 ) − ui. j +1 )2 − (vi. we obtain ⎛ ∂u 2 ∂uv ⎞ ⎟ + CX = ⎜ ⎟ ⎜ ⎟ 1 ⎜ ∂y ⎠ ⎝ ∂x i+ .j 2Δx i +1. j −1 2 −u 1 i+ . discretizations are obtained by integration over the control volume of u 1 i+ .j 2 + ui +1.j 2 +u 1 i + . j 2 u 3 i+ .j i− . j ui. j +1 2Δy i + 2 2 2 2 2 2 2 2 1 1 i+ .j i− . j +1 i+ .j + i+ . j ui +1. j ui . j −1 2 )− v 1 1 i+ . j )2 − (ui.j 2 ui . For momentum equation (8.(8. j + i− .j + 2 2 2 2 v −u 1 1 1 1 i− .j 2 1 = {u (u 1 + u 3 ) + ui +1.j + i+ . j (u 1 + u 1 ) − ui.j− 2 2 2 2 v Δy v (vi.9). j ui +1.j− 2 2 −v (u 1 i+ .8) and (8.13) .j 2 u 1 1 1 1 i+ . j + 2 u 1 1 1 1 i+ . for numerical stability. the first order upwind scheme give ⎟ ⎟ 1 ⎜ Δ x ⎝ ∂x ⎠ i+ . j = u i . j = ui +1. ⎛ ∂u Taking ⎜ ⎜ ui +1.j i+ .9). j )2 Δy (8. j + ui . j + ui +1. j )2 ⎛ ∂u 2 ∂uv ⎞ ⎟ ⎜ + = + CX = ⎜ ⎟ ⎟ 1 ⎜ ∂y ⎠ Δx ⎝ ∂x i+ .j + i+ .j− i+ . For advection term. Here we apply a first order scheme.j i + . respectively. j − ui .j 2 Doing such discretization to all advection terms in (8. j 2 u 1 i+ .j− 2 2 (u 1 i + . j 2 u 1 i+ .j i+ .j + i+ .j i + .24 Discretization of the governing equation (8.12) As has been pointed. j + 2 2 2 2 Δx + (8.j + 2 2 2 2 v −u 1 1 1 1 i+ . j ⎞ ⎟ as an example.11) ⎛ ∂uv ∂v 2 ⎞ ⎟ ⎜ + CY = ⎜ ⎟ ⎟ 1 = ⎜ ∂x ∂y ⎠ ⎝ i.j i+ . j 2 and v i. j (u 1 − u 1 )} . j − ui +1.j 2 2 ui +1. j i+ . a central difference scheme give (ui +1. j 2 u 1 i− . j i + 2 2 2 2 2 2 2 2 + 1 {v 1 1 (u 1 + u 1 ) + v 1 1 (u 1 − u 1 ) . j + 1 2 . j 2 + ui .

pi +1.j + i+ . j + 1 2 Discretization for pressure equation is performed by a central difference scheme. j + 1 2 (∂v ∂x ) 1 1 i+ . ∂2u ∂2u ⎞ 1 ⎛ 1 ⎜ + 2⎟ = VX = ⎟ ⎜ 2 ⎟ ⎜ ∂x ∂y ⎠i + 1. j + i. j + 1 2 +v i. j +1 − 2pi.j i+ .j + 2 2 − ∂ v ∂x Δx ( ) 1 1 i− .j 2 1 i+ . j Re ⎝ Re 2 (∂u ∂x ) i +1. j − ⎟ ⎟ 1 ⎜ ⎜ 2 2 2 2 2 2 ⎟ ⎜ ⎟ = + ⎜ 2 2 ⎟ ⎜ ⎟ Re ⎜ Δx Δy ⎟ ⎟ ⎜ ⎝ ⎠ (8.17) (8. j + Δt ⎜ ⎟ ⎟ ⎝ ⎠ Δx pi .j + 2 2 + 1 Re (∂v ∂y ) i . j ⎞n ⎛ ⎟ + Δt ⎜ − + − CY VY ⎟ ⎜ ⎟ ⎜ Δy ⎝ ⎠ (8. j +1 i+ . j − i. j i + . j + i +1. j + i.18) v n +11 = v n i. j + 2 i. j − 2pi.16) The discretized momentum equations are u n +11 = u n i+ . j + i. j + 2 2 (v i −1. j + i +1.14) For diffusion term of the momentum equations a central difference scheme is applied.25 ⎛ ∂uv ∂v 2 ⎞ ⎟ CY = ⎜ + ⎟ ⎜ ⎟ 1 ⎜ ∂x ∂y ⎠ ⎝ i. j + 2Δy i .j− 2 2 ⎛ u 3 − 2u 1 + u 1 u 1 − 2u 1 + u 1 ⎞ i+ . j + pi. j + i. j + i. j +1 − pi .j + 2 2 (v i −1. j + 1 2 −v i.j 2 p − pi. j + 2Δx i + 2 2 2 2 2 2 2 2 −u 1 1 i− . j −1 Δy 2 = Ri. j Δy ⎛v − 2v 1 + v v 3 − 2v 1 + v 1 ⎞ 1 1 i +1. j + i −1. j (v 1 + v 1 ) − vi. j +1 i. j + 1 2 )− u 1 1 i− . j − ∂ u ∂x ( ) i. j − i. j (8.j + 2 2 − ∂ u ∂y Δy ( ) 1 1 i+ .19) . j + i. j +1 (v 1 − v 3 ) − vi.j + i. j + pi −1. j −1 ⎟ ⎟ 1 ⎜ ⎜ 2 2 2 2 2 2 ⎟ ⎜ ⎟ = + ⎜ 2 2 ⎟ ⎟ Δ Δ Re ⎜ x y ⎜ ⎟ ⎟ ⎜ ⎝ ⎠ (8.j i + . j +1 − ∂v ∂ y ( ) i. j Δx 1 + Re (∂u ∂y ) 1 1 i+ . j + 1 2 )} + 1 {v (v 1 + v 3 ) + vi .15) 1 ⎛ 1 ∂2v ∂2v ⎞ ⎟ ⎜ VY = + = ⎟ ⎜ 2 2⎟ ⎜ Re ⎝ ∂x Re ∂y ⎠i. j + 2 2 2 2 2 2 2 2 (8. j (v 1 + v 1 )} i. j + i. j + 2 = 1 {u 1 1 (v 1 + v ) + u 1 1 (v 1 − v ) 1 1 . j + i.j i− . j ⎞n ⎛ ⎟ ⎜−CX + VX − i +1. j Δx 2 + pi. j + i.

j −1 ⎞ Di. . NY are grid number in x. . SOLUTION OF LINEAR SYSTEM Since most of the CPU time will be spent to solve the Poisson equation (8. ⎟ Δx Δy ⎜ ⎝ 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2⎠ + ⎛ Di +1. Eq. The treatment of boundary condition on complicated geometry is simple.+ ⎟ i. j i −1. it is easy to understand and implement. Here M = NX × NY .20) u and Di. j ⎜ i +1. the use of a fast solution method is important for increasing the total computation efficiency. j is the discretized RHS of (8. j ⎛ p k − 2p k + p k ⎞ pik. j (9. j +1 − 2Di. respectively. j i −1. The stationary method is an old method. j Di. Typical stationary methods are as follows: Jacobi method: p k +1 i. j +1 − 2vi2. j +1 − 2pik. j + Di −1. In the initial stage of code development the stationary method is often applied for the Poisson equation. . (8. j ⎟ ⎜ Δx Δy ⎟ ⎝ ⎠ (9. j ⎜ i +1. j + ui2−1. j + pik. and NX. There are two types of iterative methods: the stationary method and the nonstationary method. j 1 ⎜ ⎟ ⎟ + + ⎜ ⎟ ⎟ Δx 2 Δy 2 Re ⎜ ⎝ ⎠ Δt ui2+1. For a sparse linear system we need to use an iterative method for numerical solution.10) ⎛ ∂2u 2 ∂ 2v 2 ⎞ ∂D ⎞ ∂ 2uv ∂ 2 D ∂ 2D ⎟ 1 ⎛ ⎟ ⎜ ⎟ − − − + + − Ri. j + vi2. (9. i j i j i j i j i j i j + + + + + − + − − + − + i − j − i − j − . j 2 u − i.+ p ⎟ ⎜ 2 2 j i. j ⎟ = + Δ + pik. j + 1 2 −u Δy i. x and b are vectors with M elements. We rewrite it as Ax = b .and y-direction. j = ⎜ 2 ⎟ ⎜ ⎜ ⎟ 2 2 2 2 ⎟ ⎜ ⎜ ⎟ ⎜ ∂y ∂x ∂y Re ⎝ ∂x ∂y ⎠ ∂t ⎠ ⎝ ∂x i. However. . j ⎟ = p + Δ⎜ + − R ⎜ 2 2 i. j −1 ⎟ i. j − 1 2 9. j ⎟ ⎟ ⎜ Δ Δ x y ⎟ ⎝ ⎠ k i.19). j + Di.1) where A is a M × M matrix. j =− − Δx 2 Δx 2 ⎞ 1 ⎛ ⎟ ⎜ ⎜ − u 1 1v 1 1 − u 1 1v 1 1 − u 1 1v 1 1 + u 1 1v 1 1 ⎟ ⎟ ⎜ ⎟ .3) . j −1 (8. . j + pik. j = 1 i+ . j vi2.19) represents a sparse linear system for p. . j − 2Di. j − 2ui2.2) Gauss-Seidel method: 1 ⎛ p k − 2p k + p k +1 ⎞ pik. j j −1 1 k ⎜ − Ri.j 2 −u Δx 1 i− .26 where Ri. j +1 − 2pik.

The use of Cartesian grid can greatly simplify the structure of the code and increase the computation efficiency for problems with complicated free surfaces and moving bodies. we need to treat the free surface and body boundary.27 SOR method: (9. The disadvantages of this method are the difficulty in capturing the inner boundaries and the low accuracy of the calculation around those interfaces. For example.4) where is an acceleration coefficient and . the grid generation for problems with complex boundaries is troublesome and re-grinding process for unsteady problems is computationally costly.1. These methods are usually hard to understand. 10. Nevertheless the rate of convergence is too low to be used for the large-scale linear system in a three-dimensional computation. we do not solve the domain outside the water but let the free surface and the body surface as moving domain boundaries to be determined. In the past 20 years a lot of nonstationary iterative methods are developed. The advantage of this method is its high resolution for boundary layer computation. For domain dividing method. The numerical methods for the problem with complex geometries can be roughly divided into two categories: domain dividing method and domain embedding method as shown in Fig. The efficiency of the method largely depends on the so-called preconditioner. The domain embedding method uses a Cartesian grid. However. PROBLEM WITH COMPLEX GEOMETRIES Generally a practical engineering flows may contain complex geometries. which are not comformal to the Cartesian grid lines. and sometimes is also called Cartesian grid method. . SOR may be the most efficient stationary method. The widely used CG methods (Conjugate Gradient) belong to nonstationary iterative methods. Another fast solution method that need to note is the multigrid method. The name of ‘nonstationary iterative’ may come from the use of iteration-dependent coefficients. in the problem of a floating body moving in a free surfacee. A curvilinear grid or an unstructured grid that adapted to these boundaries is required. 10. but they can be highly effective.

a structured grid is used in the physical plane. ⎧ ⎪ ⎪ξ = ξ (x . y ) ⎪ ⎪ ⎩ ⎧x = x (ξ. 10. Fig.2. η ) ⎪ ⎪ ⎩ (10. 10. Coordinate transformation for FDM As shown in Fig 10.2. in which each grid line is a line of constant coordinate ξ or η . η ) ⎪ ⎪ ⎨ ⎪ y = y (ξ. The two grids have the following relations.28 (a) Domain dividing (b) Domain Fig.1 Two approaches to complex geometry problems In this Chapter we introduce a domain dividing approach in which a finite difference method based on coordinate transformation is used.1) and transformations of their derivatives are ⎛∂⎞ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ∂ξ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜∂⎟ ⎟= ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ∂η ⎠ ⎝ ⎟ ⎡ ∂x ⎢ ⎢ ∂ξ ⎢ ⎢ ∂x ⎢ ⎢⎣ ∂η ∂y ⎤ ⎛ ∂ ⎞ ⎥⎜ ⎟ ⎜ ⎟ ⎟ ∂ξ ⎥ ⎜ ⎟ ⎜ ∂x ⎟ ⎟ ⎥⎜ ⎜∂⎟ ⎟ ∂y ⎥ ⎜ ⎥⎜ ⎟ ⎟ ⎜ ⎟ ∂η ⎥⎦ ⎝ ∂x ⎠ ⎛∂⎟ ⎞ ⎜ ⎟ ⎜ ⎟ ⎜ ∂x ⎟ ⎜ ⎟ = ⎜ ⎟ ⎜∂⎟ ⎟ ⎜ ⎟ ⎜ ⎟ ⎜ ⎝ ∂x ⎠ ⎟ ⎡ ∂ξ ⎢ ⎢ ∂x ⎢ ⎢ ∂ξ ⎢ ⎢⎣ ∂y ⎛∂⎞ ∂η ⎤ ⎜ ⎟ ⎥⎜ ⎟ ⎟ ⎜ ∂ξ ⎟ ∂x ⎥ ⎜ ⎜ ⎥⎜ ⎟ ⎟ ⎟ ∂η ⎥ ⎜ ∂ ⎟ ⎟ ⎥⎜ ⎟ ⎜ ∂y ⎥⎦ ⎜ ⎝ ∂η ⎟ ⎠ ⎟ (10. The body boundary is one of the grid line.2) which is characterized by the Jacobian . y ) ⎨ ⎪ η = η (x . The correspondent computational grid is uniform with regular boundaries.

4)-(10.8) ηy = x ξ / J ξx = y η / J ηx = −y ξ / J ξy = −x η / J (10.6) We will make use of the following relations ⎛ fξ ⎞ ⎛x ξ ⎟ ⎜ ⎜ ⎟ ⎜ = ⎜x ⎜f ⎟ ⎟ ⎜ η ⎜ ⎟ ⎝ η⎠ ⎝ y ξ ⎞ ⎛ fx ⎞ ⎟ ⎜ ⎟ ⎟ ⎜ ⎟ ⎜f ⎟ ⎟ yη ⎠ ⎟ ⎟⎝ ⎜ y⎠ ⎟ −y ξ ⎞ ⎛ fξ ⎞ ⎜ ⎟ ⎟ ⎟ ⎟ ⎜f ⎟ ⎟⎜ xξ ⎠ ⎟ ⎟ ⎜ η⎠ ⎟ ⎝ (10. (10. ∂u ∂v + =0 ∂x ∂ y 1 ⎛ ∂u ∂u ∂u ∂p ∂ 2u ∂ 2u ⎞ ⎟ ⎜ +u +v =− + + ⎟ ⎜ ⎟ ∂t ∂x ∂y ∂x Re ⎜ ⎝ ∂ x 2 ∂y 2 ⎠ 1 ⎛ ∂v ∂v ∂v ∂p ∂ 2v ∂ 2v ⎞ ⎜ +u +v =− + + 2⎟ ⎟ ⎜ 2 ⎟ ∂t ∂x ∂y ∂y Re ⎜ ∂y ⎠ ⎝ ∂x (10.13) ⎛ y η ∂p y ξ ∂p ⎞ ⎛ y η ∂u y ξ ∂u ⎞ ⎛ x ξ ∂u x η ∂u ⎞ ∂u 1 ⎟ ⎟ ⎟ ⎜ ⎟ = −⎜ ⎟+ ⎟+v⎜ − Δu +u⎜ − − ⎜ ⎜ ⎟ ⎟ ⎟ ⎜ ⎜ ⎜ ⎟ ⎟ ⎟ Re ∂t ⎝ J ∂ξ J ∂η ⎠ ⎝ J ∂ η J ∂ξ ⎠ ⎝ J ∂ξ J ∂η ⎠ ⎛ y η ∂v y ξ ∂ v ⎞ ⎛ x ξ ∂v x η ∂ v ⎞ ⎛ x ξ ∂p x η ∂p ⎞ ∂v 1 ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ = −⎜ Δv +u⎜ − +v⎜ − − + ⎜ ⎜ ⎜ ⎟ ⎟ ⎟ ⎜ ⎜ ⎜ ⎟ ⎟ ⎟ Re ∂t ⎝ J ∂ξ J ∂η ⎠ ⎝ J ∂η J ∂ξ ⎠ ⎝ J ∂η J ∂ξ ⎠ These transformed equations are then solved numerically in the computation domain shown in Fig.5) (10.7) ⎛ fx ⎞ ⎛ yη ⎜ ⎟ ⎟= 1⎜ ⎜ ⎜ ⎟ ⎜ ⎟ ⎜ fy ⎠ ⎝−x η ⎟ J⎜ ⎝ (10.12) (10.3) Now we consider a coordinate transformation for the following governing equations for 2-D incompressible flow. 9) Δf = fxx + fyy = (α fξξ − 2β fξη + γ fηη )/ J 2 + ⎢⎡(αx ξξ − 2βx ξη + γx ηη )(y ξ fη − y η fξ ) ⎣ + (αy ξξ − 2βy ξη + γy ηη )(x η fξ − x ξ fη )⎥⎤ / J 3 ⎦ 2 2 2 2 where α = x η + yη .11) (10.2. .10) The 2-D governing equations (10. which has regular computation domain and uniform grid spacing.29 ∂x ⎛ ∂x ⎞ ∂ξ i⎟ ⎟ ⎜ J = det ⎜ ⎟ = ∂x ⎜ ⎟ ⎜ ⎝ ∂ξi ⎠ ∂η ∂y ∂ξ = x ξy η − x ηy ξ ∂y ∂η (10. 10. β = x ξ x η + y ξy η and γ = x ξ + yξ .4) (10.6) are transformed to: yη ∂u ∂u ∂v ∂v − yξ + xξ =0 − xη ∂ξ ∂η ∂η ∂ξ (10.

η )⎤⎥ ⎪ ⎣ ⎦ ⎪ ξξ ⎨ 2 ⎡ ⎪ ⎤ ⎪αy − 2βy ξη + γy ηη = −J ⎢y ξ P (ξ. the quality of the grid is very important for the accuracy of computation. ⎧ξxx + ξyy = P (x . The interface capturing method does not define the interface as a sharp boundary. y ) ⎪ ⎪ ⎨ ⎪η + ηyy = Q (x . FREE SURFACE FLOW The difficulty in computation of free surface flows is that the free surface is a moving boundary which has to be determined in the solution. η )⎥ ⎪ ⎣ ⎦ ⎩ ξξ (10. ∂c ∂c + ui =0 ∂t ∂x i (11. Basically.14) where P and Q are functions that control the properties of the coordinates. The advantage of this method is that an accurate boundary condition can be set on the free surface. the curvilinear coordinates is assumed to satisfy the following equation.30 In the coordinate transformation method. y ) ⎪ ⎪ ⎩ xx (10. The shape of interface is computed by a function to denote the existence of a free surface in a computation cell. ⎧ ⎪ αx − 2βx ξη + γx ηη = −J 2 ⎡⎢x ξ P (ξ.15) 11. methods to determine the position of free surface can be classified into two groups. η ) + y ηQ (ξ. c=1 means a fluid cell and c=0 means a empty cell while a cell of 0<c<1 contains a free surface. A boundary fitted curvilinear grid or an unstructured grid are used and advanced when the free surface is moved. the interface tracking method and the interface capturing method. The equations can be transformed to computation plane for numerical solution. The disadvantage is that regridding process is generally costly and this method is not applicable to high nonlinear problem in which the free surface may be largely distorted or broken. η ) + x ηQ (ξ. An example is the method based on the solution of elliptic partial differential equations.1) Recently the level set method (LSM) has also become an important interface capturing . suitable boundary conditions are needed at the free surface. Further. Another commonly used method is the VOF (Volume of Fluid) method in which a function c to denote the fraction of fluid in each computation cell is introduced. In this method. The interface tracking method can treat the free surface as a sharp interface. The VOF function satisfies the following transportation equation. The most famous interface capturing method may be the MAC (Marker and Cell) method in which massless particles are introduced to calculate the motion of free surface. The computation is performed on a fixed grid and the free surface is treated as an inner interface. Many methods have been proposed for generation of a curvilinear grid.

This function follows the same transportation as (11. is considered as a VOF-like method. In general. is restricted to a few very simple cases.1 RANS Model In the conventional time averaging procedure. ∂φ ∂φ + ui =0 ∂t ∂x i (11. Other values of this function has no significance but to make it as a smooth function to represent a signed distance from the surface. f = f . a quantity f can be divided into a time averaged value plus fluctuation: f = f +f′ The averaging procedure can be express as 1 f = Δt t0 +Δt (12. f g ′ = f g ′ = 0 f g = ( f + f ′) (g + g ′) = f g + f ′g + f g ′ + f ′g ′ = f g + f ′g + f g ′ + f ′g ′ = f g + f ′g ′ We apply the above definitions to the following governing equations for incompressible . The time averaged models solve Reynolds averaged Navier-Stokes (RANS) equations. Numerical solution of all these temporal and spatial fluctuations.1). The free surface is defined as the surface of φ = 0 . and Reynolds stress model.1) ∫ t0 fdt (12. we need to use mathematical models to approximate the effect of turbulence. (11. The space filtered models are also called large eddy simulation (LES) methods. i. 12. 2-equation models ( k − ε model).2) Then we have the following relations: f ′ = 0 .31 method.2) CIP method. In this method. include 0-equation models (Prandtl mixing length model). Turbulent flows are highly unsteady.e. direct numerical simulation (DNS). Eq. 12. if used as an interface capturing. The turbulence models can be classified into two groups: time averaged model and space filtered model. include the SGS model (Smagorinsky Subgrid model) and the Dynamic SGS model. three-dimensional and contain a lot of vorticity.1) is solved by CIP scheme. 1-equation models (k model). f +g = f + g . TURBULENCE MODELING Most of practical flows are turbulent and require special treatment in numerical calculations. This method introduces a level set function φ .

we will describe a widely used model in the following.11) where ε is a turbulence dissipation rate.3) 1 ∂p ∂ + (2νSij ) ρ ∂x i ∂x j ∂ (ui u j ) ∂x j =− (12.4) j ⎟ i ⎜ where Sij = ⎜ ⎜ x + x ⎟ ⎟ . The equations for this model are: νt = C μk 2 ε (12. . and most of them use the Boussinesq assumption: 2 ui′u j′ = 2νt Sij − δij k 3 (12. There are several methods that can be used to determine the turbulent viscosity. Equation (12. There are five model constants in this model.6) is then reduced to ∂ui ∂t + ∂u i u j ∂x j =− 1 ∂p ∂ ⎡ + 2 (ν + νt ) Sij ⎤⎥ ⎦ ∂x j ⎣⎢ ρ ∂x i (12. ∂ui ∂x i ∂ui ∂t 1 ⎛ ∂u + =0 (12. 2⎜ ∂ i⎠ ⎟ ⎝∂ j ∂u ⎞ ⎟ ∂ui ∂x i ∂ui ∂t + ∂ (ui u j ) ∂x j =0 (12. this equation can be solved.6) There is an unknown term in (12.6). and the following values are often used.10) ⎛ ν ∂ε ⎞ ∂ε ∂ (u j ε) ∂ ⎜ ε ε2 ⎟ t ⎟ ⎜ + = + − 2 C S S C ν ⎟ ⎜ 1ε 2ε ⎟ ∂t ∂x j ∂x j ⎜ k t ij ij k ⎟ ⎝ σ ε ∂x j ⎠ (12. which is required to be modeled with the known averaged values. called Reynolds stress term. ui′u j′ .7) where k = ui′ui′ 2 is the kinetic energy of turbulence and νt is called turbulent viscosity or eddy viscosity.5) =− ∂ 1 ∂p + 2νSij − ui′u j′ ρ ∂x i ∂x j ( ) (12.9) ν t ∂k ⎞ ∂k ∂ (u j k ) ∂ ⎛ ⎟ ⎜ ⎟ ⎜ + = + 2νt S ij S ij − ε ⎟ ⎜ ⎟ ∂x j ⎜ ∂ x ∂t ∂x j σ ⎟ ⎝ k j ⎠ (12.32 flows. the k − ε model.8) If the turbulent viscosity is known. Many methods have been developed to approximate this term. The following Reynolds equations can be obtained.

This model assume 1 τij − δij τkk = −2νeSij 3 j ⎟ i ⎜ and the SGS eddy viscosity can be derived to give where Sij = ⎜ + ⎟ ⎜ ⎟ 2⎜ x x ∂ ∂ ⎟ ⎜ ⎝ j i ⎠ (12. By the following decomposition.09 C 1ε = 1. The earliest and most commonly used model is the Smagorinsky SGS model. and S = (2S ij Sij ) . irrotational strains (stagnation flow). curvature effects.92 σk = 1.12) by using a filtering operation that can be f ≡ ∫ ∞ −∞ G (x . The filter scale is usually assumed to be equal to grid scale. resulting in bad prediction of normal turbulent stresses. It is also very stable for many engineering applications.44 C 2 ε = 1. one obtains a set of filtered equations very similar to the RANS equations. a quantity f can be divided into a resolved GS component and an unresolved SGS component as: f = f +f′ (12.4).15). Δ is the filter length scale. The disadvantages of this model also arise from its isotropic assumption. SGS) turbulent fluctuations.0 σε = 1. The model 12 .2 Large Eddy Simulations The basic idea in LES is to resolve large grid scales (GS) flow motions and model small (subgrid-scales.18) where CS is a model constant to be determined.33 C μ = 0. and separation flow.16) which is needed to be modeled.13) Applying to (12.3 The k − ε model has the advantage of simple implementation due to the use of an isotropic eddy viscosity.17) 1 ⎛ ∂u ∂u ⎞ ⎟ νe = (C S Δ) S 2 (12.15) There is an unknown term in (12. ∂ui ∂x i ∂ui ∂t + ∂ (ui u j ) ∂x j =− =0 (12. ξ ) f (ξ )d ξ (12.14) ∂ 1 ∂p + (2νSij + τij ) ∂x j ρ ∂x i (12. the SGS Reynolds stress τij = uiu j − uiu j (12. 12.3) and (12. Large eddy simulations make use of a space filtering procedure to obtain averaged equations.

Computed drag force coefficient.2 . coefficient. It can be seen that a significant feature of this SGS model is it has only one empirical constant. c******************************************************************* c* 2-D Navier-Stokes Solver * c* * c* Flow Past a Square Cylinder * . where B μ Fig. The forces due to pressure and due to viscosity are obtained by integration of the pressure and the viscous stress over the cylinder surface. A2 and A3 show the computed force coefficients. A2. The computation example is a uniform flow past a stationary square cylinder. U0 is the velocity of ambient flow. respectively. Computed flow field for Re=200. A1. Fig. The Reynolds number is Re = is the width the cylinder.34 constant CS can be determined by theory to give C s = 0. A1 shows a computed result of flow pattern. The basic scheme is MAC method. Sample program for 2D flow around a square cylinder Here we show a sample program to solve two-dimensional incompressible flows for better understanding of the CFD knowledge described in this lecture. ρU 0 B = 200 . Appendix A. Fig. Computed lift force Fig. Fig. A3.

mp=10000.fvxh(mp).0:jm).ny=80. v(0:im.0:jm).0 tmax=100 dt=0.0:jm).uw(0:im.ny do i=1.fpx.nx abu=abs(uc(i.0:jm) & .fvx.dy. vw(0:im.fvy.fpxh(mp).j)/dx) .0:jm) & .0:jm) & . vc(0:im.jm=ny+2) implicit real*8(a-h.tint)then uin=uin0*t/tint else uin=uin0 endif c------------------------------------------------------------------call pressure c------------------------------------------------------------------call velocity c------------------------------------------------------------------call bc c------------------------------------------------------------------call force c------------------------------------------------------------------c determine time step by CFL condition c------------------------------------------------------------------alpha=0.fvyh(mp) c=================================================================== t=0.fpy.im=nx+2.uin dimension th(mp).ind(0:im.re1.gt.fpyh(mp).10000 c t=t+dt if(t.5 umax=1d-10 vmax=1d-10 do j=1.35 c******************************************************************* c------------------------------------------------------------------c coded by Changhong Hu at 10/August/2003 in RIAM c------------------------------------------------------------------parameter(nx=240.01 dt0=dt tout=0 dtout=dt*10 nf=0 uin0=1d0 tint=1d0 c------------------------------------------------------------------call initset c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> do n=1. d(0:im.0:jm) & .lt.tmax) goto 1000 c------------------------------------------------------------------if(t. u(0:im.0:jm).o-z) common /blk1/ uc(0:im.dt.0:jm) common /blk2/dx. p(0:im.

tout) then nf=nf+1 tout=tout+dtout th(nf)=t fpxh(nf)=fpx fpyh(nf)=fpy fvxh(nf)=fvx fvyh(nf)=fvy write(*.alpha/vmax) c------------------------------------------------------------------c for output c------------------------------------------------------------------if(t.111)x1-du.file='force.dat') open(11.fvy endif 100 format('n='.fvx.F8.nx x1=(i-0.y1+dv enddo enddo 111 format(4(1x.' t='.fvyh(i) enddo 110 c format(5(1x.fpy.fpxh(i).ny do i=1.I5.F9.alpha/umax.' fvy='.F9.3/' fpx='.j)/dy) umax=max(umax.f10.f10.fpx.fpyh(i).dat') c do i=1.abu) vmax=max(vmax.5)*dy du=0.4 & .j) write(11.6)) c------------------------------------------------------------------stop end c******************************************************************* subroutine initset c******************************************************************* c------------------------------------------------------------------- .5)*dx y1=(j-0.4.ge.' fpy='.y1-dv.4.100)n.36 abv=abs(vc(i.j) dv=0.t.fvxh(i).file='vector.5*vc(i.4) c------------------------------------------------------------------enddo 1000 continue c<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< open(10.F9.nf write(10.6)) close (10) do j=1.' fvx='.x1+du.F9.5*uc(i.110)th(i).abv) enddo enddo dt=min(dt0.

j)=0.0:jm).1 c** Reynolds number re=1. no-slip c =-2 : boundary cell.fpx.j)=1 enddo enddo c------------------------------------------------------------------c ind(i.j)----|--c vw(i.j)---v(i.fvy. v(0:im.j) | | | c c -uw(i.0 v(i.0 uw(i.ind(0:im.0 uc(i.j)=0.j)=0.37 parameter(nx=240.0:jm).ny=80.0:jm) common /blk2/dx. slip c =-10 : solid cell c------------------------------------------------------------------do j=36.fvx.j) uc(i.uin c------------------------------------------------------------------c computational conditions c------------------------------------------------------------------c** grid spacings dx=0. p(0:im.j)=0. vc(0:im.0:jm).re1.dt. d(0:im.0:jm) & .dy.1 dy=0.j) | c | vc(i.0:jm) . u(0:im.0 ind(i.o-z) common /blk1/ uc(0:im.ny+1 do i=0.j) | | c | c c------------------------------------------------------------------initial set c c------------------------------------------------------------------do j=0.0:jm) & & .45 .fpy.0 vw(i.j) = 1 : flow cell c =-1 : boundary cell.mp=10000.0:jm).jm=ny+2) implicit real*8(a-h.uw(0:im.j)=0. vw(0:im.0 vc(i.j) | c u(i.0:jm) & .im=nx+2.j)=0.0d2 re1=1d0/re c------------------------------------------------------------------c mesh definition c c | | c ---|-----------------|--| c | c | p(i.nx+1 u(i.

j)**2-2.j)=-10 enddo enddo do j=36.j)**2+vc(i./ddy dxy1=1. vw(0:im.j).fvy. u(0:im./ddx ddy1=1.j)**2)*ddx1 & -(vc(i.j+1)**2-2.im=nx+2.re1.j)-u(i.j))/dy 10 continue c------------------------------------------------------------------om=1. p(0:im.0)goto 20 qqq=-(uc(i+1.fpy.j) & -uw(i+1.fvx.0:jm) & .60 ind(i.0)goto 10 d(i.45)=-1 enddo c------------------------------------------------------------------return end c******************************************************************* subroutine pressure c******************************************************************* c------------------------------------------------------------------parameter(nx=240.nx if(ind(i.0:jm) & .nx if(ind(i.8 ddx=dx*dx ddy=dy*dy ddx1=1.j)*vw(i.uin c------------------------------------------------------------------dimension r(nx.j)**2+uc(i-1.dy.ny=80.lt.lt.j)=(u(i+1.ny) c------------------------------------------------------------------do 10 j=1.j)=-1 enddo do i=51.ind(0:im.j-1)**2)*ddy1 & -(uw(i+1.dt.0:jm).ny do 20 i=1.o-z) common /blk1/ uc(0:im.38 do i=51./dx/dy omega=0.mp=10000.0*dxy1 .j).j)*vw(i+1.j)-uw(i.0:jm).uw(0:im.0:jm) & .0:jm) common /blk2/dx.0:jm). v(0:im.60 ind(i.j+1)-v(i. d(0:im.0*vc(i.j+1)+uw(i.j))/dx+(v(i.ny do 10 i=1.0:jm) & .0:jm).j+1)*vw(i.j)=-1 ind(60.fpx.j+1)*vw(i+1.36)=-1 ind(i.jm=ny+2) implicit real*8(a-h. vc(0:im.0*uc(i.5*om*ddx*ddy/(ddx+ddy) c------------------------------------------------------------------do 20 j=1.45 ind(51.j+1))*2.

lt.j)=p(i-1.1) p(i.sngl(resp) c------------------------------------------------------------------return end c******************************************************************* subroutine velocity c******************************************************************* .j).j+1).j-1).j)=p(1.0) =p(i.0)goto 200 p(i.j)=p(i.n.lt. of sor='.j) enddo do i=1.*)'no.j)=p(i.gt.j) p(nx+1.lt.39 r(i.0)goto 220 p(i.j) if(ind(i.0*d(i.j)=qqq+d(i.j-1) continue 100 210 220 230 200 if(resp.ny p(0.0 do 100 j=1.nx if(ind(i.ny) enddo do 200 j=1.j)+p(i.j))*ddx1 +(d(i.ny+1)=p(i.0)goto 100 dpdxx=(p(i+1.j)-2*p(i.j)/dt +re1*((d(i+1.j).j-1))*ddy1 pres=omega*(dpdxx+dpdyy-r(i.j)) resp=max(resp.j)=p(i.j+1) if(ind(i.j)+d(i.j+1)-2.j).ny do 100 i=1.j-1))*ddy1) 20 continue c------------------------------------------------------------------do 300 n=1.j)+p(i-1.0)goto 200 if(ind(i+1.' resp='.nx p(i.lt.j) if(ind(i-1.0)goto 230 p(i.1d-6) goto 500 300 continue c------------------------------------------------------------------500 continue c write(*.j)-2.j))*ddx1 dpdyy=(p(i.ny do 200 i=1.lt.j+1)-2*p(i. abs(pres)) p(i.j)=p(i+1.100 & & resp=0.0)goto 210 p(i.nx if(ind(i.j)=p(nx.j)+d(i-1.j).0*d(i.lt.j)+pres continue do j=1.

j)+u(i+1.j-1)-v(i.5/dy*( (vw(i.0*u(i.5/dx*( (uc(i . j)+u(i. vc(0:im.j-1)+v(i.ny if(ind(i. j)-u(i+1.j)-2.j+1)) +abs(vw(i.j+1)+u(i.0:jm).0:jm).nx+1 .o-z) common /blk1/ uc(0:im.j)=0d0 enddo enddo do 10 i=1.j))/(dy**2)) & +(p(i. d(0:im.0) goto 10 vvv(i.j+1))) -(vw(i.j)) +abs(uc(i .ny+1 uuu(i.jm=ny+2) implicit real*8(a-h.j-1).j) )/dx) & & & & & & & & & & & 20 10 continue if(ind(i.j)+v(i-1.vvv(0:im.ind(0:im. j)+v(i+1.j))*(v(i.dy.j)-2.j))) -(uc(i-1.0:jm).j)-u(i.j) *(u(i.j-1) *(v(i.re1. j)) +abs(vw(i.j+1))) vc(i. j)-v(i+1.j+1) *(u(i.fvy.j-1)-2.lt.j-1)-2. j)))) -0. j))*(v(i-1. j)-u(i.j))*(u(i.lt.j) *(u(i-1.j)-v(i.j)-v(i.j)=v(i.dt. j) *(u(i.j))/dy) continue do i=0.0:jm) & .j).j)+u(i-1.0*v(i.0*v(i. j) *(v(i-1.j))/(dy**2)) +(p(i-1.j)=u(i.0:jm) common /blk2/dx. v(0:im.nx do 10 j=1.j+1)) & -0. vw(0:im.j))/(dx**2) +(u(i.fpy.j))/(dx**2) & +(v(i.0) goto 20 uuu(i. j)))) & +re1*((v(i+1. j)) +abs(uc(i-1.j-1)-p(i.j). j))*(v(i .j)) & +abs(uw(i+1.j)-p(i.0:jm) & .j)+v(i.fpx.j))*(u(i-1.im=nx+2. j)) & +abs(uw(i.5/dx*( (uw(i+1.nx+1 do j=0.j)=0d0 vvv(i.uw(0:im.mp=10000.lt.0:jm). j)) & -( & +abs(vc(i.j) *(v(i. j) *(v(i .0) goto 10 if(ind(i-1. j)))) (vc(i.5/dy*( & +abs(vc(i.fvx.j)+v(i.0:jm) & .j-1))*(v(i.j)+dt*( & -0. j)))) +re1*((u(i+1. p(0:im.uin c------------------------------------------------------------------dimension uuu(0:im.0:jm). u(0:im.j)+dt*( -0.40 c------------------------------------------------------------------parameter(nx=240.0:jm) & .0*u(i.j-1)+u(i.j))) & -(uw(i.j-1)-u(i.ny=80.0:jm) c=================================================================== do i=0. j))*(u(i.j+1))*(u(i.j+1)+v(i.j)+u(i.

ind(i.o-z) common /blk1/ uc(0:im. vc(0:im.j)=v(i-1.j)=v(i+1.lt.ny+1 u(i.0:jm).eq.j)= v(nx.lt.j).-2.0)u(i.ind(i-1.j) v(0. vw(0:im.ind(i.eq.and.0:jm) & .lt.ny do 200 i=1.dt.j) v(i.j-1) if(ind(i.j).lt.fpx.j).mp=10000.j).j).0)goto 220 if(ind(i.-1.-1.0)goto 230 if(ind(i.and.eq.ny=80.0:jm) & common /blk2/dx.fvy.fpy.j)=-v(i-1.ind(i.j-1).-1.lt.dy.uin c------------------------------------------------------------------c Boundary condition for velocity c------------------------------------------------------------------c cylinder c------------------------------------------------------------------do 200 j=1.0:jm).eq.re1.j).0)u(i.uw(0:im.and. u(0:im.j).j)=-v(i+1.0:jm) & .j) if(ind(i.j)=-u(i.j)=uin u(nx+1.j)=u(i.lt.ind(i-1.j) if(ind(i.j).-2.eq.j).and.j)=-u(i.j) = u(nx.0)v(i.0)v(i.lt.and.gt.lt.im=nx+2.ind(i-1.j) =vvv(i. p(0:im.j+1).j).eq.j-1).j-1).and.0)u(i.j-1) 200 continue c------------------------------------------------------------------c wall c------------------------------------------------------------------do j=0.j) enddo enddo c------------------------------------------------------------------return end c******************************************************************* subroutine bc c******************************************************************* parameter(nx=240.j) u(nx+2.0)u(i.0)goto 210 if(ind(i.j+1) 230 if(ind(i.lt.j).ind(i-1.lt.j).jm=ny+2) implicit real*8(a-h.0)goto 200 if(ind(i.41 do j=0.j+1) if(ind(i.j).0:jm) & .j)=uin u(1.0:jm).-2.nx if(ind(i.j) 210 if(ind(i-1.0:jm).eq.ind(0:im.ind(i. d(0:im.and. v(0:im.0)v(i.j)=u(i.j) 220 if(ind(i.j).0:jm) .j)=0d0 v(nx+1.j) =uuu(i.j).eq.and.0)goto 200 if(ind(i+1.lt.ny+1 u(0.j) = u(nx.j-1).fvx.lt.-2.0)v(i.j-1).j) enddo .-1.

0)goto 210 fpx=fpx-p(i+1.42 do i=0.j).1) u(i.ny+2)=0d0 enddo c------------------------------------------------------------------c center velocity & corner velocity c------------------------------------------------------------------do i=0.5*(v(i-1.j)*dy*2/dx if(ind(i-1.ny) v(i.j-1)+u(i.nx if(ind(i.0:jm).0:jm) & .0)goto 200 if(ind(i+1.0:jm).0:jm).0)goto 220 210 .0:jm).uw(0:im.j)) vc(i.j)=0.nx+1 do j=1.re1.j)=0.ny=80.0:jm) & . u(0:im.dt.0:jm) & .j)) vw(i.ind(0:im.ny do 200 i=1.j)+v(i.0)=0d0 v(i.j)+u(i+1.ny+1)=0d0 v(i.o-z) common /blk1/ uc(0:im.j)=0.ny+1 uw(i.0) =u(i.0:jm) common /blk2/dx. v(0:im.1)=0d0 v(i.j+1)) enddo enddo do i=1.ny+1 uc(i.j).5*(v(i.fpx. vc(0:im.gt.uin c------------------------------------------------------------------c Forces on the cylinder c------------------------------------------------------------------fpx=0d0 fpy=0d0 fvx=0d0 fvy=0d0 do 200 j=1.j)*dy fvy=fvy+re1*vc(i+1.5*(u(i.im=nx+2.mp=10000. d(0:im. p(0:im.lt.nx+1 u(i.j)+v(i.0:jm) & .fvx.fvy.dy.fpy.j)) enddo enddo c------------------------------------------------------------------return end c******************************************************************* subroutine force c******************************************************************* parameter(nx=240.nx+1 do j=0.jm=ny+2) implicit real*8(a-h.j).ny+1)=u(i.5*(u(i. vw(0:im.lt.j)=0.

lt.j+1).j+1)*dx*2/dy 230 if(ind(i.j-1)*dx*2/dy 200 continue c------------------------------------------------------------------return end .0)goto 200 fpy=fpy+p(i.j)*dy fvy=fvy+re1*vc(i-1.j)*dy*2/dx 220 if(ind(i.43 fpx=fpx+p(i-1.j+1)*dx fvx=fvx+re1*uc(i.j-1)*dx fvx=fvx+re1*uc(i.j-1).lt.0)goto 230 fpy=fpy-p(i.

- CFD Lectures
- CFD - Fluent
- Cfd Simulation ppt
- Resistance
- CFD intro
- CFD
- CFD Basic Application
- CFD Tutorials
- Ship Resistance calculation for a fishing vessel
- Marine Applications of Cfd
- Turbulence Modelling
- Amano and Sunden -- Computational Fluid Dynamics and Heat Transfer
- Resistance Calculation
- Ship Resistance and Propulsion
- CFDNotes06 (1)
- Vulcan Cfd Code Overview
- Simulation of flow in an idealised city using various CFD codes
- Fourier Analysis in Polar and Spherical.pdf
- Nondimensionalization choices for the forced, compressible Navier-Stokes equations
- Fluid Flow for the Rest of Us
- ion of a Vehicle Shape by CFD Code
- Computational Fluid Mechanics and Heat Transfer
- Validation of CFD Codes for Slamming 26 10
- cfd slayt friburg
- Steam Power Plants English
- ParaView User's Guide v3.14
- Development and Validation of a c++ Object Oriented Cfd Code for Heat Transfer Analysis
- Non Dimensionalization
- CFD
- Mandeep Singh

- LS-PrePost_Intro_2016.pdf
- Unit_05_ee722
- Types of Bolts
- NURBS Surfaces
- L-09_BSplines_NURBS.6
- RBE
- Lecture_12_6.pdf
- crankshaft_full_report_2.pdf
- Vort Rag
- Analysis Information of powertrain components
- LS PrePost4.2 WorkShop
- Self-piercing Riveting Connections Using Aluminium Rivets
- Failure Analysis of a Car Suspension System Ball Joint
- CONSTRUCTIVE SOLID GEOMETRY.pdf
- Automesher for Ls Dyna Vehicle Modeling
- Flow Visualisation Techniques Part 2
- 5 Years Syllabus Book
- Rijke Tube
- AE2255-Question bank
- Propulsion 1 Part A
- Benard 4655 RSm
- interpolation
- IIT NOTES for HTM
- Us Missile Systems
- Flow Visualization Techniques Part 1
- Resonance
- CFD INTRO TUTORIAL
- Fortran 77 Code for Spline
- Em Brittle Ment Notes
- Hybrid Aircraft

Sign up to vote on this title

UsefulNot usefulRead Free for 30 Days

Cancel anytime.

Close Dialog## Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

Loading