Numerical Solution of The Incompressible Navier-Stokes Equations
Numerical Solution of The Incompressible Navier-Stokes Equations
Numerical Solution of The Incompressible Navier-Stokes Equations
1 ∂ u ∂ u
∗ 2 ∗ 2 ∗
∂u ∂ ∗2 ∗ ∂ ∗ ∗
+ (u + p ) + (u v ) = +
∂t
∗
∂x
∗
∂y
∗
Re ∂x ∗ 2 ∂y ∗ 2
1 ∂ v ∂ v
∗ 2 ∗ 2 ∗
∂v ∂ ∗ ∗ ∂ ∗2 ∗
+ (u v ) + ( v + p ) = +
∂t
∗
∂x
∗
∂y
∗
Re ∂x ∗ 2 ∂y ∗ 2
The variables have been non-dimensionalized using the free stream velocity V∞, density
ρ∞, viscosity µ∞, and a length scale L, shown below.
∗ x ∗ y ∗ tV ∗ u ∗ v ∗ p
x = , y = , t = ∞ , u = , v = , p =
ρ ∞V∞
2
L L L V∞ V∞
ρ ∞V∞ L
Re =
µ∞
The superscript denoting non-dimensional format will be subsequently dropped from here
on. Unlike the compressible Navier-Stokes equations, the incompressible form does not
have a time dependent term in the mass conservation equation. In the compressible form,
the time dependent term provided a direct reference to density, allowing for a numerical
scheme to solve for density directly. In the incompressible for, the momentum equations
can be used to solve for u and v, but the continuity equation does not reference p because
of the absence to this term. An artificial compressibility term must be added to the
continuity equation to allow for the solution of p, shown below.
∂p 2 ∂u ∂v
+a + =0
∂t ∂x ∂y
The term a denotes a pseudo speed of sound. As the numerical scheme progresses
towards a steady state solution, the new time dependent term tends to zero magnitude.
This implies that in the steady state the original continuity equation is recovered.
Explicit Solution
Explicit solution of the incompressible Navier-Stokes is relatively straightforward given
the previous notes on non-linear terms. Numerous methodologies make be used, forward
time- central space (FTCS), Dufort Frankel, MacCormack, Crank-Nicolson to name a
2
few. If central differencing is used on the convective terms, artificial dissipation may be
needed to ensure stability if the Reynolds number is fairly large. Another method of
improving stability for incompressible flows is with the use of a staggered grid. An
example of a staggered grid is shown below. This grid arrangement provides stronger
coupling between the pressure and velocity variables thus improving stability. The
original primary grid is denoted with
vi,j+3/2 solid lines while the secondary grid is
shown with dashed lines. The pressure
Pi,j+1 ui+1/2,j+1 is assigned to the nodes on the primary
while the velocities are defined on the
vi,j+1/2 vi+1,j+1/2 secondary nodes. More specifically,
the u velocity is defined on the 1/2 grid
line between the nodes on the primary
ui-1/2,j Pi,j ui+1/2,j Pi+1,j ui+3/2,j in the x direction. While the v velocity
is at the 1/2 lines in the y direction, as
vi,j-1/2
shown.
An explicit algorithm based on the staggered grid as shown can begin with the
discretization of the momentum equations using a first order difference in time and a
central scheme in space. The velocity components are solved first using,
n +1
u i +1 / 2, j − u i +1 / 2, j u
n
+
( ) 2 n
i +1, j − u ( ) 2 n
i, j
+
pi +1, j − pi , j (uv )i +1 / 2, j +1 / 2 − (uv )i +1 / 2, j −1 / 2
n
+
n n n
∆t ∆x ∆x ∆y
1 u i −1 / 2, j − 2u i +1 / 2, j + u i +3 / 2, j u i +1 / 2, j −1 − 2u i +1 / 2, j + u i +1 / 2, j +1
n n n n n n
= +
∆ ∆
2 2
Re x y
+
pin, j +1 − pin, j
+
(uv)in+1 / 2, j +1 / 2 − (uv)in−1 / 2, j +1 / 2
∆t ∆y ∆y ∆x
1 vin−1, j +1 / 2 − 2vin, j +1 / 2 + vin+1, j +1 / 2 vin, j −1 / 2 − 2vin, j +1 / 2 + vin, j + 3 / 2
= +
Re ∆x 2
∆y 2
Once the velocity components are computed for the time level n+1, the modified
continuity expression can be solved for the pressure,
pin, +j 1 − pin, j u n +1 − uin−+11/ 2, j vin, +j +11 / 2 − vin, +j −11 / 2
+ a 2 i +1 / 2, j + =0
∆t ∆x ∆ y
Since the velocities are only available on the secondary grid, an interpolation must be
used to obtain velocities at points on the primary grid. The following approximations can
be used,
1
(u 2 )i +1, j = (ui +3 / 2, j + ui +1 / 2, j )2
4
1
(u 2 )i, j = (ui +1 / 2, j + ui −1 / 2, j )2
4
3
1
(v 2 )i, j +1 = (vi, j +3 / 2 + vi, j +1 / 2 )2
4
1
(v 2 )i, j = (vi, j +1 / 2 + vi, j −1 / 2 )2
4
1
(uv)i +1 / 2, j +1 / 2 = (ui +1 / 2, j + ui +1 / 2, j +1)(vi, j +1 / 2 + vi +1, j +1 / 2 )
4
1
(uv)i +1 / 2, j −1 / 2 = (ui +1 / 2, j + ui +1 / 2, j −1)(vi, j −1 / 2 + vi +1, j −1 / 2 )
4
1
(uv)i −1 / 2, j +1 / 2 = (ui −1 / 2, j + ui −1 / 2, j +1)(vi, j +1 / 2 + vi −1, j +1 / 2 )
4
In a large number of cases a pressure boundary condition will not be available at a given
boundary. This means that the pressure at a boundary will be unknown. In this instance,
the algorithm just outlined, often called the Marker and Cell approach, will alleviate the
problem. If the boundaries are selected to coincide with the secondary grid, pressure on
the boundaries will not be needed. For example, consider an inflow boundary and a wall,
shown below. If the wall is aligned with j = ½, and the inflow with i = ½, the pressure
does not appear on the surface and is calculated only in the interior. However, values of
u3/2,0 and v0,3/2 must be specified.
inflow
boundary
j=2
v0,3/2 v1,3/2 v2,3/2
j=3/2
At the inflow boundary the u velocities are specified directly from the input conditions.
Values such as u1/2,1, u1/2,2 are know from any problem definition and need no special
treatment. The v components of velocity outside of the boundary, such as v0,3/2, v0,5,2 ..
can be found from extrapolation,
∂v (v 2,3 / 2 − v1,3 / 2 )
v0,3 / 2 = v1,3 / 2 − ∆x = v1,3 / 2 − ∆x = 2v1,3 / 2 − v 2,3 / 2
∂x ∆x
At an outflow boundary, one could use the same approach to calculate v or even u.
Both the time step size and the value of the pseudo speed of sound define the stability
requirement for this method. The time step size is limited by
2⋅∆
∆t ≤ 1 / 2 min
N a(1 + 5 )
Here, ∆min means the smallest ∆x or ∆y on the grid, N is the number of dimensions in the
domain, and a is the speed of sound used in the pseudo continuity equation. This value is
defined by the maximum velocity,
Vmax
<1 V = u +v
2 2
a
Note that it is not necessary to use a staggered grid but it does naturally enforce
conservation at the main grid points. Also note that all variables are non-dimensional,
meaning that the incoming velocity at the inflow boundary in the above example will be
u/V∞ = 1.
Implicit Solution
The implicit solution of the incompressible Navier-Stokes is more easily accomplished if
the equations are written in conservative form,
∂Q ∂E ∂F
+ + =
1
[M ]∇ 2 Q
∂t ∂x ∂y Re
p a u 2
a v 2
0 0 0
2
Q = u , E = u + p , F = uv , M = 0 1 0
v uv v 2 + p 0 0 1
In an implicit scheme, the non-linearity of the flux terms must be addressed if a system of
linear algebraic equations is to be developed. Using Newton's method,
n +1 ∂E
=E + ∆t + O(∆t )
n 2
E
∂t
n +1 ∂E ∂Q
=E + ∆t + O(∆t )
n 2
E
∂Q ∂t
n +1 ∂E ∆Q
=E + ∆t + O(∆t )
n 2
E
∂Q ∆t
n +1 ∂E
=E + ∆Q + O(∆t )
n 2
E
∂Q
n +1
∆Q = Q −Q
n
5
The terms ∂E/∂x and ∂F/∂y are Jacobian matrices and will be denoted as A and B from
this point on. As an example, matrix A is defined as,
∂E1 ∂E1 ∂E1
∂Q ∂Q2 ∂Q3
1
∂E ∂E 2 ∂E 2
A= 2
∂Q1 ∂Q2 ∂Q3
∂E3 ∂E3 ∂E3
∂Q1 ∂Q2 ∂Q3
These values can be determined by re-writing the original flux vectors in terms of the
components of the solution vector, Q1, Q2, Q3. The flux vectors are written in terms of
these values and differentiated,
p Q1 a 2u a 2 Q2 E1
2 2
Q = u = Q2 E = u + p = Q2 + Q1 =
E
2
v Q3 uv QQ E3
2 3
and
∂E1 ∂E1 ∂E1 ∂E 2 ∂E 2
= 0, =a , = 0, = 1, = 2u .......
2
0 a 2 0 0 0 a 2
A = 1 2u 0 , B = 0 v u
0 v u 1 0 2v
Inserting the linear approximations into the vector form of the Navier-Stokes equations,
and approximating the time derivative term,
∆Q ∂ ∂
+ ( E + A∆Q) + ( F + B∆Q) =
n n 1
[M ]∇ 2 Q n+1
∆t ∂x ∂y Re
using
n +1
= ∆Q + Q
n
Q
I + ∆t ∂A + ∂B − M ∂ + ∂ ∆Q = ∆t − ∂E − ∂F + M ∂ Q + ∂ Q
2 2 n n 2 n 2 n
∂x ∂y Re ∂x 2
∂y
2
∂x ∂y Re ∂x 2
∂y
2
Using approximate factorization, the equation above in the form Ax=B, can be separated
into equations involving x and y directions involving tri-diagonal matrices
∂A M ∂ 2
1 + ∆t ∂B − M ∂ 2
2
I + ∆t ∂x − Re 2 ∆Q = RHS
∂x ∂y Re ∂y
6
∂A M ∂ 2 ∂ ∗
2
∂
4
∂ n
4
+ ∆ − + ε ∆ ∆ = − ε ∆ + ∆
2 4 4
I t ∂x Re 2 2i ( x ) 2
Q RHS 4i ( x ) ( y ) 4
Q
∂ ∂ ∂ ∂
4
x x x y
y direction,
∂B M ∂ 2 ∂
2
I + ∆t − + ε ( ∆y
2
) 2
∆Q = ∆Q
∗
∂y Re ∂y 2 2i ∂y
In these two tri-diagonal equations, second order artificial dissipation has been added to
the left hand side (LHS) and fourth order to the RHS to ensure stability. The star super
script on the ∆Q indicates an intermediate solution preceding the final solution of the y
equation. A staggered grid is not necessary in this approach due to the coupling afforded
by the implicit scheme. If a central difference is applied to all spatial terms the x direction
equation would become,
∗ ∆t ∗ ∗ M ∆t ∗ ∗ ∗
∆Qi , j + ( Ai +1, j ∆Qi +1, j − Ai −1, j ∆Qi −1, j ) − (∆Qi +1, j − 2∆Qi , j + ∆Qi −1, j )
n n
2∆x Re ∆x 2
∗ ∗ ∗
+ ε 2i (∆Qi +1, j − 2∆Qi , j + ∆Qi −1, j ) =
Ein+1, j − Ein−1, j Fi ,nj +1 − Fi ,nj −1 M Qin+1, j − 2Qin, j + Qin−1, j M Qin, j +1 − 2Qin, j + Qin, j −1
∆t − − + +
2∆x 2∆y Re ∆x
2
Re ∆y
2
[( n n
) (
− ε 4i Qi − 2, j − 4Qi −1, j + 6Qi , j − 4Qi +1, j + Qi + 2, j + Qi , j − 2 − 4Qi , j −1 + 6Qi , j − 4Qi , j +1 + Qi , j + 2
n n n n n n n n
)]
in tri-diagonal form the x equation is,
∆t n M ∆t ∗ 2M ∆t ∗
− 2∆x Ai −1, j − Re 2 + ε 2i ∆Qi −1, j + I + Re 2
− 2ε 2i ∆Qi , j
∆x ∆x
∆t n M ∆t ∗
+ Ai +1, j − 2
+ ε 2i ∆Qi +1, j = RHS i , j
2∆x Re ∆x
the y equation is
∆t n M ∆t
− Bi , j −1 − + ε 2i ∆Qi , j −1 + I + 2M ∆t2 − 2ε 2i ∆Qi , j
2
2∆y Re ∆y Re ∆y
∆t n M ∆t
Bi , j +1 − ∗
+ 2
+ ε 2 i ∆Qi , j +1 = ∆Qi , j
2∆y Re ∆y
7
Reference