Week-2 Lecture Notes
Week-2 Lecture Notes
Week-2 Lecture Notes
Here we shall represent the spatial derivative by the central difference form
∂u un − uni−1
= i+1 (2.58)
∂x 2∆x
We shall replace the time derivative with a first-order difference , where u(t) is
represented by an average value between grid points (i + 1) and (i − 1), i.e
1 n
u(t) = (u + uni−1 )
2 i+1
Then
∂u un+1 − 21 (uni+1 + uni−1 )
= i (2.59)
∂t ∆t
Substituting Eqns. (2.58) and (2.59) into (2.57), we have
∂u ∂2u
=α 2 (2.63)
∂t ∂x
Applying FTCS discretization scheme depicts simple explicit representation
as
un+1
n
− uni ui+1 − 2uni + uni−1
i
=α (2.64)
∆t (∆x2 )
2.24 Computational Fluid Dynamics
or
un+1
i = r (uni+1 + uni−1 ) + (1 − 2r) uni , where r = α∆t/(∆x2 ) (2.65)
This is stable only if r ≤ 1/2.
Let us consider a case when r > 1/2. For r = 1 (which is greater than the
stability restriction), we get un+1
i = 1 · (100 + 100) + (1 − 2) · 0 = 200o C, (which
is impossible). The values of u are shown in Fig. 2.6.
0 0 0
100 C 0 C 100 C
n
i−1 i i+1
where N is the numerical solution obtained from computer, D the exact solution
of the FDE and ǫ error. Substituting Eq. (2.68) into Eq. (2.67) and using the
trignometric identities, we finally obtain
ǫn+1
i,j ea(t+∆t) eIkm (x+y)
n = = ea∆t = G
ǫi,j eat eIkm (x+y)
Finite Difference Method 2.25
where
where
ν∆t ν∆t u∆t v∆t
dx = 2, dy = 2, Cx = , Cy =
(∆x) (∆y) ∆x ∆y
The obvious stability condition |G| ≤ 1, finally leads to
1
dx + dy ≤ , Cx + Cy ≤ 1 (2.69)
2
when
1
dx = dy = d (for ∆x = ∆y), d≤
4
which means
ν∆t 1
2 ≤
(∆x) 4
This is twice as restrictive as the one-dimensional diffusive limitation (compare
with Eq. (2.54). Again for the special case (u = v and ∆x = ∆y)
1
Cx = Cy = C, hence C ≤
2
which is also twice as restrictive as one dimensional convective limitation (com-
pare with Eq. (2.62).
Finally, let us look at the stability requirements for the second-order wave
equation given by
∂2u ∂2u
2
= c2 2
∂t ∂x
We replace both the spatial and time derivatives with central difference scheme
(which is second-order accurate)
" #
un+1
i − 2uni + uin−1 n n n
2 ui+1 − 2ui + ui−1
2 =c 2 (2.70)
(∆t) (∆x)
Again assume
N =D+ǫ (2.71)
and
ǫni = eat eIkm x (2.72)
Substituting Eq. (2.72) and (2.71) in (2.70) and dividing both sides by eat eIkm x ,
we get
ea∆t − 2 + e−a∆t = C 2 eIkm ∆x + e−Ikm ∆x − 2
(2.73)
2.26 Computational Fluid Dynamics
where
c(∆t)
C, the Courant number = (2.74)
∆x
From Eq. (2.73), using trignometric identities, we get
km ∆x
ea∆t + e−a∆t = 2 − 4C 2 sin2 (2.75)
2
ǫn+1
G= i
= |ea∆t | (2.76)
ǫni
which is a quadratic equation for ea∆t . This equation, quite obviously, has two
roots, and the product of the roots is equal to +1. Thus, it follows that the
magnitude of one of the roots (value of ea∆t ) must exceed 1 unless both the
roots are equal to unity.
But ea∆t is the magnification factor. If its value exceeds 1, the error will grow
exponentially which will lead to an unstable situation. All these possibilities
mean that Eq (2.77) should possess complex roots in order that both have the
values of ea∆t equal to unity. This implies that the discriminant of Eq. (2.77)
should be negative.
2
km ∆x
1 − 2C 2 sin2 −1<0 (2.78)
2
or
1
C2 < (2.79)
sin2 km ∆x
2
which is always true if C < 1. Hence CFL condition (C < 1), must again be
satisfied for the stability of second-order hyperbolic equations.
In light of the above discussion, we can say that a finite-difference procedure
will be unstable if for that procedure, the solution becomes unbounded, i.e the
error grows exponentially as the calculation progresses in the marching direction.
In order to have a stable calculation, we pose different conditions based on
stability analysis. Here we have discussed the Von Neumann stability analysis
which is indeed a linear stability analysis.
However, situations may arise where the amplification factor is always less
than unity. These conditions are referred to as unconditionally stable. In a
similar way for some procedures, we may get an amplification factor which is
always greater than unity. Such methods are unconditionally unstable.
Finite Difference Method 2.27
Over and above, it should be realized that such stability analysis are not
really adequate for practical complex problems. In actual fluid flow problems,
the stability restrictions are applied locally. The mesh is scanned for the most
restrictive value of the stability limitations and the resulting minimum ∆t is used
throughout the mesh. For variable coefficients, the Von Neumann condition is
only necessary but not sufficient. As such, stability criterion of a procedure is not
defined by its universal applicability. For nonlinear problems we need numerical
experimentation in order to obtain stable solutions wherein the routine stability
analysis will provide the initial clues to practical stability. In other words, it
will give tutorial guidance only.
∂ζ ∂ζ ∂ 2ζ
+u =ν (2.80)
∂t ∂x ∂x2
Here, u is the velocity, ν is the coefficient of diffusivity and ζ is any property
which can be transported and diffused. If the viscous term (diffusive term) on
the right-hand side is neglected, the remaining equation may be viewed as a
simple analog of Euler’s equation.
∂ζ ∂ζ
+u =0 (2.81)
∂t ∂x
Now we shall see the behavior of Burger’s equations for different kinds of dis-
cretization methods. In particular, we shall study their influence on conservative
and transportive property, and artificial viscosity.
Over and above, it should be realized that such stability analysis are not
really adequate for practical complex problems. In actual fluid flow problems,
the stability restrictions are applied locally. The mesh is scanned for the most
restrictive value of the stability limitations and the resulting minimum ∆t is used
throughout the mesh. For variable coefficients, the Von Neumann condition is
only necessary but not sufficient. As such, stability criterion of a procedure is not
defined by its universal applicability. For nonlinear problems we need numerical
experimentation in order to obtain stable solutions wherein the routine stability
analysis will provide the initial clues to practical stability. In other words, it
will give tutorial guidance only.
∂ζ ∂ζ ∂ 2ζ
+u =ν (2.80)
∂t ∂x ∂x2
Here, u is the velocity, ν is the coefficient of diffusivity and ζ is any property
which can be transported and diffused. If the viscous term (diffusive term) on
the right-hand side is neglected, the remaining equation may be viewed as a
simple analog of Euler’s equation.
∂ζ ∂ζ
+u =0 (2.81)
∂t ∂x
Now we shall see the behavior of Burger’s equations for different kinds of dis-
cretization methods. In particular, we shall study their influence on conservative
and transportive property, and artificial viscosity.
∂ω
Z Z Z
dℜ = − (V · ∇)ωdℜ + ν∇2 ωdℜ (2.83)
ℜ ∂t ℜ ℜ
∂ω ∂
Z Z
dℜ = ω dℜ
ℜ ∂t ∂t ℜ
As because,
Z Z Z
ν (∇ω) · n dA = ν ∇ · (∇ω) dℜ = ν ∇2 ω dℜ
Ao ℜ ℜ
∂
Z Z Z
ω dℜ = − (V ω) · n dA + ν (∇ ω) · n dA (2.84)
∂t ℜ Ao Ao
∂ω ∂
= − (uω) (2.85)
∂t ∂x
" I I2
#
2
1 X n+1
X
n 1
(u ω)nI1 −1 + (u ω)nI1
ωi ∆x − ωi ∆x =
∆t 2
i=I1 i=I1
1
(u ω)nI2 + (u ω)nI2 +1
−
2
= (u ω)nI1 − 1 − (u ω)nI2 + 1 (2.88)
2 2
ωin+1 − ωin
n n
ωi+1 − ωi−1
= −uni (2.90)
∆t 2∆x
While performing the summation of the right-hand side of Eq. (2.91), it can
be observed that terms corresponding to inner cell fluxes do not cancel out.
2.30 Computational Fluid Dynamics
I1 I2
If all the terms in the flow equation are recast in the form of first- order deriva-
tives of x, y, z and t , the equations are said to be in strong“ conservative
form”. We shall write the strong conservation form of Navier-Stokes equation
in Cartesian coordinate system:
∂u ∂ 2 p ∂u ∂ ∂u ∂ ∂u
+ (u + − ν ) + (uv − ν ) + (uw − ν ) =0
∂t ∂x ρ ∂x ∂y ∂y ∂z ∂z
∂v ∂ ∂u ∂ 2 p ∂v ∂ ∂v
+ (uv − ν ) + (v + − ν ) + (vw − ν ) =0
∂t ∂x ∂x ∂y ρ ∂y ∂z ∂z
∂w ∂ ∂w ∂ ∂w ∂ p ∂w
+ (uw − ν )+ (wv − ν )+ (w2 + − ν ) = 0 (2.93)
∂t ∂x ∂x ∂y ∂y ∂z ρ ∂z
Finite Difference Method 2.31
∆x ∆x
u
u
i−2 i−1 i i+1 i+2
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