CFD Lecture 4
CFD Lecture 4
Polar
Cartesian
Figure 4-9. Amplification factor G=1-2d(1-cos ),
illustrated for various values of d.
• Note that in Figure 4-9a, when d = 0.625, some values of G have
fallen outside the circle of radius 1; and in Figure 4-9b, it has
exceeded the stability limit, indicating an unstable solution for this
value of d.
• Consider a 1-D equation with both convection and diffusion terms,
i.e., u u 2u
= −a +
t x x 2
• The FTCS explicit formulation is expressed as
uin +1 − uin uin+1 − uin−1 uin+1 − 2uin + uin−1
= −a +
t 2x (x ) 2
n +1 c n
ui = u − (ui +1 − uin−1 ) + d (uin+1 − 2uin + uin−1 )
n
i
2
• Following the von Neumann stability analysis,
• Eliminating eIi,
• Note that, for this particular problem, the amplification factor has
real and imaginary parts.
• A stable solution requires that the modulus of the amplification
factor must be bounded.
• Thus, a formal requirement may be expressed as
• Before mathematical arguments are considered, a
graphical presentation is studied.
Real
• The two most extreme cases are 1- 2d = 0 or d = 0.5, or c = 1
• Thus, it appears that the stability requirements are d ≤ 0.5 and c ≤ 1.
• However, a more restrictive condition is found by considering the formal
requirement that the modulus of must be bounded, i.e., |G|2 ≤ 1.
d = 0.5 c=1
• This quadratic equation represents either a convex
curve (with a minimum) or a concave curve (with a
maximum)
• It can be shown that for a stable solution, this quadratic function may
not have a global maximum, i.e., the curve cannot be concave.
• The mathematical procedure is as follows.
• The first and second derivatives of the function IGI2 with respect to cos
are
Graphical Representation of G
Graphical G
• Graphical representation
of the amplification
factor for various values
of c and d is illustrated in
Figures 4-14a and 4-14b.
Example from Chapter 3
• Consider a fluid bounded by two parallel plates extended
to infinity such that no end effects are encountered.
• The planar walls and the fluid are initially at rest.
• Now, the lower wall is suddenly accelerated in the x-
direction.
• The spacing between two plates is denoted by h.
• The Navier-Stokes equations for this problem may be
expressed as
• u 2
u
= 2 Parabolic equation
t y
• Dissipation error:
– It is the error associated with first-order accurate methods
– Associated with even derivatives
• Dispersion error:
– It is the type of errors associated with
second order accurate methods
- Associated with odd derivatives
Stability Analysis: Error Analysis
• For the model equation
b = 0 - - - > FTCS
b =1 - - - > BTCS
b =1 / 2 - - - > Crank - Nicolson
U n+1
G £1 where G = n
U
Parabolic PDEs: Stability Analysis
• FTCS: G =1+ 2D (Cos(q )-1) 0 £ D £1
Polar Cartesian
• BTCS: 1
G=
1+ 2D (1- Cos(q ))
Parabolic PDEs: Modified Equation
• By substituting back with Taylor series expansion of each
term into the finite difference equation, the modified
Modified Equation
equation is obtained.
29
un+1
j = u n
j + D(u n
j+1 - 2u n
j + u n
j-1 )
Dividingby thefollowingequation isobtained
u t 2
u t2 3
u t3 4
u 4
O t
t 2 t2 3! t3 4! t4
Modified
2
u y Equation
u
O y
2 4
4
y2 12 y4
30
• equationof
Themodified Truncation
Thisequation Error =SFDE-PDE
can bewritten
theFTC as
-Explicit =
schemeis
Is the scheme consistent?
2 2 2 4
u u 2 t u y u 2 4
y O t , y
ut t uyy y2 2 tt2 uyyyy 12O t y24, y 4
2 6
Using thegoverningequation (theparabolicpartial differential equation)
Parabolic PDEs: Explicit Methods
• FTCS method:
1. Explicit step
2. Implicit step
Parabolic PDEs: Schemes Comparison
Error at Time = 0.18 sec. Error at Time = 1.08 sec.
• Arrange as
• This equation is known as the modified equation.
• When compared to the original PDE, the error introduced in the approximation
process is clearly indicated.
• Note that the dominating term in the error is the second term on the right-
hand side of Equation (4-84), which includes the second derivative.
• Consider a second-order method in which the
dominant error term includes a third-order (odd)
derivative.
• Such a formulation is the midpoint leapfrog method
given by ( 4-53).
• The equation may be rearranged as
Artificial Viscosity
• Recall the modified Equation (4-84)
Applications
Dispersion Error
Finite Difference: Elliptic Equations
Solution Technique
• Elliptic equations in engineering are typically used to characterize steady-state,
boundary value problems.
• For numerical solution of elliptic PDEs, the PDE is transformed into an algebraic
difference equation.
x = y Laplacian difference
Ti +1, j + Ti −1, j + Ti , j +1 + Ti , j −1 − 4Ti , j = 0 equation.
Holds for all interior points
• In addition, boundary conditions along the edges must be
specified to obtain a unique solution.
• The simplest case is where the temperature at the boundary is
set at a fixed value, Dirichlet boundary condition.
• A balance for node (1,1) is:
2T T
k 2 =
x t
• Just as elliptic PDEs, parabolic equations can be solved
by substituting finite divided differences for the partial
derivatives.
• In contrast to elliptic PDEs, we must now consider
changes in time as well as in space.
• Parabolic PDEs are temporally open-ended and involve
new issues such as stability.
Explicit Methods
• The heat conduction equation requires approximations for the second
derivative in space and the first derivative in time:
2T Ti +l 1 − 2Ti l + Ti −l 1
=
x 2
x 2
l +1
T Ti − Ti l
=
t t
Ti +l 1 − 2Ti l + Ti −l 1 Ti l +1 − Ti l
k =
(x ) 2
t
kt
Ti l +1 l
(
= Ti + T − 2Ti + T
l l l
) =
i +1 i −1
(x )2
• This equation can be written for all interior nodes on
the rod.
• It provides an explicit means to compute values at
each node for a future time based on the present
values at the node and its neighbors.
A simple Implicit Method
• Implicit methods overcome difficulties associated with
explicit methods at the expense of somewhat more
complicated algorithms.
• In implicit methods, the spatial derivative is
approximated at an advanced time interval l+1:
( )
T0l +1 = f 0 t l +1
(1 + 2 )T1l +1 − T2l +1 = T1l + f 0 (t l +1 )
i=m
(1 + 2 )Tml +1 − Tml +−11 = Tml + f m +1 (t l +1 )
Resulting m unknowns and m linear algebraic equations
Assignment # 3
• Chapter 2
• Computational Fluid Dynamics by Klaus Hoffmann
• Problems:
• 2.1, 2.2 (parts: a, b), 2.3, 2.6, 2.7 and 2.8
Assignment # 2
• Page 25-28
• Problems: