16
Graduate J. Math. 3 (2018), 108 – 123 Vorleak Yek Abstract The motion of a viscous fluid flow is described by the well-known Navier-Stokes equations. The Navier-Stokes equations contain the conservation laws of mass and momentum, and describe the spatial- temporal change of the fluid velocity field. This paper aims to investigate numerical solvers for the incompressible Navier-Stokes equations in two and three space dimensions. In particular, we focus on the second-order projection method introduced by Kim and Moin, which was extended from Chorin’s first-order projec- tion method. We impose periodic boundary conditions and ap- ply Fourier-Spectral methods for the periodic boundary condition. Numerically, we discretize the system using centered differences scheme on Marker and Cell (MAC) grid spatially and the Crank- Nicolson scheme temporally. We then apply the fast Fourier trans- form to solve the resulting Poisson equations as sub-steps in the projection method. We will verify numerical accuracy and perform von Neumann stability analysis. In addition, we will simulate the particles’ motion in the 2D and 3D fluid flow. MSC 2010. Primary: 65M06; Secondary: 65F05. 1 Introduction The Navier-Stokes equations, as the governing equa- tions in fluid mechanics, describe the interaction and relation among quantities such as fluid velocity, pres- sure, and density. This set of equations can be applied everywhere in science and engineering fields, such as the study of swimming strategy of bacterial cells, the prediction of weather behavior, description of ocean currents, and the design of aerodynamically efficient aircraft wing [17, 2]. In addition, slight modifications of the equations can be used in other models such as electrodynamics, population dynamics, and aggrega- tion swarming [13, 16, 8]. The incompressible Navier-Stokes equations, which describe the motion of an incompressible viscous fluid, can be written in a non-dimensional form as: u ∂t +(u ·∇)u = -∇P + ν Δu + f (1.1) ∇· u =0, (1.2) for x Ω the fluid domain, where u(x,t) represents the velocity, P (x,t) is the pressure, ν is a constant de- noting the coefficient of kinematic viscosity, and f(x,t) is the external body force acting on the fluid. These equations were first introduced by Claude-Louis Navier and George Gabriel Stokes, with a given initial veloc- ity field in Ω and certain boundary conditions on the fluid boundary Ω. Some examples of physically rel- evant boundary conditions are homogeneous or inho- mogeneous Dirichlet, Neumann, and periodic boundary conditions [14]. In equation (1.1), the terms u ∂t +(u · )u represent the material derivative, sometimes also called total derivative or convective derivative, which captures the change of a certain quantity, in our case velocity, for a fluid parcel moving with the fluid veloc- ity. In other words, these terms describe the movement of the fluid flow field. The negative pressure gradi- ent term -∇P corresponds to fluid normal stress, and constrains the flow to prevent compressing. The dis- sipative viscous term ν Δu corresponds to fluid shear stress. Thus, equation (1.1) of the Navier-Stokes equa- tions states that the temporal change of the fluid flow field is determined by combined factors such as the nor- mal stresses, shear stresses, and external forces. Despite their wide range of practical uses, theoret- ical understanding of such equations remains incom- plete. For example, the Clay Mathematics Institute has offered one million dollars prize to the significant break- through of the understanding of existence, uniqueness, and breakdown of solutions to the Navier-Stokes equa- tions. Nevertheless, there are many methods being de- veloped within the area of computational fluid dynam- ics in the last two decades to approximate the solution to the incompressible Navier-Stokes equations, under 108

Numerical investigation on the projection method for the

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Numerical investigation on the projection method for the

Graduate J. Math. 333 (2018), 108 – 123

Numerical investigation on the projectionmethod for the incompressible Navier-Stokesequations on MAC grid

Vorleak Yek

Abstract

The motion of a viscous fluid flow is described by the well-knownNavier-Stokes equations. The Navier-Stokes equations contain theconservation laws of mass and momentum, and describe the spatial-temporal change of the fluid velocity field. This paper aims toinvestigate numerical solvers for the incompressible Navier-Stokesequations in two and three space dimensions. In particular, wefocus on the second-order projection method introduced by Kimand Moin, which was extended from Chorin’s first-order projec-tion method. We impose periodic boundary conditions and ap-ply Fourier-Spectral methods for the periodic boundary condition.Numerically, we discretize the system using centered differencesscheme on Marker and Cell (MAC) grid spatially and the Crank-Nicolson scheme temporally. We then apply the fast Fourier trans-form to solve the resulting Poisson equations as sub-steps in theprojection method. We will verify numerical accuracy and performvon Neumann stability analysis. In addition, we will simulate theparticles’ motion in the 2D and 3D fluid flow.

MSC 2010. Primary: 65M06; Secondary: 65F05.

1 Introduction

The Navier-Stokes equations, as the governing equa-tions in fluid mechanics, describe the interaction andrelation among quantities such as fluid velocity, pres-sure, and density. This set of equations can be appliedeverywhere in science and engineering fields, such asthe study of swimming strategy of bacterial cells, theprediction of weather behavior, description of oceancurrents, and the design of aerodynamically efficientaircraft wing [17, 2]. In addition, slight modificationsof the equations can be used in other models such aselectrodynamics, population dynamics, and aggrega-tion swarming [13, 16, 8].

The incompressible Navier-Stokes equations, whichdescribe the motion of an incompressible viscous fluid,

can be written in a non-dimensional form as:∂u∂t

+ (u · ∇)u = −∇P + ν∆u + f (1.1)

∇ · u = 0, (1.2)for x ∈ Ω the fluid domain, where u(x, t) representsthe velocity, P (x, t) is the pressure, ν is a constant de-noting the coefficient of kinematic viscosity, and f(x, t)is the external body force acting on the fluid. Theseequations were first introduced by Claude-Louis Navierand George Gabriel Stokes, with a given initial veloc-ity field in Ω and certain boundary conditions on thefluid boundary ∂Ω. Some examples of physically rel-evant boundary conditions are homogeneous or inho-mogeneous Dirichlet, Neumann, and periodic boundaryconditions [14]. In equation (1.1), the terms ∂u

∂t + (u ·∇)u represent the material derivative, sometimes alsocalled total derivative or convective derivative, whichcaptures the change of a certain quantity, in our casevelocity, for a fluid parcel moving with the fluid veloc-ity. In other words, these terms describe the movementof the fluid flow field. The negative pressure gradi-ent term −∇P corresponds to fluid normal stress, andconstrains the flow to prevent compressing. The dis-sipative viscous term ν∆u corresponds to fluid shearstress. Thus, equation (1.1) of the Navier-Stokes equa-tions states that the temporal change of the fluid flowfield is determined by combined factors such as the nor-mal stresses, shear stresses, and external forces.

Despite their wide range of practical uses, theoret-ical understanding of such equations remains incom-plete. For example, the Clay Mathematics Institute hasoffered one million dollars prize to the significant break-through of the understanding of existence, uniqueness,and breakdown of solutions to the Navier-Stokes equa-tions. Nevertheless, there are many methods being de-veloped within the area of computational fluid dynam-ics in the last two decades to approximate the solutionto the incompressible Navier-Stokes equations, under

108

Page 2: Numerical investigation on the projection method for the

2 Derivation 109

finite difference, finite volume, or finite element dis-cretization frameworks [14]. In many fluid-solid interac-tion applications, methods such as immersed boundarymethod, immersed interface method, ghost point andvirtual node method have been developed. For the so-lution of the linear algebraic problem resulting from thediscretization of the partial differential equations; thereare techniques such as geometric and algebraic multi-grid methods, Uzawa method, etc. [15, 9]. Many ofthese techniques are based on projection method.

This paper will focus on solving 2D and 3D incom-pressible Navier-Stokes equations using a second-orderprojection method introduced by Kim and Moin [12],which was an extension to Chorin’s first-order projec-tion method [5, 6]. We consider the case for periodicboundary condition for the purposes of simple simu-lation and use Fourier-spectral method. We will dis-cretize the system using centered differences schemeon Marker and Cell (MAC) [1] grid spatially and theCrank-Nicolson scheme temporally. We then apply thefast Fourier transform to solve the Poisson equationsthat result from the projection method.

Here is the organization of this paper. In chapter 2,we will discuss the derivation of the Navier-Stokes equa-tions using mass and momentum conservation laws. Inchapter 3, we will talk about the first-order projectionmethod introduced by Chorin and the second-order pro-jection method introduced by Kim and Moin. In chap-ter 4, we will study the spatial discretization schemeusing centered differences on 2D and 3D MAC grids.In two dimensions, we consider the solution u = (u, v)for which u is the velocity in the x-direction and v isthe velocity in the y-direction. In three dimensions, weconsider the solution u = (u, v, w) for which u is thevelocity in the x-direction, v is the velocity in the y-direction, and w is the velocity in the z-direction. Then,in chapter 5, we will discuss how to numerically solvethe Navier-Stokes equations using the second-order pro-jection method that Kim and Moin proposed with fastFourier transform. In chapter 6, we will numericallyverify that the method gives second-order accuracy inboth the velocity field and the pressure. Then, in chap-ter 7, we will show the stability analysis of a simplifiedversion of Navier-Stokes equations without the nonlin-ear advection term using von Neumann stability anal-ysis technique. In chapter 8, we will simulate the par-ticles’ motion with the fluid flow by interpolation. Wewill use MATLAB to implement the numerical methodand solve for the approximation solution to the Navier-Stokes equations. Finally, in chapter 9, we will discussthe result and the conclusion.

