Lecture 10

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Finite Difference Method 2.

37

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

This is modified central difference in space, which for a converged solution


(ζin+1 = ζin ) reduces to space centred scheme. Now, consider the diffusion
term
n+1
∂2ζ ζi+1 − 2ζin+1 + ζi−1
n+1
=
∂x2 (∆x)2
This is central difference in space. Substituting the above quotients in Eq. (2.80),
one finds
n+1
−Aζi+1 + Bζin+1 − Cζi−1
n+1
= Di (2.116)

where

ν∆t u∆t ν∆t u∆t ν∆t


A= , C= + , B =1+ +2
(∆x)2 ∆x (∆x)2 ∆x (∆x)2

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)

Higher order upwinding is an emerging area of research in Computational Fluid


Dynamics. However, so far no unique suggestion has been evolved as an opti-
mal method for a wide variety of problems. Interested readers are referred to
2.38 Computational Fluid Dynamics

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 = f i
∂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)

2.6 Some Non-Trivial Problems with Discretized


Equations
The discussion in this section is based upon some ideas indicated by Hirt (1968)
which are applied to model Burger’s equation as

ζ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

From this, the modified equation becomes[vide Art.2.5.4]

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

directly as ζin+1 = ζi−1


n
which is unacceptable. From Eq. (2.122) it is clear that
in order to obtain a solution for convection diffusion equation, we should have

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

4. Fletcher, C.A.J., Computational Techniques for Fluid Dynamics, Vol. 1


(Fundamentals and General Techniques), Springer Verlag, 1988.

5. Gentry, R.A., Martin, R.E. and Daly, B.J., An Eulerian Differencing


Method for Unsteady Compressible Flow Problems, J. Comput. Phys.,
Vol. 1, pp. 87-118, 1966.

6. Hirt, C.W., Heuristic Stability Theory of Finite Difference Equation, J.


Comput. Phys., Vol. 2, pp. 339-355, 1968.

7. Kawamura, T., Takami, H. and Kuwahara, K., Computation of High


Reynolds Number Flow around a Circular Cylinder with Surface Rough-
ness, Fluid Dynamics Research, Vol. 1, pp. 145-162, 1986.

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.

9. Lax, P.D. and Wendroff, B. Systems of Conservation Laws, Pure Appl.


Math, Vol. 13, pp. 217-237, 1960.

10. Leonard, B.P., A Stable and Accurate Convective Modelling Procedure


based on Quadratic Upstream Interpolation, Comp. Methods Appl. Mech.
Engr., Vol. 19, pp. 59-98, 1979.

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.
2.44 Computational Fluid Dynamics

Use upwind differencing on a weak conservative form of the equation.


The upwind differencing is known to retain the transportive property.
Show that the formulation preserves the conservative property of the con-
tinuum as well [you are allowed to exclude the diffusive term from the
analysis].

7. In order to investigate and analyze the properties of numerical schemes,


often the following scalar (one-dimensional) convection equation is con-
sidered:
∂ω ∂ω
+λ =0
∂t ∂x
Here ω is any scalar parameter. The spatial derivative is approximated by
a central difference scheme on an equidistant grid with ∆x = Constant.
Please explain the following time-marching schemes based on the scalar
transport equation:

A: explicit Euler scheme


B: implicit Euler scheme
C: three-point backward scheme (implicit)
D: Lax-Keller scheme (explicit)
E: Lax-Wendroff scheme (explicit)
F: Mac Cormack scheme (predictor-corrector, explicit)
G: Low-storage Runge-Kutta scheme (3 sub-steps, explicit)

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 b d a 0 0
4 4 4   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 :
Finite Difference Method 2.45

Change di and ci arrays as


 old
bi
dnew
i = dold
i − ai−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

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 refer to the Pseudo codes below. Pseudo code-1 is meant for the new
diagonal array and the new RHS vector calculations.

Pseudo Code-1:
do i = 2, n
r = b(i)/d(i − 1)
d(i) = d(i) − r ∗ a(i − 1)
c(i) = c(i) − r ∗ c(i − 1)
end do
Pseudo Code-2 is meant for the Back Substitution:
x(n) = c(n)/d(n)
do i = 2, n
j =n−i+1
x(j) = c(j) − a(j) ∗ c(j + 1)/d(j)
end do

You might also like