Week3 Lecture Notes
Week3 Lecture Notes
33
This signifies that no perturbation effect is carried upstream. In other words, the
upwind method maintains unidirectional flow of information. In conclusion, it
can be said that while space centred differences are more accurate than upwind
differences, as indicated by the Taylor series expansion, the whole system is not
more accurate if the criteria for accuracy includes the transportive property as
well.
Substituting Eqns. (2.101) and (2.102) into (2.96) gives (dropping the subscript
i and superscript n)
" #
2
1 ∂ζ (∆t) ∂ 2 ζ
∆t + + O(∆t)3
∆t ∂t 2 ∂t2
" #
u ∂ζ (∆x)2 ∂ 2 ζ 3
=− ∆x − + O(∆x) + [Diffusive term]
∆x ∂x 2 ∂x2
or 2
∂2ζ
∂ζ ∂ζ 1 u ∆t ∂ ζ
= −u + u ∆x 1 − + ν + O(∆x)2
∂t ∂x 2 ∆x ∂x2 ∂x2
which may be rewritten as
∂ζ ∂ζ ∂2ζ ∂2ζ
= −u + ν 2 + νe 2 + higher-order terms (2.103)
∂t ∂x ∂x ∂x
where
1 u ∆t
νe = [u ∆x (1 − C)], C (Courant number) =
2 ∆x
2.34 Computational Fluid Dynamics
In deriving Eq. (2.103), ∂ 2 ζ/∂t2 was taken as u2 ∂ 2 ζ/∂x2 . However, the non-
physical coefficient νe leads to a diffusion like term which is dependent on the
discretization procedure. This νe is known as the numerical or artificial viscosity.
Let us look at the expression.
1
νe =[u ∆x (1 − C)] for u > 0 (2.104)
2
somewhat more critically. On one hand we have considered that u > 0 and
on the other CFL condition demands that C < 1 (so that the algorithm can
work). As a consequence, νe is always a positive non-zero quantity (so that the
algorithm can work). If, instead of analysing the transient equation, we put
∂ζ/∂t = 0 in Eq. (2.96) and expand it in Taylor series, we obtain
1
νe = u ∆x (2.105)
2
Let us now consider a two-dimensional convective-diffusive equation with viscous
diffusion in both directions(Eq. (2.67) but with ω = ζ). For ui , vi > 0, upwind
differencing gives
n+1 n n n n n
ζi,j − ζi,j u ζi,j − u ζi−1,j v ζi,j − v ζi,j−1
=− −
∆t ∆x ∆y
n n n
ζi+1,j − 2ζi,j + ζi−1,j
+ν
(∆x)2
n n n
ζi,j+1 − 2ζi,j + ζi,j−1
+ (2.106)
(∆y)2
The Taylor series procedure as was done for Eq. (2.103) will produce
∂ζ ∂ζ ∂ζ ∂2ζ ∂2ζ
= −u −v + (ν + νex ) 2 + (ν + νey ) 2 (2.107)
∂t ∂x ∂y ∂x ∂y
where
1
νex = [u ∆x(1 − Cx )],
2
1 u ∆t v ∆t
νey = [v ∆y(1 − Cy )]; with Cx = , Cy =
2 ∆x ∆y
As such for u ≈ v and ∆x = ∆y, CFL condition is Cx = Cy ≤ (1/2). This
indicates that for a stable calculation, artificial viscosity will necessarily be
present. However, for a steady-state analysis, we get
1 1
νex = u ∆x; νey = v ∆y (2.108)
2 2
We have observed that some amount of upwind effect is indeed necessary to
maintain transportive property of flow equations while the computations based
on upwind differencing often suffer from false diffusion (inaccuracy!). One of
the plausible improvements is the usage of higher-order upwind method of dif-
ferencing. Next subsection discusses this aspect of improving accuracy.
Finite Difference Method 2.35
∂(uζ) uR ζR − uL ζL
= (2.109)
∂x i,j ∆x
One point to be carefully observed from Eq. (2.109) is that the second upwind
should be written in conservative form. However, the definition of uR and uL
are (see Fig. 2.9):
ui,j + ui+1,j ui,j + ui−1,j
uR = ; uL = (2.110)
2 2
Now,
and
Let us discretize the second term of the convection part of unsteady x-direction
momentum equation. We have chosen this in order to cite a meaningful example
of second upwind differencing. Using Eq. (2.113), we can write
∂u2
1 ui,j + ui+1,j ui,j + ui−1,j
= ui,j − ui−1,j
∂x i,j ∆x 2 2
1 ui,j + ui+1,j ui,j + ui+1,j + ui,j − ui+1,j
=
∆x 2 2
ui,j + ui−1,j ui−1,j + ui,j + ui−1,j − ui,j
−
2 2
1
= [(ui,j + ui+1,j )[(ui,j + ui+1,j ) + (ui,j − ui+1,j )]
4∆x
− (ui−1,j + ui,j )[(ui−1,j + ui,j ) + (ui−1,j − ui,j )]]
1
= (ui,j + ui+1,j )2 + (u2i,j − u2i+1,j )
4∆x
− (ui−1,j + ui,j )2 − (u2i−1,j − u2i,j )
(2.114)
2.36 Computational Fluid Dynamics
uL uR
For u > 0
∂ζ ζ n+1 − ζin
= i (Forward time)
∂t ∆t
n+1 n+1
∂ζ ζ − ζi−1 ζ n − 2ζin + ζi−1
n
= i + i+1
∂x ∆x 2∆x
where
and
u∆t u∆t n
Di = 1+ ζin − (ζ n
+ ζi−1 ) (2.117)
∆x 2∆x i+1
For ui > 0, Ai , Bi and Ci > 0 and Bi > Ai + Ci . The system of equations pro-
duced from Eq. (2.116) is always diagonally dominant and capable of providing
a stable solution. As the solution progresses (i.e. uni → un+1 i ), the convective
term approaches second-order accuracy. This method of implementing higher-
order upwind is known as the “deferred correction procedure”.
Another widely suggested improvement is known as third-order upwind dif-
ferencing (see Kawamura et al. 1986). The following example illustrates the
essence of this discretization scheme.
∂u −ui+2,j + 8 (ui+1,j − ui−1,j ) + ui−2,j
u = ui,j
∂x i,j 12 ∆x
ui+2,j − 4 ui+1,j + 6 ui,j − 4 ui−1,j + ui−2,j
+ |ui,j |
4 ∆x (2.118)
Vanka (1987), Fletcher (1988) and Rai and Moin (1991) for more stimulating
information on related topics.
One of the most widely used higher order schemes is known as QUICK
(Leonard, 1979). The QUICK scheme may be written in a compact manner in
the following way
∂u ui−2 − 8 ui−1 + 8 ui+1 − ui+2
f = fi
∂x i 12 ∆x
2
(∆x) −ui−2 + 2 ui−1 − 2 ui+1 + ui+2
+ fi
24 (∆x)3
3
(∆x) ui−2 − 4 ui−1 + 6 ui − 4 ui+1 + ui+2
+ |fi |
16 (∆x)4 (2.119)
The fifth-order upwind scheme (Rai and Moin, 1991) uses seven points stencil
along with a sixth-order dissipation. The scheme is expressed as
∂u ui+3 − 9 ui+2 + 45 ui+1 − 45 ui−1 + 9 ui−2 − ui−3
f = fi
∂x i 60 ∆x
ui+3 − 6 ui+2 + 15 ui+1 − 20 ui + 15 ui−1 − 6 ui−2 + ui−3
− α|fi |
60 ∆x
(2.120)
ζin+1 − ζin n n n
ζi+1 − ζi−1 ζi+1 − 2 ζin + ζi−1
n
+u =ν (2.121)
∆t 2∆x (∆x)2
u2 ∆t
∂ζ
+ u ζx = ν− ζxx (2.122)
∂t 2
We define
ν(∆t) u∆t
r= ; C= = Courant number
(∆x)2 ∆x
It is interesting to note that the values r = 1/2 and C = 1 (which are extreme
conditions of Von Neumannn stability analysis) unfortunately eliminates viscous
diffusion completely in Eq. (2.122) and produce a solution from Eq. (2.121)
Finite Difference Method 2.39
u2 ∆t
ν− >0
2
For meaningful physical result in the case of inviscid flow we require
u2 ∆t
ν− =0
2
Combining these two criteria, for a meaningful solution
u2 ∆t
ν− ≥0
2
or
1 u ∆t u ∆x
ν 1− · ≥0 (2.123)
2 ∆x ν
Here we define the mesh Reynolds-number or cell-peclet number as
u∆x
Re∆x = = P e∆x
ν
So, we get
1
ν 1 − C · Re∆x ≥ 0
2
or
2
Re∆x ≤ (2.124)
C
The plot of C vs Re∆x is shown in Fig. 2.10 to describe the significance of
Eq. (2.124). From the CFL condition, we know that the stability requirement is
C ≤ 1. Under such a restriction, below Re∆x = 2, the calculation is always sta-
ble. The interesting information is that it is possible to cross the cell Reynolds
number of 2 if C is made less than unity.
References
1. Anderson, D.A., Tannehill, J.C, and Pletcher, R.H., Computaional Fluid
Mechanics and Heat Transfer, Hemisphere Publishing Corporation, New
York, USA, 1984.
2. Burgers, J.M., A Mathematical Model Illustrating the Theory of Turbu-
lence, Adv. Appl. Mech., Vol. 1, pp. 171-199, 1948.
3. DuFort, E.C. and Frankel, S.P., Stability Conditions in the Numerical
Treatment of Parabolic Differential Equations, Mathematical Tables and
Others Aids to Computation, Vol. 7, pp. 135-152, 1953.
2.40 Computational Fluid Dynamics
1 CFL
restriction
0
2 4 6 8
Re∆ x
2
Figure 2.10: Limiting Line (Re∆x ≤ ).
C
8. Khosla, P.K. and Rubin, S.G., A Diagonally Dominant Second Order Ac-
curate Implicit Scheme, Computers and Fluids, Vol. 2, pp. 207-209, 1974.
11. Rai, M.M. and Moin, P., Direct Simulations of Turbulent Flow Using
Finite Difference Schemes, J. Comput. Phys., Vol. 96, pp. 15-53, 1991.
Finite Difference Method 2.41
14. Runchal, A.K. and Wolfshtein, M., Numerical Integration Procedure for
the Steady State Navier-Stokes Equations, J. Mech. Engg. Sci., Vol. 11,
pp. 445-452, 1969.
Problems
1. Consider the nonlinear equation
∂u ∂ 2u
u =µ 2 (2.125)
∂x ∂y
What is the order of the truncation error? If you want to apply a second
-order-accurate boundary condition for ∂T /∂y = 0 at the boundary (refer
to Fig. 2.11), can you make use of the above mentioned expression? If
yes, what should be the expression for Ti,j at the boundary?
2.44 Computational Fluid Dynamics
Appendix
Thomas algorithm
We have already seen in Chapter2 that in Crank Nicolson solution procedure,
we get a system of algebric equations which assumes the form of a tridiagonal
matrix problem. Here we shall discuss a very well known solution procedure
known as Thomas algorithm(1949) which utilizes efficiently the advantage of
the tridiagonal form. A tridiagonal system is:
d1 a1 0 0 ... ... 0 x1 c1
b2 d2 a2 0 0 . x2 c2
0 b3 d3 a3 0 0 . x3 c3
0 0 b4 d4 a4 0 0 x4 = c4
. 0 0 . .
0 aN −1 . .
0 . . . . . . . . . 0 bN dN xN cN
The Thomas Algorithm is a modified Gaussian matrix-solver applied to a tridaig-
onal system. The idea is to transform the coefficient matrix into a upper trian-
gular form. The intermediate steps that solve for x1 , x2 ...xN :
Change di and ci arrays as
old
bi
dnew
i = d old
i − a i−1 , i = 2, 3 . . . N
di−1
and
dnew
1 = dold
1
Similarly
old
bi
cnew
i = cold
i − ci−1 , i = 2, 3 . . . N
di−1
and
cnew
1 = cold
1
Finite Difference Method 2.45
At this stage the matrix in upper triangular form. The solution is then obtained
by back substitution as
cN
xN =
dN
and
ck − ak xk+1
xk = , k = N − 1, N − 2, N − 3, . . . 1
dk
Please look at the new diagonal array and the RHS vector calculation:
do i = 2,n
r= bb (i)/ dd (i-1)
dd (i) = dd (i)- r *aa(i-1)
cc(i) = cc (i) - r *cc (i-1)
end do
The program will have only one array for the diagonal as dd(i) and only
one array for the RHS column vector as cc(i)