2 Derivation

The Navier-Stokes equations are derived from physi-cal laws such as conservation of mass and momentum.Equation (1.1) is called the Cauchy momentum equa-

tion, and it arises from Newton’s second law. Equation(1.2) is the continuity equation in the case of incom-pressible fluid, and is derived from the conservation lawof mass.

2.1 The Continuity Equation

Consider a computational region Ω filled with the in-compressible viscous fluid. Let R be an arbitrarilysmall volume of fluid enclosed by the surface ∂R. Letdω and da denote the volume element of R and surfaceelement on ∂R, respectively. Since da is small and thefluid is continuous, we can approximate the velocity uand the density ρ of the fluid in R as constant. Let nbe the unit outer normal to ∂R. Then, over a smalltime interval dt, the volume dl of the fluid that flowsthrough da is:

dl = u · ndadt.

We denote the mass increase inR due to the flux throughda within a small time interval dt as dm, then we knowthat

dm = −ρdl = −ρu · ndadt.

Hence the mass inflow through ∂R is:

(inflow of mass through ∂R) = −∫∫∂R

ρu · ndadt.

Now we denote the total mass within R to be M , andwe assume that the mass is conserved. Then, the to-tal increase of mass would be equal to the total inflowthrough ∂R. This yields the equation:

dMdt = −

∫∫∂R

ρu · nda.

By the divergence theorem,dMdt

= −∫∫∂R

ρu · nda = −∫∫∫R

(∇ · (ρu))dω. (2.1)

On the other hand, we know that

M =∫∫∫R

ρdω.

By passing the time derivative into the integral andarranging the terms, we obtain:∫∫∫

R

[∂ρ

∂t+∇ · (ρu)

]dω = 0

The fact that R is arbitrary and the integrand is acontinuous function gives us the continuity equation

∂ρ

∂t+∇ · (ρu) = 0.

Page 3: Numerical investigation on the projection method for the

2 Derivation 110

By the assumption that the fluid is incompressible (i.e.,the density is constant), the temporal and spatial vari-ation of ρ vanish. Thus, we obtain the divergence freecondition of the Navier-Stokes equations (1.2):

∇ · u = 0.

2.2 The Cauchy Momentum Equation

Next, we derive the Cauchy momentum equation usingthe conservation law of momentum. Consider a domainΩ of incompressible viscous fluid, and let R be an ar-bitrarily small volume in Ω. Then, the total force Facted on R is composed of body force f exerted insideR and surface force, such as traction force, exerted on∂R. To compute the surface force, we define a secondorder tensor (or, n×n matrix) field σ called stress ten-sor at every spatial location x ∈ Ω. This tensor relatesthe surface force density ψ experienced at a materialsurface with its unit normal n via the relation ψ = σ·n.The Cauchy stress tensor is commonly accepted as anapproximation to the stress tensor for linear responsesof small material deformation. As we will see in thissection, surface forces can be described as the spatialderivatives of the Cauchy stress tensor, which is com-posed of the normal stresses and the shear stresses.

For simplicity of calculation, we fix the domain Ω ⊆IR3 as a rectangular region. Moreover, we assume R =[x0− dx

2 , x0+ dx2

]×[y0− dy

2 , y0+ dy2

]×[z0− dz

2 , z0+ dz2

]to

be a small rectangular volume element of Ω. Then, dx,dy, and dz denote the size length of R in the x, y, and zdirections, respectively. Let dv be the volume ofR, i.e.,dv = dxdydz. Note that ∂R is composed of six faces:front face

(x = x0 + dx

2

), back face

(x = x0 − dx

2

), left

face(y = y0 − dy

2

), right face

(y = y0 + dy

2

), bottom

face(z = z0 − dz

2

), and top face

(z = z0 + dz

2

). The

surface forces acting on the front and back faces of ∂Rare given by:

ψfrontdydz =

[σxx σxy σxzσyx σyy σyzσzx σzy σzz

]∣∣∣∣(x0+ dx

2 ,y,z)·

[100

]dydz (2.2)

=

σxx(x0 + dx2 , y, z)

σyx(x0 + dx2 , y, z)

σzx(x0 + dx2 , y, z)

dydz,ψbackdydz =

[σxx σxy σxzσyx σyy σyzσzx σzy σzz

]∣∣∣∣(x0− dx

2 ,y,z)·

[−100

]dydz (2.3)

= −

σxx(x0 − dx2 , y, z)

σyx(x0 − dx2 , y, z)

σzx(x0 − dx2 , y, z)

dydz.Combined together, the traction force exerted on the

front and back faces of ∂R is given byσxx(x0 + dx2 , y, z)

σyx(x0 + dx2 , y, z)

σzx(x0 + dx2 , y, z)

dydz −σxx(x0 − dx

2 , y, z)σyx(x0 − dx

2 , y, z)σzx(x0 − dx

2 , y, z)

dydz dx

dx

(2.4)

= ∂

∂x

[σxxσyxσzx

]dv.

Similarly, the traction force exerted on the right andleft faces of ∂R is:σxy(x, y0 + dy

2 , z)σyy(x, y0 + dy

2 , z)σzy(x, y0 + dy

2 , z)

dxdz −σxy(x, y0 − dy

2 , z)σyy(x, y0 − dy

2 , z)σzy(x, y0 − dy

2 , z)

dxdz dy

dy

(2.5)

= ∂

∂y

[σxyσyyσzy

]dv.

Moreover, the traction force exerted on the top andbottom faces of ∂R is:σxz(x, y, z0 + dz

2 )σyz(x, y, z0 + dz

2 )σzz(x, y, z0 + dz

2 )

dxdy −σxz(x, y, z0 − dz

2 )σyz(x, y, z0 − dz

2 )σzz(x, y, z0 − dz

2 )

dxdy dz

dz

(2.6)

= ∂

∂z

[σxzσyzσzz

]dv.

Hence, the total force acting on R is:

F =

[FxFyFz

](2.7)

=

[fxfyfz

]dv + ∂

∂x

[σxxσyxσzx

]dv + ∂

∂y

[σxyσyyσzy

]dv + ∂

∂z

[σxzσyzσzz

]dv.

For a general dimension n, each component Fi of F canbe written as:

Fi = fidv +n∑j=1

∂σij∂xj

dv. (2.8)

By Newton’s second law, we have:

Fi = mai = mdui(x(t), t)

dt = ρdui(x(t), t)

dt dv.

Applying the chain rule, we get

Fi = ρ

n∑j=1

∂ui∂xj

dxjdt

+ ∂ui∂t

dv

= ρ

n∑j=1

∂ui∂xj

uj + ∂ui∂t

dv. (2.9)

Page 4: Numerical investigation on the projection method for the

3 Projection Method 111

By equation (2.8) and equation (2.9) we arrive at

fi +n∑j=1

∂σij∂xj

= ρ

n∑j=1

∂ui∂xj

uj + ∂ui∂t

. (2.10)

The stress tensor can be decomposed into the normalstresses (- P I) and the deviatoric stresses (τ) throughthe componentwise relation σij = τij − Pδij . The pres-sure P is the average of all the unit normal stresses,which can be defined by P = − 1

n

∑ni=1 σii. The devia-

toric stresses τij is the deviation of the normal stressesfrom the stress tensor. By the Cauchy’s infinitesimalstrain tensor and the assumption that the fluid is New-tonian, we define the deviatoric stress as

τij = ν

(∂ui∂xj

+ ∂uj∂xi

). (2.11)

Now, substituting σij and ρ = 1 into equation (2.10),we have:

∂ui∂t

+n∑j=1

∂ui∂xj

uj

= fi +n∑j=1

∂xj(τij − Pδij)

= fi +n∑j=1

∂τij∂xj−

n∑j=1

∂(Pδij)∂xj

= fi −∂P

∂xi+

n∑j=1

∂τij∂xj

= fi −∂P

∂xi+ ν

n∑j=1

∂xj

(∂ui∂xj

+ ∂uj∂xi

)

= fi −∂P

∂xi+ ν

n∑j=1

∂2ui∂x2

j

+ νn∑j=1

(∂

∂xj

∂uj∂xi

).

Rearrange the orders of derivatives and summation onthe last term of the last line, and by the incompress-ibility condition, we have:

∂ui∂t

+n∑j=1

∂ui∂xj

uj = fi −∂P

∂xi+ ν

