Title: Direct Numerical Simulations of Multiphase Flows
1Numerical Solution of Navier-Stokes Equations
in Velocity/Pressure Form
Instructor Hong G. Im University of Michigan
Fall 2005
2Objectives
Develop an understanding of the steps involved in
solving the Navier-Stokes equations using a
numerical method Write a simple code to solve
the driven cavity problem using the
Navier-Stokes equations in velocity form
3Outline
- The Driven Cavity Problem
- The Navier-Stokes Equations in Primitive Variable
(Velocity/Pressure) Form - Boundary Conditions
- Finite Difference Approximations to the
Derivatives - The Grid
- Finite Difference Approximation of the
Velocity/Pressure Equations - Finite Difference Approximation of the Boundary
Conditions - Iterative Solution of the Elliptic Equation
- Appendix Finite Volume Derivation
4Governing Equations
Governing equations for incompressible flows (no
gravity)
Advection Diffusion Pressure
For incompressible flows, the (hydrodynamic)
pressure projects the velocity field into an
incompressible space.
Mathematically, the system can be interpreted as
differential equations with algebraic
constraint.
5Time Integration
The discretized equations can be written as
Splitting integration procedure
1. Integrate without pressure
2. Project into a space to enforce
incompressibility
with
Projection (Fractional Step) Method
6Projection Method (1st Order)
1. Integration without pressure
2. Projection
7Projection Method - Summary
1. Find a temporary velocity using the advection
and the diffusion terms only.
2. Find the pressure needed to make the velocity
field incompressible.
3. Correct the velocity by adding the pressure
gradient.
8The Marker-and-Cell (MAC) Grid
vi,j3/2
vi-1,j3/2
vi1,j3/2
ui1/2,j1
ui-1/2,j1
ui3/2,j1
ui-3/2,j1
pi1,j1
pi,j1
pi-1,j1
vi,j1/2
vi-1,j1/2
vi1,j1/2
ui1/2,j
pi1,j
pi,j
pi-1,j
ui-1/2,j
ui3/2,j
ui-3/2,j
vi,j-1/2
vi-1,j-1/2
vi1,j-1/2
ui1/2,j-1
ui-1/2,j-1
ui3/2,j-1
ui-3/2,j-1
pi1,j-1
pi,j-1
pi-1,j-1
vi,j-3/2
vi-1,j-3/2
vi1,j-3/2
9The MAC (Staggered) Grid
Pressure at the center Velocity at the cell
surface
v
i,j1/2
h
- Prevents oscillatory behavior
- in first derivatives
P
u
u
i,j
i-1/2,j
i1/2,j
v
100
100
300
100
300
i,j-1/2
i?1
i?2
i
i1
i2
h
- Pressure boundary condition is not needed
- Velocity boundary condition becomes tricky
10Incompressibility
v
i,j1/2
h
P
u
u
i,j
i-1/2,j
i1/2,j
v
i,j-1/2
h
Multiply by h
11X-Momentum Equation
For x-momentum equations, cell centered around
vi1,j1/2
vi,j1/2
h
ui1/2,j
pi,j
pi1,j
Advection term
vi,j-1/2
vi1,j-1/2
h
12X-Momentum Equation
Advection term (continued)
vi1,j1/2
vi,j1/2
h
ui1/2,j
pi,j
pi1,j
vi,j-1/2
vi1,j-1/2
h
13X-Momentum Equation
Diffusion term
vi1,j1/2
vi,j1/2
h
ui1/2,j
pi,j
pi1,j
vi,j-1/2
vi1,j-1/2
h
14X-Momentum Equation
Putting them all together
15X-Momentum Equation
Projection
Solution for
are found by solving the Poisson equation.
16Y-Momentum Equation
For y-momentum equations, cell centered around
ui1/2,j1
pi,j1
ui-1/2,j1
h
vi,j1/2
Advection term
pi,j
ui-1/2,j
ui1/2,j
h
17Y-Momentum Equation
Advection term (continued)
ui1/2,j1
pi,j1
ui-1/2,j1
h
vi,j1/2
pi,j
ui-1/2,j
ui1/2,j
h
18Y-Momentum Equation
Diffusion term
ui1/2,j1
pi,j1
ui-1/2,j1
h
vi,j1/2
pi,j
ui-1/2,j
ui1/2,j
h
19Y-Momentum Equation
Putting them all together
20Y-Momentum Equation
Projection
21Poisson Equation - Pressure
v
i,j1/2
h
P
u
u
i,j
i-1/2,j
i1/2,j
v
i,j-1/2
h
22Poisson Equation - Pressure
Solving the pressure equation
Simple iteration
SOR iteration
23Computational Grid
Since a fractional number is not allowed in
computer program, redefine velocity node indices
v(i,j)
h
u(i-1,j)
P(i,j)
u(i,j)
v(i,j-1)
h
24Boundary Grid Structure
v0,2
v1,2
v2,2
u2,2
p2,2
p1,2
p0,2
u0,2
u1,2
v2,1
v1,1
v0,1
u2,1
u0,1
u1,1
p2,1
p1,1
p0,1
v0,0
v1,0
v2,0
u2,0
p0,0
p1,0
p2,0
u1,0
u0,0
25Boundary Grid Structure
pnx1,ny1
pnx,ny1
unx-2,ny1
pnx-1,ny1
unx-1,ny1
unx,ny1
vnx-1,ny
vnx,ny
vnx1,ny
pnx-1,ny
pnx1,ny
pnx,ny
unx-1,ny
unx,ny
unx-2,ny
vnx1,ny-1
vnx,ny-1
vnx-1,ny-1
pnx1,ny-1
unx-1,ny-1
pnx-1,ny-1
unx,ny-1
pnx,ny-1
unx-2,ny-1
vnx-1,ny-2
vnx,ny-2
vnx1,ny-2
26Boundary Conditions
Velocity
pi1,2
pi,2
ui-1,2
pi-1,2
ui,2
(impermeable)
vi,1
vi1,1
vi-1,1
ui-1,1
ui,1
pi1,1
pi,1
pi-1,1
(reflection technique)
vi-1,0
Pressure
vi1,0
vi,0
Neumann Condition derived from projection
equation
pi,0
ui,0
pi1,0
pi-1,0
ui-1,0
27Boundary Conditions - Velocity
(impermeable)
(reflection technique)
28Boundary Conditions - Velocity
Using Taylor expansion
Subtracting,
Adding the two,
29Boundary Conditions - Pressure
Pressure
pi,2
ui-1,2
ui,2
At y0 boundary
vi,1
ui-1,1
ui,1
pi,1
Recall Poisson equation,
vi,0
pi,0
ui,0
ui-1,0
0
30Boundary Conditions - Pressure
Boundary Pressure Treatment
Interior nodes
Boundary nodes except corner
Corner nodes
31Boundary Grid Structure (Final)
v0,2
v1,2
v2,2
Array Dimension
u2,2
u1,2
p2,2
p1,2
p0,2
u0,2
0
v2,1
v1,1
v0,1
u2,1
u0,1
u1,1
p2,1
p1,1
p0,1
0
v0,0
v1,0
v2,0
u2,0
p0,0
p1,0
u1,0
p2,0
u0,0
0
0
0
32Boundary Grid Structure
0
0
0
pnx1,ny1
pnx,ny1
unx-2,ny1
pnx-1,ny1
unx-1,ny1
unx,ny1
Array Dimension
vnx-1,ny
vnx,ny
vnx1,ny
pnx-1,ny
unx-1,ny
pnx1,ny
pnx,ny
unx-2,ny
0
unx,ny
vnx1,ny-1
vnx,ny-1
vnx-1,ny-1
pnx1,ny-1
unx-1,ny-1
pnx-1,ny-1
unx-2,ny-1
unx,ny-1
pnx,ny-1
0
vnx-1,ny-2
vnx,ny-2
vnx1,ny-2
33Algorithm
Initial field given
Determine u, v boundary conditions
Advect
Poisson equation for (SOR)
Projection
tt?t
34Project 1
Driven Cavity Problem With Velocity-Pressure
Formulation
35Appendix
Finite-Volume Derivation
36Governing equations
Incompressibility (conservation of mass)
Navier-Stokes equations (conservation of momentum)
37v
i,j1/2
Conservation of mass
h
P
u
u
i,j
i-1/2,j
i1/2,j
v
i,j-1/2
Integrate over the boundary
h
Divide by h
38Momentum equation
For the x-momentum, select a control volume
around the u-velocity
vi1,j1/2
vi,j1/2
ui1/2,j
pi,j
pi1,j
vi,j-1/2
vi1,j-1/2
Integrate over the control volume
39Unsteady term
vi1,j1/2
vi,j1/2
Rate of change of momentum
h
ui1/2,j
pi,j
pi1,j
vi,j-1/2
vi1,j-1/2
h
Integrate over the control volume
40Advection terms-I
vi1,j1/2
vi,j1/2
In/out flow of momentum
h
ui1/2,j
pi,j
pi1,j
vi,j-1/2
Integrate over the boundary
vi1,j-1/2
h
41Advection terms-II
vi1,j1/2
vi,j1/2
Find the fluxes
ui1/2,j
pi,j
pi1,j
vi,j-1/2
vi1,j-1/2
42Pressure term
Vi1,j1/2
Vi,j1/2
Pressure force
h
ui1/2,j
Pi,j
Pi1,j
Vi,j-1/2
Vi1,j-1/2
h
Integrate over the boundary
43Viscous terms-I
Integrate over the boundary
x-momentum
y-momentum
44Viscous terms-I
Integrate over the boundary
h
ui1/2,j
h
45Viscous terms-I
vi1,j1/2
vi,j1/2
Viscous diffusion of momentum
h
ui1/2,j
pi,j
pi1,j
vi,j-1/2
Integrate over the boundary
vi1,j-1/2
h
46Viscous terms-II
Vi1,j1/2
Vi,j1/2
Computing the derivatives at the boundary
ui3/2,j
ui1/2,j
ui?1/2,j
Pi,j
Pi1,j
Vi,j-1/2
Vi1,j-1/2
Integrate over the vertical boundaries
47Viscous terms-III
Vi1,j1/2
Vi,j1/2
h
ui1/2,j
Pi,j
Pi1,j
Vi,j-1/2
Vi1,j-1/2
h
The final result is
48Gathering the terms
49(No Transcript)
50Split into two steps
51Integrate in time without pressure
52Pressure equation
53Projection