n∑j=1

∂2ui∂x2

j

.

In vector form, the Cauchy momentum equation of theNavier-Stokes equations can be written as:

∂u∂t

+ u · ∇u = f−∇P + ν∆u.

3 Projection Method

The fractional-step projection method first introducedby Chorin is the most frequently used method for solv-ing the primitive variable incompressible Navier-Stokes

equations [3, 14]. It was the first numerical scheme en-abling a cost-effective solution of time-dependent prob-lems in three-dimensional space [14]. The primitivevariable method is based on formulating the Navier-Stokes equations in terms of velocity and pressure. Thus,the projection method aims to solve the incompressibleNavier-stokes equations by dealing with the velocityand the pressure terms as a two-stage fractional stepscheme. The first-half of the algorithm involves solvingfor the intermediate velocity while the second-half of al-gorithm is solving for the pressure [11]. The motivationbehind the projection method is the Helmholtz-Hodgedecomposition theorem, as stated below. This theoremand its proof can be found in many places such as [11].Theorem 3.1. Helmholtz-Hodge DecompositionLet Ω be a smooth, simply connected bounded domainwith a smooth boundary ∂Ω. Then, any smooth vectorfield µ∗ defined in Ω can be decomposed into a uniqueorthogonal decomposition

µ∗ = µ+∇ξ,

where µ is a divergence-free vector field, and ξ is ascalar potential function.

Fig. 1: A schematic view of Helmholtz-Hodge decomposition,the projection of a vector into a divergence-free mani-fold.

The projection method was first introduced by Alexan-dre Chorin [5, 6] as a first-order accurate numericalmethod for solving the Navier-Stokes equations. It soonbecame popular and widely applied in computationalfluid dynamics, and was improved and generalized forhigher order accuracy and various boundary conditions.Now, there are many versions of projection method.The one we use in this paper is the second-order accu-rate version developed by Kim and Moin [12].

The projection method breaks down the update ineach numerical time-step to several sub-steps. The ideabehind it is that one can first solve the momentumequation (1.1) for an intermediate velocity or a half-time step solution un+ 1

2 , not requiring divergence-freevelocity. Then, apply the Helmholtz-Hodge decomposi-tion theorem, so that the intermediate velocity u∗ canbe projected onto a solenoidal field to yield a discretelydivergence-free velocity and a gradient field. Thereby,we may enforce the divergence-free constraint and up-date the pressure from solving a Poisson equation [3,

Page 5: Numerical investigation on the projection method for the

3 Projection Method 112

11]. In the whole process, the main computation stepshinge on developing a fast Poisson solver. Moreover,there are multiple ways to deal with the nonlinear con-vection term. Chorin used explicit forward temporaldiscretization. Here, we follow Kim and Moin to useCrank-Nicolson with the second-order Adams-Bashforthextrapolation for the nonlinear term.

3.1 Chorin’s First Order Method

Based on Chorin’s projection method, the numericalsolution to the incompressible Navier-Stokes equationscan be computed by the following steps:

Step 1 : Compute an intermediate velocity u∗ byomitting the pressure gradient

u∗ − un

dt = −(un · ∇)un + ν∆un + fn.

Step 2 : Solve for the pressure term P n+1

∆P n+1 = ∇ · u∗

dt .

Step 3 : Compute the divergence-free velocity un+1

un+1 = u∗ − dt∇P n+1.

Chorin’s projection algorithm only gives first-orderaccuracy in the velocity field and the pressure [3, 5, 11].Kim and Moin extended it to a second-order projectionalgorithm by applying the Crank-Nicolson scheme tothe momentum equation, which obtains the following:

un+1 − undt + [(u · ∇)u]n+ 1

2

= −∇Pn+ 12 + ν

2 (∆un+1 + ∆un) + fn+ 12 . (3.1)

Now, the nonlinear term (u · ∇)u at a half-time stepis computed explicitly using the second-order Adams-Bashforth extrapolation [3, 5, 11]. The next step is tosolve for an intermediate velocity u∗ in equation (3.1)by omitting the pressure gradient. By applying theHelmholtz-Hodge decomposition theorem, which statesthat any smooth velocity field u∗ can be decomposedinto a unique orthogonal decomposition of gradient-and divergence-free fields, the intermediate velocity u∗can be expressed as:

u∗ = un+1 + dt∇ϕ,

where ϕ is a scalar potential function. Note that dtis not required, but it helps clarifying the discussion ofthe pressure. Taking the divergence on both sides of theequation, we obtain dt∆ϕ = ∇ · u∗ since ∇ · un+1 = 0by the incompressibility condition. After solving for ϕ,we can compute the divergence-free velocity un+1 usingthe intermediate u∗ and the gradient of ϕ.

3.2 Kim and Moin Second-Order Implicit

Based on Kim and Moin, we can solve the incompress-ible Navier-Stokes equations using the projection methodby breaking it into the following three steps:

Step 1 : Solve for the intermediate velocity u∗ (withpressure gradient omitted)

u∗ − un

dt + gn+ 12 = ν

2 (∆un + ∆u∗) + fn+ 12 , (3.2)

where gn+ 12 represents some approximation to the non-

linear term, u · ∇u, at the half time level. We assumethe case of periodic boundary condition.

Step 2 : Perform the projection and solve for thescalar potential function ϕn+1

dt∆ϕn+1 = ∇ · u∗. (3.3)

Note that this is equivalent to solving the divergence ofthe equation below

un+1 − u∗

dt = −∇ϕn+1.

Step 3 : Compute the divergence-free velocity un+1

un+1 = u∗ − dt∇ϕn+1.

This projection algorithm will give a second-orderaccuracy in both the velocity field and the pressure [3,11, 12]. In addition, we can find the relation betweenthe pressure P and ϕ by substituting

u∗ = un+1 + dt∇ϕn+1

into equation (3.2). Hence, we have the following:

un+1 + dt∇ϕn+1 − undt + gn+ 1

2

2(∆un + ∆

(un+1 + dt∇ϕn+1))+ fn+ 1

2

un+1 − undt

+ gn+ 12

= −∇ϕn+1 + ν

2(∆un + ∆

(un+1 + dt∇ϕn+1))+ fn+ 1

2

un+1 − undt

+ gn+ 12

= −∇(ϕn+1 − ν

2 dt∆ϕn+1)

+ ν

2(∆un + ∆un+1)+ fn+ 1

2

Therefore, ϕ is related to pressure by P n+ 12 = ϕn+1 −

dtν2 ∆ϕn+1. This pressure relation is due to the Crank-Nicolson scheme applied to the momentum equation.

Page 6: Numerical investigation on the projection method for the

4 Spatial Discretization on Marker and Cell Grid 113

4 Spatial Discretization on Marker and CellGrid

Regular grids store all the unknown variables at thesame locations, which leads to an instability called theodd-even decoupling or spurious oscillations in the pres-sure field when solving the incompressible Navier-Stokesequations [1]. This instability is due to the relationshipbetween the pressure and velocity. Notice that in thetime-discretized equations, the pressure depends on thefirst derivatives of the velocity, and the velocity dependson the first derivatives of the pressure. Consequently,using centered differences for spatial discretization andlabeling the nodes odd or even, we see that the pressureat even nodes depends on the velocity at odd nodes.The pressure at odd nodes depends on the velocity ateven nodes. Similarly, this applies the same way for thevelocity. This instability can be avoided by discretizingspatial variables on a Marker and Cell (MAC) grid.

4.1 MAC Grid in 2D

Staggered-grid scheme or MAC grid automatically cou-ples the grid scale pressure, which avoids odd-even de-coupling solutions and prevents the pressure oscillations[1]. The MAC grid also allows us to obtain the ex-act divergence-free solution, and it can be viewed thisway. Instead of using the grid points at the cornersof each cell like in a standard grid, we define u on thevertical edge midpoints along the x-direction, v on thehorizontal edge midpoints along the y-direction, and Pon the center of each cell as shown in Fig. 2. In 2D,we assume the computational domain to be rectangularΩ = [0, L1]× [0, L2], and there are n1, n2 discretizationpoints in each of the x and y spatial direction wheredx = L1

n1and dy = L2

n2. Furthermore, we denote

xi,j =((i+ 1

2

)L1n1,(j + 1

2

)L2n2

),

and we define ui,j , vi,j , and ϕi,j as the following:

ui,j = u(xi− 1

2 ,j

), vi,j = v

(xi,j− 1

2

), and ϕi,j = ϕ (xi,j).

Similarly, u∗i,j is defined at the same grid points as ui,j ,and v∗i,j is defined at the same grid points as vi,j .

Fig. 2: A schematic view of the MAC grid in 2D, with locationsand indices of the variables u, v, and P .

4.2 MAC Grid in 3D

In three-dimension, the u velocity grid points are lo-cated at the center of the back and front faces of thecube along the x-direction, v velocity grid points arelocated at the center of the left and right faces of thecube along the y-direction, and w velocity grid pointsare located at the center of the bottom and top facesof the cube along the z-direction as shown in Fig. 3.The pressure is located at the center of each cube. In3D, we assume the computational domain to be rect-angular Ω = [0, L1]× [0, L2]× [0, L3], and there are n1,n2, n3 discretization points in each of the x, y, and zspatial direction where dx = L1

n1, dy = L2

n2, and dz = L3

n3.

Furthermore, we denote spatial directions

xi,j,k =((i+ 1

2

)L1n1,(j + 1

2

)L2n2,(k + 1

2

)L3n3

),

and we define ui,j,k, vi,j,k, wi,j,k, and ϕi,j,k as below:

ui,j,k = u(xi− 1

2 ,j,k

), vi,j,k = v

(xi,j− 1

2 ,k

),

wi,j,k = w(xi,j,k− 1

2

), and ϕi,j,k = ϕ (xi,j,k).

Similarly, u∗i,j , v∗i,j and w∗i,j are defined at the same gridpoints as ui,j , vi,j and wi,j , respectively.

Fig. 3: A schematic view of the MAC grid in 3D, with locationsand indices of the variables u, v, w, and P .

Page 7: Numerical investigation on the projection method for the

4 Spatial Discretization on Marker and Cell Grid 114

4.3 Discrete Gradient

We will use centered differences to compute the firstderivatives of the velocity components u and v in thesecond-order Adams-Bashforth extrapolation and ϕ inthe third step of the projection algorithm. In 2D, thefirst derivatives of u with respect to x and y are ap-proximated by:

(ux)i,j = ui+1,j − ui−1,j

2dx ,

(uy)i,j = ui,j+1 − ui,j−1

2dy .

The first derivatives of v with respect to x and y arecomputed similar to the first derivatives of u with re-spect to x and y. In 3D, the first derivatives of u withrespect to x, y, and z are approximated by:

(ux)i,j,k = ui+1,j,k − ui−1,j,k

2dx ,

(uy)i,j,k = ui,j+1,k − ui,j−1,k

2dy ,

(uz)i,j,k = ui,j,k+1 − ui,j,k−1

2dz .

The first derivatives of v and w with respect to x, y,and z can be computed similar to the derivatives of uwith respect to x, y, and z.

Now, let ϕi,j be the scalar quantities located at thecenter of a cell. Then, in 2D, the first derivatives of ϕwith respect to x and y approximated at ui,j and vi,jare given by:

(ϕx)i− 12 ,j

= ϕi,j − ϕi−1,j

dx ,

(ϕy)i,j− 12

= ϕi,j − ϕi,j−1

dy .

In 3D, the approximation to the first derivatives of ϕwith respect to x, y, and z are given by:

(ϕx)i− 12 ,j,k

= ϕi,j,k − ϕi−1,j,k

dx ,

(ϕy)i,j− 12 ,k

= ϕi,j,k − ϕi,j−1,k

dy ,

(ϕz)i,j,k− 12

= ϕi,j,k − ϕi,j,k−1

dz .

Note that ϕx is approximated at xi− 12 ,j,k

, which is thesame grid point as where ui,j,k is being approximated.Similarly, ϕy is approximated at xi,j− 1

2 ,k, which is the

same grid point as where vi,j,k is being approximated.Lastly, ϕz is approximated at xi,j,k− 1

2, which is the same

grid point as where wi,j,k is being approximated.

4.4 Discrete Divergence

We will also use centered differences to compute thedivergence of u∗ in the second step of the projection

algorithm. The approximation of the gradient of u∗ isgiven by:

(u∗x)i+ 12 ,j

=u∗i+1,j − u∗i,j

dx ,

(v∗y)i,j+ 12

=v∗i,j+1 − v∗i,j

dy .

Note that u∗x is approximated at xi+ 12 ,j

and v∗y is ap-proximated at xi,j+ 1

2, which are the same grid points

as where ϕi,j is being approximated. Thus, in 2D, thediscrete divergence of u∗ approximates at the center ofa cell is:

(∇ · u∗)i,j = (u∗x)i+ 12 ,j

+ (v∗y)i,j+ 12

=u∗i+1,j − u∗i,j

dx +v∗i,j+1 − v∗i,j

dy .

Similarly, the discrete divergence of the velocity u∗ in3D is given by:(∇ · u∗)i,j,k = (u∗x)i+ 1

2 ,j,k+ (v∗y)i,j+ 1

2 ,k+ (w∗z)i,j,k+ 1

2

=u∗i+1,j,k − u∗i,j,k

dx +v∗i,j+1,k − v∗i,j,k

dy +w∗i,j,k+1 − w∗i,j,k

dz .

4.5 Discrete Laplacian

The Laplacian of ϕ in this pressure equation P n+ 12 =

ϕn+1 − dtν2 ∆ϕn+1 is computed by using the 5-stencil

centered differences. The second derivatives of ϕ withrespect to x and y are given by:

(ϕxx)i,j = ϕi+1,j − 2ϕi,j + ϕi−1,j

dx2 ,

(ϕyy)i,j = ϕi,j+1 − 2ϕi,j + ϕi,j−1

dy2 .

Thus, the discrete Laplacian of ϕ in 2D is given by:(∆ϕ)i,j

= (ϕxx)i,j + (ϕyy)i,j

= ϕi+1,j − 2ϕi,j + ϕi−1,j

dx2 + ϕi,j+1 − 2ϕi,j + ϕi,j−1

dy2 .

Note that in the case of dx = dy, we have:(∆ϕ)i,j = (ϕxx)i,j + (ϕyy)i,j

= ϕi+1,j + ϕi,j+1 − 4ϕi,j + ϕi−1,j + ϕi,j−1

dx2 .

In 3D, the Laplacian of ϕ is computed using the 7-stencil centered differences, which is given by:

(∆ϕ)i,j,k = (ϕxx)i,j,k + (ϕyy)i,j,k + (ϕzz)i,j,k

= ϕi+1,j,k − 2ϕi,j,k + ϕi−1,j,k

dx2

+ ϕi,j+1,k − 2ϕi,j,k + ϕi,j−1,k

dy2

+ ϕi,j,k+1 − 2ϕi,j,k + ϕi,j,k−1

dz2 .

Page 8: Numerical investigation on the projection method for the

5 Numerical Method 115

5 Numerical Method

There are many ways to discretize the Poisson equa-tion. For examples, one can use finite difference, finiteelement, or (pseudo-) spectral methods [10]. Here, weconsider the (pseudo-) spectral method where the so-lution φ and the source term f are evaluated on MACgrid points. We will use fast Fourier transform to solveequation (3.2) in step 1 and equation (3.3) in step 2 ofthe projection method introduced by Kim and Moin.From this chapter on, we will change the superscripttime-step n to ι in order to avoid the confusion withthe Fourier mode n. In addition, we will change xi,j toxj,k =

((j + 1

2

)L1n1,(k + 1

2

)L2n2

)in order to avoid the

confusion with the complex number i.

5.1 Fourier Transform

The Poisson equation is an elliptic partial differentialequation, which can be written in the form:

∆φ = f,

where the solution φ and f are smooth real functionson Ω. Consider the 2D Poisson equation above withperiodic boundary conditions and smooth functions φand f . Then, on domain [0, L1] × [0, L2], the functionf can be written as:

f(x, y) =∞∑

m=−∞

∞∑n=−∞

fm,nei2πmxL1 e

i2πnyL2 . (5.1)

Similarly, the function φ can be expressed as:

φ(x, y) =∞∑

m=−∞

∞∑n=−∞

φm,nei2πmxL1 e

i2πnyL2 .

Here fm,n and φm,n are the Fourier coefficients corre-sponding to the (m,n)-th mode, and they can be cal-culated by:

fm,n = 1L1L2

∫ L1

0

∫ L2

0f(x, y)e−

i2πmxL1 e

− i2πnyL2 dxdy,

φm,n = 1L1L2

∫ L1

0

∫ L2

0φ(x, y)e−

i2πmxL1 e

− i2πnyL2 dxdy.

Now, taking second derivatives of φ with respect to xand y, we get:

φxx(x, y) =∞∑

m=−∞

∞∑n=−∞

−4π2m2

L21

φm,nei2πmxL1 e

i2πnyL2 ,

φyy(x, y) =∞∑

m=−∞

∞∑n=−∞

−4π2n2

L22

φm,nei2πmxL1 e

i2πnyL2 .

Thus, Laplacian of φ is given by:

∆φ(x, y) (5.2)= φxx(x, y) + φyy(x, y)

=∞∑

m=−∞

∞∑n=−∞

−4π2(m2

L21

+ n2

L22

)φm,ne

i2πmxL1 e

i2πnyL2 .

Since ∆φ = f , by equation (5.1) and equation (5.2) weobtain:

∞∑m=−∞

∞∑n=−∞

−4π2(m2

L21

+ n2

L22

)φm,ne

i2πmxL1 e

i2πnyL2

=∞∑

m=−∞

∞∑n=−∞

fm,nei2πmxL1 e

i2πnyL2 .

So, for each (m,n)-th mode, we have the following:

∆φm,n = fm,n

−4π2(m2

L21

+ n2

L22

)φm,n = fm,n (5.3)

φm,n = − 14π2

(m2

L21

+ n2

L22

) fm,n. (5.4)

5.2 Fast Fourier Transform

At each grid point, the point value fj,k = f(xj,k) canbe transformed using the discrete Fourier transform:

fj,k =n1∑m=1

n2∑n=1

fm,nei2πmjn1 e

i2πnkn2 (5.5)

fm,n = 1n1n2

n1∑j=1

n2∑k=1

fj,ke− i2πmj

n1 e− i2πnk

n2 . (5.6)

Equation (5.6) is called the discrete Fourier transform(DFT). It is used for calculating the Fourier coefficientfm,n in equation (5.5), which is known as the inversediscrete Fourier transform (IDFT). The efficiency ofthe pseudo-spectral algorithm for solving the Poissonequation comes from the use of fast Fourier transform(FFT) method to compute DFT [4, 10]. Fast Fouriertransform involves the Cooley-Tukey algorithm, whichis an efficient way of calculating the constants in theinterpolating trigonometric polynomial [4]. It takes or-der of O(n2) floating point operations to compute DFTdirectly, but only takes order O(n log n) operations tocompute DFT using FFT given that the number ofdata points being used can be factored into powers oftwo. Thus, the computational complexity of comput-ing the DFT using the FFT will reduce from O(n2)to O(n log n) [4]. More details about FFT and its algo-rithm can be found in the Numerical Analysis textbookwritten by Burden and Faires (2011).

Page 9: Numerical investigation on the projection method for the

6 Order of Accuracy 116

5.3 Solving the Momentum Equation in Step 1

Solving the projection method introduced by Kim andMoin, we first approximate the nonlinear term u·∇u ata half-time step using the second-order explicit Adams-Bashforth extrapolation. Then, we will use the fastFourier transform to solve for u∗. Here is the algorithm.Applying the Crank-Nicolson scheme to the momentumequation, omitting the pressure term, we obtain:

u∗ − uι

dt + gι+12 = ν

2 (∆uι + ∆u∗) + fι+12 , (5.7)

where gι+ 12 is the approximation of the nonlinear term

computed by the Adams-Bashforth extrapolation. Thesecond-order explicit Adams-Bashforth extrapolation iscomputed by the following scheme:

gι+12 = 3

2 (uι · ∇uι)− 12(uι−1 · ∇uι−1) +O(dt2).

We will use centered differences to compute gι+ 12 . Then,

we will solve for the unknown u∗ by applying FFTmethod. So, rearranging equation (5.7) for the un-known u∗, we have:

(I − νdt2 ∆)u∗ = uι + νdt

2 (∆uι) + dtfι+12 − dtgι+

12

= (I + νdt2 ∆)uι + dtfι+

12 − dtgι+

12 .

(5.8)

Applying the Fourier transform and use the result inequation (5.3), we see that for each (m,n)-th mode,the equation (5.8) can be written as:(

1 + νdt2

(4π2

(m2

L21

+ n2

L22

)))u∗m,n =(

1− νdt2

(4π2

(m2

L21

+ n2

L22

)))uιm,n + dtfι+

12

m,n − dtgι+12

m,n .

Let km,n =(1− νdt

2

(4π2

(m2

L21

+ n2

L22

)))uιm,n+dtfι+

12

m,n−

dtgι+12

m,n . Then, in 2-Dimensional space, each (m,n)-thFourier mode is given by:

u∗m,n = 11 + νdt

2

(4π2

(m2

L21

+ n2

L22

)) km,n.

Similarly, in 3-Dimensional space, each (m,n, l)-thFourier mode is given by:

u∗m,n,l = 11 + νdt

2

(4π2

(m2

L21

+ n2

L22

+ l2

L23

)) km,n,l,

wherekm,n,l =

(1− νdt

2

(4π2

(m2

L21

+ n2

L22

+ l2

L23

)))uιm,n,l

+ dtfι+12

m,n,l − dtgι+12

m,n,l.

We will use the FFT to compute the Fourier coefficientu∗m,n in 2D and u∗m,n,l in 3D. Finally, to obtain thesolution u∗, we will take the inverse fast Fourier trans-form (IFFT).

5.4 Solving Poisson Equation in Step 2

Once u∗ is known, we need to project it onto a solenoidalfield by applying the Helmholtz-Hodge decompositiontheorem. This left us with the Poisson equation tosolve:

dt∆ϕι+1 = ∇ · u∗. (5.9)

To solve equation (5.9), we first need to approximatethe divergence of u∗ using centered differences scheme.Then, we can apply the Fourier transform to the Pois-son equation ∆ϕ = f , where f = 1

dt∇ · u∗. Usingthe result from equation (5.4), we obtain the followingFourier coefficient ϕm,n at (m,n)-th mode:

ϕm,n = − 14π2

(m2

L21

+ n2

L22

) fm,n.Similarly, in a three dimensional space, we obtain thefollowing Fourier coefficient ϕm,n,l at each (m,n, l)-thmode:

ϕm,n,l = − 14π2

(m2

L21

+ n2

L22

+ l2

L23

) fm,n,l.Similar to step 1, we will use the FFT to compute theFourier coefficient ϕι+1 at each (m,n)-th and (m,n, l)-th modes. Then, we will take the IFFT to obtain thesolution ϕι+1.

5.5 Computing the Divergence-Free Velocity inStep 3

Once we obtain ϕι+1 in step 2, we can compute thedivergence-free velocity at time ι + 1 by the followingequation:

uι+1 = u∗ − dt∇ϕι+1.

We approximate the gradient of ϕι+1 using centered dif-ferences scheme. Note that the above equation resultsfrom the Helmholtz-Hodge decomposition theorem, andit ensures that uι+1 will be divergence-free.

6 Order of Accuracy

The authors in [3] used normal mode analysis to showthat the projection method introduced by Kim andMoin is second-order accurate in both the velocity andthe pressure. For this reason, we expect that the Crank-Nicolson projection method developed by Kim and Moin

Page 10: Numerical investigation on the projection method for the

6 Order of Accuracy 117

using second-order explicit Adams-Bashforth for thenonlinear term approximation, and centered differencesfor spatial discretization will give us a second-order ac-curate approximation in both the velocity and the pres-sure. We will verify that the method is second-order ac-curate by the method of manufactured solutions, whichconsists in imposing an exact solution u(x, t) for veloc-ity and P (x, t) for pressure. Then, we substitute itsgradient, Laplacian, and divergence into the momen-tum equation to solve for the natural force flow termf(x, t). Once the force, pressure, initial velocity, andthe viscosity are determined, we can numerically solvethe equation for an approximate solution at a final time-step T . We can verify that the method is second-orderaccurate by refining the number of grid points from Nto 2N and reducing the time-step by a half (from dtto dt

2 ) each time we compute the approximate solution.Then, the order of accuracy of the method is given bythe rate of convergence of the numerical solution to theexact solution.

Consider the case of a 1D problem. Let N be thenumber of grid points, h be the step-size, and denoteE to be the error of maximum norm of the differencesbetween the exact solution and the numerical solution.Then, the rate of convergence is defined as:

E(h) = C · hα,

E

(h

2

)= C ·

(h

2

)α,

where C is a constant. Now, dividing the errors above,we get:

E(h)E(h2 )

= C · hα

C ·(h2

)α = 2α.

Taking log on both sides of the equation above, we ob-tain:

log(E(h)E(h2 )

)= α log(2).

Therefore, the rate of convergence is as fast as the powerα defines below:

α =log

(E(h)E(h2 )

)log(2) . (6.1)

If we decrease h by a half (i.e., increase N by 2) andalso decrease the time-size step dt by a half, then wecan numerically verify that the method is second-orderaccurate by confirming the power α is approximatelytwo.

6.1 Second-Order Accuracy of Velocity andPressure in 2D

In two dimensions, consider the solution u = (u, v),where u is the velocity in the x-direction and v is the

velocity in the y-direction. We defined the exact solu-tion u as below:

u(x, y, t) = cos(2π(x− t))sin(4πy), (6.2)

v(x, y, t) = −12sin(2π(x− t))cos(4πy). (6.3)

Then, the divergence-free velocity condition is satisfiedsince ux + vy = 0, and we have periodic boundary con-ditions. Note that the velocity u has one period ofcosine function in the x-direction and two periods ofsine function in the y-direction. On the other hand,the velocity v has one period of sine function in the x-direction and two periods of cosine in the y-direction.For simplicity, we choose the time t to be related only inthe x-direction. We let the pressure to be the followingfunction:

P (x, y, t) = cos(2π(x− t))sin(4πy).

Now, we set the time t = 0 in equation (6.2) and equa-tion (6.3) to get the initial velocity. We will comparethe error between the numerical solution and the exactsolution at the final time T = 0.2 using a time step ofsize dt = 0.01 and ν = 0.001 in the region [0, 1]× [0, 1].As we can see from Tab. 2, the power α of the velocitiesu, v, and pressure P is approximately two as we dou-bled the number of grid points in both x and y-directionand decreased dt by a half. In two dimensions, Tab. 2verified that the method gives a second-order accuracyin both the velocity field and the pressure.

Tab. 1: Second-Order Accuracy of Velocity and Pressure in 2DN1 ×N2 dt error u error v error P

64×64 0.01 2.56e-3 3.93e-3 1.79e-3128×128 0.005 6.55e-4 9.13e-4 4.79e-4256×256 0.0025 1.66e-4 2.19e-4 1.23e-4512×512 0.00125 4.18e-5 5.36e-5 3.13e-5

Tab. 2: Second-Order Accuracy of Velocity and Pressure in 2DN1 ×N2 dt rate u rate v rate P

64×64 0.01 - - -128×128 0.005 1.96 2.11 1.91256×256 0.0025 1.98 2.06 1.96512×512 0.00125 1.99 2.03 1.98

6.2 Second-Order Accuracy of Velocity andPressure in 3D

In three dimensions, consider the solution u = (u, v, w),where u is the velocity in the x-direction, v is the ve-locity in the y-direction, and w is the velocity in the

Page 11: Numerical investigation on the projection method for the

7 Stability Analysis 118

z-direction. We defined the exact solution u as:

u(x, y, z, t) = cos(2πx)sin(4π(y − t))cos(6πz), (6.4)v(x, y, z, t) = sin(2πx)cos(4π(y − t))cos(6πz), (6.5)w(x, y, z, t) = sin(2πx)sin(4π(y − t))sin(6πz). (6.6)

The velocity field u satisfies the divergence-free con-dition, i.e., ux + vy + wz = 0, and we have periodicboundary conditions. The pressure is defined by thefunction:

P (x, y, z, t) = cos(2π(x− t))sin(4πy)sin(6πz).

The initial velocity is defined by setting the time t = 0in equations (6.4)-(6.6). We will compute the numericalsolution at final time T = 0.1 using a time step of sizedt = 0.02 and ν = 0.001 in the domain [0, 1] × [0, 1] ×[0, 1]. From Tab. 4 and Tab. 5 we see that the rates ofconvergence in both the velocity u and the pressure Pare quadratic. In other words, α is approximately twowhen we double the number of grid points in x, y, and z-direction and decrease dt by a half. In three dimensions,this verified that the method is second-order accuratein both the velocity field and the pressure.

Tab. 3: Second-Order Accuracy of Velocity in 3DN1 ×N2 ×N3 dt error u error v error w

64×64×64 0.02 2.47e-2 1.67e-2 1.33e-2128×128×128 0.01 6.07e-3 3.92e-3 3.19e-3256×256×256 0.005 1.51e-3 9.53e-4 7.80e-4512×512×512 0.0025 3.76e-4 2.38e-4 1.93e-4

Tab. 4: Second-Order Accuracy of Velocity in 3DN1 ×N2 ×N3 dt rate u rate v rate w

64×64×64 - - -128×128×128 0.01 2.02 2.09 2.06256×256×256 0.005 2.01 2.04 2.03512×512×512 0.0025 2.00 2.00 2.01

Tab. 5: Second-Order Accuracy of Pressure in 3DN1 ×N2 ×N3 dt error P rate P64×64×64 0.02 3.48e-2 -

128×128×128 0.01 8.95e-3 1.96256×256×256 0.005 2.25e-3 1.99512×512×512 0.0025 5.62e-4 2.00

In both 2D and 3D, we can see that the rates of con-vergence of the velocity and the pressure are quadratic.Therefore, we have numerically verified that the methodis second-order accurate in both the velocity and thepressure.

7 Stability Analysis

We will analyze the stability of the Fourier-spectralmethod with the projection method using von Neu-mann stability analysis. Since our formulation approx-imates (u · ∇)u at a half-time step using the second-order Adams-Bashforth extrapolation, this can reduceor eliminate the dependence of the stability of the methodon the magnitude of viscosity [3]. We only consider thestability in the case when the magnitude of the veloc-ity is very small so that the nonlinear term can be ne-glected. In other words, we are considering the stabilityof the time-dependent Stokes equations.

The Crank-Nicolson scheme with the projection methodfor the time-dependent Stokes flow that we are consid-ering for stability analysis can be formulated:

u∗ − uι = νdt2 (∆u∗ + ∆uι) (7.1)

∆ϕι+1 = ∇ · u∗ (7.2)uι+1 = u∗ −∇ϕι+1. (7.3)

Here, we consider the region of [0, 1]× [0, 1] with peri-odic boundary conditions, so that L1 = L2 = 1. Thediscrete values uj,k, vj,k, and ϕj,k on the MAC grid canbe expressed as:

uj,k =n1∑m=1

n2∑n=1

um,nei2πm j

n1 ei2πn k+ 1

2n2 ,

vj,k =n1∑m=1

n2∑n=1

vm,nei2πm j+ 1

2n1 e

i2πn kn2 , (7.4)

ϕj,k =n1∑m=1

n2∑n=1

ϕm,nei2πm j+ 1

2n1 e

i2πn k+ 12

n2 .

Theorem 7.1. Crank-Nicolson StabilityThe Crank-Nicolson scheme with the projection methodformulated by equations (7.1)-(7.3) for solving the time-dependent Stokes equations is unconditionally stable.

We will prove the above theorem via the followingfour lemmas. Lemma 7.2 derives an expression for theFourier modes of the auxiliary velocity in terms of thoseof the velocity in the previous step and an amplificationfactor. Lemma 7.3 gives an expression for the solutionof equation (7.2) in Fourier space. These expressionsare then combined in Lemma 7.4 to provide an ex-pression for the time update of the velocity in Fourierspace in terms of an update matrix. Finally, Lemma7.5 shows that the spectral radius of this matrix is lessthan one and and therefore the time-stepping procedureis stable.

Lemma 7.2. Let λ =√

(2πm)2 + (2πn)2 and ρm,n =(1 − νdt

2 λ2)/(1 + νdt

2 λ2), then each (m,n)-th Fourier

Page 12: Numerical investigation on the projection method for the

7 Stability Analysis 119

mode of equation (7.1) is given by the following:[u∗m,nv∗m,n

]= ρm,n

[uιm,nvιm,n

].

Proof. Rearranging equation (7.1) and solving for u∗leads us to

u∗ =

(I + νdt∆

2

)(I − νdt∆

2

)uι. (7.5)

From equation (5.2), we have

∆u(x, y)

=∞∑

m=−∞

∞∑n=−∞

−4π2(m2 + n2

)um,ne

i2πmxei2πny.

Thus, defining λ =√

(2πm)2 + (2πn)2 and ρm,n =(1 − νdt

2 λ2)/(1 + νdt

2 λ2), equation (7.5) can be trans-

form using discrete Fourier transform:

n1∑m=1

n2∑n=1

u∗m,nei2πm jn1 e

i2πn k+ 12

n2

v∗m,nei2πm j+ 1

2n1 e

i2πn kn2

(7.6)

=n1∑m=1

n2∑n=1

ρm,nuιm,nei2πm jn1 e

i2πn k+ 12

n2

ρm,nvιm,ne

i2πm j+ 12

n1 ei2πn k

n2

. (7.7)

So, for each (m,n)-th mode, we obtain:[u∗m,nv∗m,n

]= ρm,n

[uιm,nvιm,n

].

Lemma 7.3. The solution to equation (7.2) can bewritten in the following discrete Fourier transform:

ϕj,k =n1∑m=1

n2∑n=1−ρm,n

λ2

(i2πmuιm,ne

i2πm jn1 e

i2πn k+ 12

n2

+i2πnvιm,nei2πm j+ 1

2n1 e

i2πn kn2

).

Proof. Applying the discrete Fourier transform to ∆ϕand ∇ · u∗ we have:

(∆ϕ)j,k

=n1∑m=1

n2∑n=1−[(

2πm)2

+(2πn

)2]ϕm,ne

i2πm j+ 12

n1 ei2πn k+ 1

2n2 .

(∇ · u∗)j,k

=n1∑m=1

n2∑n=1

i2mπρm,nuιm,nei2πm j

n1 ei2πn k+ 1

2n2

+n1∑m=1

n2∑n=1

i2nπρm,nvιm,nei2πm j+ 1

2n1 e

i2πn kn2

=n1∑m=1

n2∑n=1

[ρm,n

(i2mπuιm,ne

−i2πm 12n1

)+ ρm,n

(i2nπvιm,ne

−i2πn 12n2

)]ei2πm j+ 1

2n1 e

i2πn k+ 12

n2 .

Substitute into equation (7.2), for each (m,n)-th mode,we obtain:

−[(

2πm)2

+(2πn

)2]ϕm,n

= ρm,n

(i2mπuιm,ne

−i2πm 12n1 + i2nπvιm,ne

−i2πn 12n2

).

Since λ =√

(2πm)2 + (2πn)2, we have:

− λ2ϕm,n

= ρm,n

(i2mπuιm,ne

−i2πm 12n1 + i2nπvιm,ne

−i2πn 12n2

).

Thus, solve for ϕm,n we obtain:

ϕm,n = −ρm,nλ2

(i2mπuιm,ne

−i2πm 12n1 + i2nπvιm,ne

−i2πn 12n2

).

(7.8)

Finally, substitute ϕm,n in equation (7.8) into equation(7.4), we obtain:

ϕj,k =n1∑m=1

n2∑n=1

[− ρm,n

λ2

(i2mπuιm,ne

−i2πm 12n1

+ i2nπvιm,ne−i2πn 1

2n2

)]ei2πm j+ 1

2n1 e

i2πn k+ 12

n2

=n1∑m=1

n2∑n=1−ρm,n

λ2

(i2πmuιm,ne

i2πm jn1 e

i2πn k+ 12

n2

+ i2πnvιm,nei2πm j+ 1

2n1 e

i2πn kn2

).

Lemma 7.4. Each (m,n)-th Fourier mode of equation(7.3) can be expressed as the following:[

uι+1m,n

vι+1m,n

]= ρm,n

[n2

m2+n2 − mnn2+m2

− mnn2+m2

m2

m2+n2

] [uιm,nvιm,n

].

Proof. The gradient of ϕ can be written in the followingdiscrete Fourier transform,

(∇ϕ)j,k =[∑n1

m=1∑n2n=1−

ρm,nλ2 Q1∑n1

m=1∑n2n=1−

ρm,nλ2 Q2

],

Page 13: Numerical investigation on the projection method for the

8 Particles Simulation 120

where Q1 represents((i2πm

)2uιm,ne

i2πm jn1 e

i2πn k+ 12

n2

+(i2π

)2mnvιm,ne

i2πm j+ 12

n1 ei2πn k

n2

)and Q2 represents((

i2π)2mnuιm,ne

i2πm jn1 e

i2πn k+ 12

n2

+(i2πn

)2vιm,ne

i2πm j+ 12

n1 ei2πn k

n2

).

Now, substitute the discrete Fourier transform of uι+1,u∗, and ∇ϕ into equation (7.3), we see that at each(m,n)-th mode is given by:uι+1

m,nei2πm j

n1 ei2πn k+ 1

2n2

vι+1m,ne

i2πm j+ 12

n1 ei2πn k

n2

= ρm,n

[1− (2πm)2

λ2 − (2π)2mnλ2

− (2π)2mnλ2 1− (2πn)2

λ2

] uιm,nei2πm jn1 e

i2πn k+ 12

n2

vιm,nei2πm j+ 1

2n1 e

i2πn kn2

.Since λ2 = (2πm)2 +(2πn)2, the equation above is sim-plified to:[

uι+1m,n

vι+1m,n

]= ρm,n

[n2

m2+n2 − mnn2+m2

− mnn2+m2

m2

m2+n2

] [uιm,nvιm,n

].

Lemma 7.5.∥∥∥uι+1

m,n

∥∥∥ ≤ ∥∥∥u0m,n

∥∥∥ for all ι, and the methodis unconditionally stable.

Proof. The eigenvalues of the matrix is given by thecharacteristic equation of this 2× 2 matrix,∣∣∣∣∣ n2

m2+n2 − η − mnn2+m2

− mnn2+m2

m2

m2+n2 − η

∣∣∣∣∣=(

n2

m2 + n2 − η)(

m2

m2 + n2 − η)−(

mn

n2 +m2

)2.

Setting the determinant equals zero, we have

η2 −(

n2

m2 + n2 + m2

m2 + n2

)η = 0

η2 − η = 0η(η − 1) = 0.

This implies that the eigenvalues are η = 0 or η = 1.Since ρm,n = 1− νdt

2 λ2

1+ νdt2 λ2 , it is true that |ρm,n| ≤ 1. So, for

any vector norm ‖ · ‖ and any ι, we have∥∥∥uι+1m,n

∥∥∥ ≤ |ρm,n| · |η| · ∥∥∥uιm,n∥∥∥≤ (|ρm,n| · |η|)2 ·

∥∥∥uι−1m,n

∥∥∥≤ (|ρm,n| · |η|)ι+1 ·

∥∥∥u0m,n

∥∥∥ .Since η ≤ 1 and |ρm,n| ≤ 1, we have

∥∥∥uι+1m,n

∥∥∥ ≤ ∥∥∥u0m,n

∥∥∥for all ι.

The last lemma concludes that the error uι+1 doesnot propagate in time. Therefore, the Crank-Nicolsonscheme with the projection method formulated by equa-tions (7.1)-(7.3) for solving the time-dependent Stokesequations is unconditionally stable. Note that our sta-bility analysis is only on the time-dependent Stokesequations. To include the nonlinear effect from theNavier-Stokes equations, we may follow the same pro-cedure. However, the Fourier transform of the non-linear term involves convolution and needs more care-ful treatment. We leave the full stability analysis ofNavier-Stokes equations to future work.

8 Particles Simulation

In this chapter, we will do a simulation of the parti-cles flowing along the velocity fluid field in 2D and 3Dspaces with initial velocity u(x, 0) = 0 and a specifiedbody force f(x, t) on the fluid flow. We enforce thedivergence-free condition in the equation, and assumethe case of periodic boundary condition. For the pur-pose of simulation, we select the particles on the fluidfield at various locations and design the force flow tocreate certain patterns.

8.1 Particles Simulation in 2D

We will show two examples for 2D velocity field. Thefirst example simulates the particles on a fluid fieldwith very small viscosity, which flows according to theNavier-Stokes equations. The second example simu-lates the particles on a fluid field with a higher viscos-ity, which mimics the behavior of Stokes flow. Stokesflow corresponds to the case where the inertial term isso small compared to the viscous term of the fluid equa-tion that it can be neglected [13]. One property aboutStokes flow is that it has memory and can be reversedif we reverse the force field. Navier Stokes equation, onthe other hand, creates turbulence, and can not be re-versed to the original state with an opposite force field.We define the force flow in 2D simulation to be:

f(x,u, t) = a sin(ωt)[b(x− x⊥) + (x− rc)⊥ · 1‖x−rc‖≤r√

‖x− rc‖2 + 0.1

]

+ cu(1− ‖u‖2). (8.1)

Page 14: Numerical investigation on the projection method for the

8 Particles Simulation 121

The symbol ⊥ represents a perpendicular vector, i.e.,(x, y)⊥ = (−y, x). Since x⊥ is perpendicular to x wehave x⊥ · x = 0. In this case, (−y, x) · (x, y) = 0.The symbol 1 represents an indicator function. An in-dicator function is a function defined on a set of X thatindicates membership of an element in a subset A of X,having the value 1 for all elements of A and the value0 for all elements of X not in A. In this example, theset X is the domain of the fluid field [0, 1]× [0, 1]. Thesubset A of X is a circle centered at rc with radius r.So, all the (x, y) values within the region of the circlewill have a force in both x-direction and y-direction. Inparticularly, the force will be uniform within the circlesince we divided it by its norm.

This force will make the particles move along thisfluid field. The length of the arrows represents the mag-nitude or velocity of the vector fields. The direction ofthe arrows tell us the path of how a particle would movealong a certain location. Note that the force equationdepends on the spatial grids, velocity fields, and is pe-riodic in time with a period of 2π/ω. This means thatthe force field can be reversible. Moreover, there arethree components in the force field. The first com-ponent corresponds to a drifting force, varying basedon the location. The second component creates a ro-tational motion within a circular region with radius rcentered at rc. The last component creates a frictionalor damping force. This means that when the velocity istoo strong, this friction term will force the velocity in anegative direction so that the velocity becomes weaker.The inclusion of the damping component is for the sta-bility of the numerical solution.

Fig. 4: A 2D simulation of particles’ motion in a rotationalfluid velocity field with low viscosity.

Fig. 4 shows how the particles with V -shape movein time based on the initial velocity and the force givenabove with a very low constant coefficient of kinematic

viscosity ν = 0.001, dt = 0.001, N1 = N2 = 128, andT = 25. For the first example, we take a = 1, ω =0.2π, b = 0.01, c = 0.1, rc = (0.5, 0.5), and r = 0.3in the force flow equation (8.1). From Fig. 4, we cansee that if we let it run for a longer time period theparticles will mix together and will not return to theoriginal shape. Note that the particle V-shape startedto twirl toward the center first, and then formed an ovalshape and started to drifted out of the circular motion.After a while, the particles mix together and can not berecovered to its original V-shape even with the reversedforcing.

Fig. 5: A 2D simulation of particles’ motion in a rotationalfluid velocity field with high viscosity, showing re-versibility property.

This is different from the Navier-Stokes equationwith a high ν and appropriate force term, which canrestore the particle’s original shape within a given timeperiod as shown in Fig. 5. We can obtain the motionof particle V-shape in Fig. 5 that behaves like Stokesflow by letting ν = 1, dt = 0.001, N1 = N2 = 128, andT = 10. We take a = 50, ω = 0.2π, b = 0, c = 0.1,rc = (0.5, 0.5), and r = 0.3 in the force flow equation(8.1). Notice that in the second example, there is nodrifting force involved, so the particles will only rotateto the left hand side, and then will rotate it back to theright hand side to restore the V-shape. The V-shapeparticle was first started to twirl toward the center ofthe circle, and then at the half-time period, it started tounwind and return back to the original shape. We canrefer this as a time − reversibility of Stokes flows. How-ever, due to numerical error and the fact that the equa-tion that we are solving is not exactly the real Stokesequation, we can see that there is a little changed inthe V-shape. In other words, it did not restore backthe exact same V-shape that we originally started fromthe beginning. Nevertheless, if we let ν to be higher

Page 15: Numerical investigation on the projection method for the

9 Conclusion 122

like ν = 5 and let it run for one time period, we will seethat the restoring V-shape looks closer to the originalV-shape.

8.2 Particles Simulation in 3D

In the three dimensional simulation, we will considerthe case of a larger viscosity since the particles willbe spreading and mixing together in time with a verysmall viscosity. The domain of the fluid field is [0, 2]×[0, 2]× [0, 3], and we let N1 = N2 = N3 = 64, dt = 0.01,T = 10, and ν = 0.5. In the 3D example, we define theforce flow in x, y, and z-direction to be:f1

f2f3

=

−a(y − c) · 1A(r − γ(x, y, c))(γ(x, y, c))a(x− c) · 1A(r − γ(x, y, c))(γ(x, y, c))

b(cos(π(z−d)2 + 1)) · 1A

where a = 250, b = 0.3, c = 1, d = 2, r = 0.4,γ(x, y, c) =

√(x− c)2 + (y − c)2, and A = (x − c)2 +

(y − c)2 < r2. The factors −(y − c) and (x − c) causethe velocity to rotate counterclockwise in the xy-planewithin the region of a circle with radius 0.4 centered at(1,1). The factor (r − γ(x, y, c))(γ(x, y, c)) is responsi-ble for the rotational strength, which causes the velocityto have a weak rotational force near the center and astrong rotational force away from the center. The z-component of the force f3 points upward, and varyingalong the z-direction. Overall, this force will rotate theparticles in the xy-plane and push the particles to moveupward in the z-direction as shown in Fig. 6.

Fig. 6: A 3D simulation of particles’ motion in a rotationaland ascending fluid velocity field.

9 Conclusion

We have derived the Navier-Stokes equations using theconservation laws of mass and momentum. The firstpart of the equations is called the momentum equation

because it arises from Newton’s second law, F = ma.The second part of the equations is known as the conti-nuity equation. There are many different techniquessuch as finite difference, finite volume, and spectralmethod being developed within the area of CFD to ap-proximate the solution of the incompressible Navier-Stokes equations. We numerically solve the Navier-Stokes equations with periodic boundary condition us-ing the second-order projection method introduced byKim and Moin, which was extended from Chorin’s first-order projection method. As shown by Brown, Cortez,and Minion in the article “Accurate Projection Methodsfor the Incompressible Navier-Stokes Equations" usingnormal mode analysis, the projection method suggestedby Kim and Moin gives a second-order accuracy in bothvelocity field and pressure. To confirm their analyti-cal result, we numerically verified that the method issecond-order accurate by applying fast Fourier trans-form and finite differences scheme to solve the result-ing Poisson equations as sub-steps in the projectionmethod. The motivation behind the projection methodis the Helmholtz-Hodge decomposition theorem, whichstates that any smooth velocity field u∗ can be de-composed into a unique orthogonal decomposition ofgradient- and divergence-free fields. Thus, the idea be-hind the projection method is to use the momentumequation to solve for an intermediate velocity, which isnot required to be divergence-free. Then, applied theHelmholtz-Hodge decomposition theorem to project u∗onto a solenoidal field to yield a divergence-free ve-locity and a gradient field. Once u∗ is known, wecan use it to solve an elliptic equation that enforcesthe divergence constraint and update the pressure. Byapplying the Crank-Nicolson scheme for temporal dis-cretization, centered differences for spatial discretiza-tion, and a Fourier-spectral discretization to solve aPoisson equation on MAC grids, we see that the ratesof error decay in L∞ norm for both the velocity and thepressure are quadratic. This verified that the methodis second-order accurate in both the velocity and thepressure. We have also performed the stability analy-sis of the time-dependent Stokes equations, which is thecase when the magnitude of the velocity is very small sothat the nonlinear term can be neglected. Solving thePoisson equation using Fourier-spectral method withvon Neumann stability analysis, we see that the errorof the velocity does not propagate in time. Thus, weconclude that the Crank-Nicolson scheme with the pro-jection method for solving the time-dependent Stokesequations is unconditionally stable. For the purpose ofparticles simulation on the fluid flow, we included twocases of fluid flow in 2D and one case of fluid flow in3D. The first case in 2D simulated the particles on thefluid flows with very small viscosity, which act accord-ing to the Navier-Stokes equations. The second casesimulated the particles on the fluid flows with a higherviscosity, which behave like Stokes flow, and the parti-cles’ movement are reversible. The particles in 3D casewere also behave similar to Stokes flow.

Page 16: Numerical investigation on the projection method for the

9 Conclusion 123

References

[1] S. Armfield, “Finite difference solutions of theNavier-Stokes equations on staggered and non-staggered grids." Computers and Fluids 20 (1991):1-17.

[2] H. Berg and R. Anderson. “Bacteria Swim byRotating their Flagellar Filaments.” Nature 245(1973): 380-382.

[3] D. Brown, R. Cortez, and M. Minion, “Accu-rate Projection Methods for the IncompressibleNavier-Stokes Equations." Journal of Computa-tional Physics 168 (2001): 464-499.

[4] R. Burden and D. Faires, Numerical Analysis. 9thed. Boston, MA: Brooks/Cole, Cengage Learning,2011.

[5] A. Chorin, “Numerical solutions of the Navier-Stokes equations." Mathematics of Computation22, (1968): 745-762.

[6] A. Chorin, “On the convergence of discrete approx-imations to the Navier-Stokes equations." Mathe-matics of Computation 23 (1969): 341-353.

[7] Clay Mathematics Institute. “TheMillennium Prize Problems."http://www.claymath.org/millennium-problems/navier-stokes-equation (accessedFebruary 23, 2018).

[8] L. Edelstein-Keshet, “Mathematical models ofswarming and social aggregation." In Proceedingsof the 2001 International Symposium on Nonlin-ear Theory and Its Applications, Miyagi, Japan,(2001): 1-7.

[9] M. Fortin and A. Fortin. “A generalization ofUzawa’s algorithm for the solution of the Navier-Stokes equations." International Journal for Nu-merical Methods in Biomedical Engineering 1, no.5 (1985): 205-208.

[10] V. Fuka, “PoisFFT-A Free Parallel Fast Pois-son Solver." Applied Mathematics and Computa-tion 267, (2015): 356-364.

[11] R. Guy and A. Fogelson, “Stability of approximateprojection methods on cell-centered grids." Journalof Computational Physics 203 (2005): 517-538.

[12] J. Kim and P. Moin, “Application of a fractional-step method to incompressible Navier-Stokes equa-tions.” Journal of Computational Physics 59(1985): 308-323.

[13] S. Kim and S. Karrila. Microhydrodynamics: Prin-ciples and Selected Applications. Dover, 2005.

[14] L. Quartapelle, Numerical Solution of the In-compressible Navier-Stokes Equations. Basel:Birkhauser Verlag, 1993.

[15] S. Vanka, “Block-implicit multigrid solution ofNavier-Stokes equations in primitive variables."Journal of Computational Physics 65, no. 1 (1986):138-158.

[16] N. Vitanov and Z. Dimitrova. “Application of themethod of simplest equation for obtaining exacttraveling-wave solutions for two classes of modelPDEs from ecology and population dynamics."Communications in Nonlinear Science and Numer-ical Simulation 15 (2010): 2836-2845.

[17] Younsi, R. Navier-Stokes Equations: Properties,Description and applications. New York: Nova Sci-ence, 2012.

Vorleak Yek

Department of Mathematics and Statistics,California State University, Long Beach,1250 Bellflower Blvd, Long Beach, CA 90840, USA.

E-mail addresses: [email protected]