You are on page 1of 11

CHAPTER 5

NUMERICAL SOLUTIONS OF 2nd ORDER PDE’s


• Solution of Parabolic PDEs
• Richardson & DuFort-Frankel Explicit Methods
• BTCS Euler Implicit Method
• Crank-Nicolson Implicit Method
• Solution of Parabolic PDEs in 2D Space
• Solution of Elliptic PDEs
• Direct Solutions
• Iterative Solutions; Point Jacobi, Gauss-Seidel, SOR and SLOR Methods
• Solution of Hyperbolic PDEs
• FTBS FDE and Numerical Diffusion
• Lax-Wendroff Explicit Method
• Implicit Solution Methods
• Solution of Non-linear Convection Equation

İ.H. TUNCER & Y. ÖZYÖRÜK 118 AEE305-Numerical Methods in Aerospace Engineering

Solution of Parabolic PDEs - Explicit Methods


• We have already seen the forward time central space (FTCS) explicit FDE for the solution
of the diffusion equation when the PDE is discretized at time level n.
• When the central differencing is used for both time and space derivatives at time level n,
the resulting equation is of order ∆t 2 , ∆x 2 , and, it is known as Richardson method:
Tin+1 − Tin−1 T n − 2Tin + Ti−1 n
= α i+1 + O(∆t 2 , ∆x 2 )
2∆t ∆x 2
But it is unconditionally unstable, and therefore has no value.
• If the Tin term on the right hand side is replaced by the average value of Tin+1 and Tin−1 ,
the resulting FDE is known as DuFort-Frankel method
T n+1 +T n−1
Tin+1 − Tin−1 Tn − 2 i 2 i n
+ Ti−1
= α i+1 + O(∆t 2 , ∆x 2 )
2∆t ∆x 2

• It is still a second order accurate explicit method, and becomes conditionally stable.
• Since the solution needs values at n and n − 1 time levels, a one-step method is to be used
as a starter. In addition, the computer storage requirement is higher than FTCS FDE.
İ.H. TUNCER & Y. ÖZYÖRÜK 119 AEE305-Numerical Methods in Aerospace Engineering

Solution of Parabolic PDEs - BTCS Euler Implicit Method

• When the PDE is discretized at time level n + 1, it is defined as being implicit.


" #
n+1
Tin+1 − Tin Ti+1 − 2Tin+1 + Ti−1
n+1
= α + O(∆t, ∆x 2 )
∆t ∆x 2
α∆t
Tin+1 − Tin n+1
= d (Ti+1 − 2Tin+1 + Ti−1
n+1
) where d =
∆x 2
n+1
− dTi−1 + (2d + 1)Tin+1 − dTi+1
n+1
= Tin

• The BTCS FDE written at the grid points form a system of coupled linear equations.
They are to be solved using matrix algebra tools.
• Implicit methods are mostly unconditionally stable. Therefore a large step size in time is
permitted.
• However, the selection of a large timestep is limited due to accuracy consideration. A
large time step increases the truncation error.

İ.H. TUNCER & Y. ÖZYÖRÜK 120 AEE305-Numerical Methods in Aerospace Engineering


Solution of Parabolic PDEs - BTCS Euler Implicit Method

Consider the grid points at n + 1 time level starting from i = 1 to imax and the FDE written at
each point:

grid point i discrete equation comment


1 T1n+1 = TBCn+1
1
BC
2 −dT1n+1 + (2d + 1)T2n+1 − dT3n+1 = T2n FDE at i = 2
2 (2d + 1)T2n+1 − dT3n+1 n+1
= T2n + dTBC 1
FDE at i = 2
3 −dT2n+1 + (2d + 1)T3n+1 − dT4n+1 = T3n FDE at i = 3
4 −dT3n+1 + (2d + 1)T4n+1 − dT5n+1 = T4n ””
.. .. = ... ””
n+1 n+1 n+1 n
imax-1 −dTimax−2 + (2d + 1)Timax−1 − dTimax = Timax−1 ””
n+1 n+1 n n+1
imax-1 −dTimax−2 + (2d + 1)Timax−1 = Timax−1 + dTBC imax
””
n+1 n+1
imax Timax = TBCimax BC

İ.H. TUNCER & Y. ÖZYÖRÜK 121 AEE305-Numerical Methods in Aerospace Engineering

Solution of Parabolic PDEs - BTCS Euler Implicit Method

 1   T n+1   n+1
TBC


 1 
 
 

 T n+1   T2n
1

 −d 2d + 1 −d 
 2









 −d 2d + 1 −d  ..   .. 
  .

 
 .


 .. .. .. 
 . . .  =
    
 −d 2d + 1 −d  
 
 

  n+1 
 
 

−d 2d + 1 −d   
 
 Tn 

 Timax−1
 
 
 imax−1
n+1


1 n+1
Timax TBCimax

or
    
2d + 1 −d 
 T2n+1 
 
 T2n + dTBC n+1



 
 
 1 

 −d 2d + 1 −d  T3n+1   T3 n

 .. .. ..  ..
 
..

 . . .  =
  .   . 
 −d 2d + 1 −d  
 n+1 
 
 n
Timax−2 


 Timax−2 
 
 

−d 2d + 1  Timax−1
n+1   n
Timax−1 + dTBC n+1 
imax

The coefficient matrix has 3 non-zero diagonals, and is called a tridiagonal matrix .
İ.H. TUNCER & Y. ÖZYÖRÜK 122 AEE305-Numerical Methods in Aerospace Engineering

Thomas Algorithm
The tridiagonal system of equations are solved efficiently using the Thomas algorithm:
S u b r o u t i n e THOMAS ( imax , il , iu , a , b , c , f )
! S o l u t i o n o f a t r i d i a g o n a l s y s t e m e q u a t i o n s o f t h e form
! a ( i ) ∗ x ( i −1) + b ( i ) ∗ x ( i ) + c ( i ) ∗ x ( i +1) = f ( i ) for k = il , iu .
! The s o l u t i o n x ( i ) i s r e t u r n e d i n f ( i )
! a ( i l −1) and c ( i u +1) v a l u e s a r e n o t u s e d .
! a , b , c , f a r e t h e a r r a y s p r o v i d e d by t h e c a l l e r program
! ......................................................
r e a l , d i m e n s i o n ( imax ) : : a , b , c , f , x
x ( il ) = c ( il ) / b ( il )
f ( il ) = f ( il ) / b ( il )
ilp1 = il + 1
do i = ilp1 , iu
z = 1 . / ( b ( i ) − a ( i ) ∗ x ( i −1) )
x(i) = c(i) ∗ z
f ( i ) = ( f ( i ) − a ( i ) ∗ f ( i −1) ) ∗ z
enddo
iupil = iu + il
do ii = ilp1 , iu
i = iupil − ii
f ( i ) = f ( i ) − x ( i ) ∗ f ( i+1)
enddo
return
End
İ.H. TUNCER & Y. ÖZYÖRÜK 123 AEE305-Numerical Methods in Aerospace Engineering
Solution of Parabolic PDEs - Crank-Nicolson Implicit Method
The other well-known implicit method is Crank-Nicolson method.

• If the FDE is written at the pseudo (n + 12 ) time step, the time derivative becomes a
central difference approximation and the second order space derivative is replaced by the
average of central differences at time levels n and n + 1:
n+1 n+1 n+1
Tin+1 − Tin Tin+1 − Tin 1 Ti+1 − 2Ti + Ti−1 n
T n − 2Tin + Ti−1
∆t
≡ = α [ 2
+ i+1 2
]+O(∆t 2 , ∆x 2 )
2( 2 ) ∆t 2 ∆x ∆x

• The implicit method is unconditionally stable and second order accurate.


• The formulation results in a tridiagonal system of equations, which is similarly solved using
the Thomas algorithm.
1
Tin+1 − Tin = n+1
d[(Ti+1 − 2Tin+1 + Ti−1
n+1 n
) + (Ti+1 − 2Tin + Ti−1
n
)]
2
or
n+1
−d Ti+1 + 2(1 + d)Tin+1 − d Ti−1
n+1 n
= d (Ti+1 − 2Tin + Ti−1
n
) + 2Tin
İ.H. TUNCER & Y. ÖZYÖRÜK 124 AEE305-Numerical Methods in Aerospace Engineering

Solution of Parabolic PDEs - Crank-Nicolson Implicit Method

The system of equations are similarly obtained:

grid point i discrete equation comment


1 T1n+1 = TBCn+1
1
BC at left
2 aT1 + bT2 + cT3n+1
n+1 n+1
= RHSn2 gov. eq. - interior
3 aT2n+1 + bT3n+1 + cT4n+1 = RHSn3 ””
.. .. = ... ””
imax-1 b+1
aTimax−2 n+1
+ bTimax−1 n+1
+ cTimax = RHSnimax−1 ””
n+1 n+1
imax Timax = TBC imax
BC at right

İ.H. TUNCER & Y. ÖZYÖRÜK 125 AEE305-Numerical Methods in Aerospace Engineering

Solution of Parabolic PDEs - Crank-Nicolson Implicit Method


 1   T n+1   n+1
TBC


 1 
 
 

 T n+1   RHSn2
1

 a b c 
 2









 a b c  ..   .. 
  .

 
 .


 .. .. .. 
 . . .  =
  
 
 

 a b c    
  n+1 
 
 

a b c   
 
 RHSnimax−1 

 Timax−1
 
 
 n+1


1 n+1
Timax TBC imax

or     
b c 
 T2n+1 
 
 RHSn2 − aTBC n+1



 
 
 n 1 

 a b c  T3n+1   RHS3 
 .. .. ..  ..
 
..

 . . .  =
  .   . 
 a b c  n+1 
 
 RHSnimax−2 

 T
 n+1
imax−2 
 
 

a b  Timax−1   RHSnimax−1 − cTBCn+1 
imax

• The solution is similarly obtained by using the efficient Thomas algorithm.

İ.H. TUNCER & Y. ÖZYÖRÜK 126 AEE305-Numerical Methods in Aerospace Engineering


Solution of Parabolic PDEs in 2D Space - FTCS Explicit Method

• Consider the diffusion equation in 2D space,


T (t, x, y ):

∂T ∂2T ∂2T
= α[ 2 + ]
∂t ∂x ∂y 2

• A FTCS discretization at time level n leads to an


explicit FDE:

n+1 n n n n n n n
Ti,j − Ti,j Ti+1,j − 2Ti,j + Ti−1,j Ti,j+1 − 2Ti,j + Ti,j−1
= α[ 2
+ 2
]
∆t ∆x ∆y

1
• Stability analysis indicates that the FDE is stable for α∆t α∆t
∆x 2 + ∆y 2 ≡ dx + dy ≤ 2 which is
twice as restrictive as the 1D case, and it makes this explicit formulation an inefficient
procedure.
İ.H. TUNCER & Y. ÖZYÖRÜK 127 AEE305-Numerical Methods in Aerospace Engineering

Solution of Parabolic PDEs in 2D Space - BTCS Implicit Method


• The BTCS discretization, which is of O(∆t, ∆x 2 ), is given by:
n+1 n  n+1 n+1 n+1 n+1 n+1 n+1 
Ti,j − Ti,j Ti−1,j − 2Ti,j + Ti+1,j Ti,j−1 − 2Ti,j + Ti,j+1
=α +
∆t ∆x 2 ∆y 2

• Letting dx = α∆t/∆x 2 , dy = α∆t/∆y 2 , and rearranging the terms leads to


n+1 n+1 n+1 n+1 n+1 n
−dx Ti−1,j + (1 + 2dx + 2dy )Ti,j −dx c Ti+1,j −dy Ti,j−1 −dy Ti,j+1 = Ti,j

• Applying it to the grid points results in a linear system of equations.


• This is an implicit algorithm and unconditionally stable.
• If both the unknowns and the discrete equations are written in the order of
do j = 2, jmax-1
do i = 2, imax-1
discrete eq ...
enddo
enddo
İ.H. TUNCER & Y. ÖZYÖRÜK 128 AEE305-Numerical Methods in Aerospace Engineering

Solution of Parabolic PDEs in 2D Space


• The discrete FDE may be written in a general form
n+1 n+1 n+1 n+1 n+1 n
aTi−1,j + bTi,j + cTi+1,j + dTi,j−1 + eTi,j+1 = Ti,j

• For example, on a 6 × 5 grid (imax = 6, jmax = 5) with Dirichlet type BCs, the
following system of equations in a pentadiagonal matrix form is obtained:
 n n+1 n+1 
  n+1  T2,2 − aT1,2 − dT2,1 
b c e  T2,2  
 

   n n+1
T3,2 − dT3,1 
 a b c e  T3,2 
 
 

 






 n
T4,2 n+1
− dT4,1



 a b c e  T4,2   
  
 
 T n
− cT n+1
− n+1
dT5,1


 a b e  T5,2 
 
 5,2 6,2 

 d  
 
 n n+1 

 b c e  T2,3 
 
 T2,3 − aT1,3 

 d a b c e  T3,3
  n
T3,3

  =
 d a b c e  T4,3  
n
T4,3 
    
 d a b e  T5,3 
 
 T n
− n+1
cT6,3 

 







5,3 


 d b c  T2,4   n n+1
 T2,4 − aT1,4 − eT2,5
n+1 
  
  

 d a b c 
 T3,4 




 T n
− eT n+1 


 d a b c  
 T4,4 
 
 3,4 3,5 


 
 
 T n − eT n+1 

d a b T5,4 
 n 4,4 n+1 4,5 n+1 

T5,4 − cT6,4 − eT5,5

İ.H. TUNCER & Y. ÖZYÖRÜK 129 AEE305-Numerical Methods in Aerospace Engineering


Solution of Parabolic PDEs in 2D Space - ADI Method
• The solution of pentadiagonal matrix systems is not as efficient as the tridiagonal systems.
Alternating Direction Implicit (ADI) method overcomes the inefficiency of this implicit
formulation by splitting the FDE into two half-time steps , first one being implicit in
i−direction, and the second one in j−direction :
n+ 12 n n+ 1 n+ 12 n+ 1 n n n
Ti,j − Ti,j Ti+1,j2 − 2Ti,j + Ti−1,j2 Ti,j+1 − 2Ti,j + Ti,j−1
∆t
= α[ + ]
2
∆x 2 ∆y 2

and
n+1 n+ 21 n+ 1 n+ 12 n+ 1 n+1 n+1 n+1
Ti,j − Ti,j Ti+1,j2 − 2Ti,j + Ti−1,j2 Ti,j+1 − 2Ti,j + Ti,j−1
∆t
= α[ + ]
2
∆x 2 ∆y 2

• The first equation is implicit in the i-direction and explicit in the j-direction. It leads to a
tridiagonal system of equations.
• Solving the first system of equations for all the j-lines, which is called J-sweep , implicitly
provides the necessary data for the RHS of the second system of equations, which , in
turn, is solved for all the i-lines, which is called I-sweep .

İ.H. TUNCER & Y. ÖZYÖRÜK 130 AEE305-Numerical Methods in Aerospace Engineering

Solution of Parabolic PDEs in 2D Space - ADI Method


• J-sweep:
n+1/2 n+1/2 n+1/2 n
aTi−1,j + bTi,j + cTi+1,j = RHSi,j

• I-sweep:
n+1 n n n+1/2
dTi,j−1 + eTi,j + eTi,j+1 = RHSi,j

• To prevent the bias in the solution, the order of sweep is alternated from one time step to
the other:
do n = 1, nsteps
if( mod(n,2) == 1 )then
DO I-sweep
DO J-sweep
else
DO J-sweep
DO I-sweep
endif
İ.H. TUNCER & Y. ÖZYenddo
ÖRÜK 131 AEE305-Numerical Methods in Aerospace Engineering

Solution of Elliptic PDEs


• Note that elliptic PDEs usually govern equilibrium conditions. In fluid mechanics, the
velocity potential equation for incompressible, inviscid flows, is an example. It is
characterized by the Poissons’s (Laplace’s) equation:

uxx + uyy = f (ux , uy , u, x, y )

• The most common FDE is obtained by second-order


central difference approximations of the derivatives:
ui+1,j − 2ui,j + ui−1,j ui,j+1 − 2ui,j + ui,j−1
+ =0
∆x 2 ∆y 2

• Note that there there is no time index involved.


∆x
• The five-point formula is rewritten with β = ∆y

ui+1,j − 2ui,j + ui−1,j + β 2 (ui,j+1 − 2ui,j + ui,j−1 ) = 0


β ui,j−1 + ui−1,j − 2(1 + β 2 )ui,j + ui+1,j + β 2 ui,j+1
2
= 0
İ.H. TUNCER & Y. ÖZYÖRÜK 132 AEE305-Numerical Methods in Aerospace Engineering
Solution of Elliptic PDEs
• On a cartesian grid, the application of the above formulation produces
a penta-diagonal sparse coefficient matrix as shown earlier.
• Since the main diagonal has the largest value, the matrix is diagonally dominant.
• A fourth-order approximation, which involves 9 points may also be used:
−ui−2,j + 16ui−1,j − 30ui,j + 16ui+1,j − ui+2,j
+
12∆x 2
−ui,j−2 + 16ui,j−1 − 30ui,j + 16ui,j+1 − ui,j+2
=0
12∆y 2

• There are two methods of solution for the system of linear algebraic equations:
• Direct solution methods: Gauss elimination, Cramer’s rule, and such
• Iterative solution methods: An initial solution is guessed, the new values are approximately
computed. The precedure is repeated until a specified convergence criteria is reached.
• Iterative methods are either
• point iterative methods, where the formulation results in a single unknown, or
• line iterative methods, where the formulation involves more than one unknown.

İ.H. TUNCER & Y. ÖZYÖRÜK 133 AEE305-Numerical Methods in Aerospace Engineering

Solution of Elliptic PDEs - Point Jacobi Iteration Method


• An iteration count, k, is introduced and only the ui,j term in the five-point formula is kept
at the new iteration level k + 1 while others are kept at k :
k+1
β 2 ui,j−1
k k
+ ui−1,j − 2(1 + β 2 )ui,j k
+ ui+1,j + β 2 ui,j+1
k
=0

k+1 1
ui,j = [u k k
+ ui+1,j + β 2 (ui,j−1
k k
+ ui,j+1 )]
2(1 + β 2 ) i−1,j
where k corresponds to the previously computed values or the initial guess at the start of
the iteration process.
• Unknowns are solved one by one at each grid point similar to explicit methods in time
marching solutions of parabolic problems.
• An important difference is that the time dependent solution of parabolic equation is a
valid solution at any intermediate time level. On the other hand, the intermediate solution
of an elliptic equation has no significance, it is only a path to the converged solution.
• However, the point Jacobi method does not use the newly computed values of the
unknowns as they become available. It is therefore rarely/never used.

İ.H. TUNCER & Y. ÖZYÖRÜK 134 AEE305-Numerical Methods in Aerospace Engineering

Solution of Elliptic PDEs - Gauss-Seidel (GS) Iteration Method

• As opposed to Jacobi iteration method, in this method the values of the unknown
dependent variable at the current iteration level, k + 1, are used as soon as they become
available :
k+1 k+1 k+1
β 2 ui,j−1 + ui−1,j − 2(1 + β 2 )ui,j k
+ ui+1,j + β 2 ui,j+1
k
=0

• At each grid point, there is still just one unknown


value:

k+1 1
ui,j = [u k+1 +ui+1,j
k k+1
+β 2 (ui,j−1 k
+ui,j+1 )]
2(1 + β 2 ) i−1,j

• This approach increases the convergence rate


dramatically over the point Jacobi method.

İ.H. TUNCER & Y. ÖZYÖRÜK 135 AEE305-Numerical Methods in Aerospace Engineering


Solution of Elliptic PDEs - Successive Over-Relaxation (SOR) Method
• In an iterative solution as the unknowns approach their final, equilibrium values, the
amount of change in each step may be used to extrapolate the unknown variable at the
new iteration level to accelerate the convergence of the solution :
• Consider the Gauss-Seidel iteration method and define ∆u k+1 |GS by subtracting ui,j k
from
both sides :
k+1 1
ui,j k
|GS − ui,j ≡ ∆u k+1 |GS = [u k+1 + ui+1,j
k k+1
+ β 2 (ui,j−1 k
+ ui,j+1 k
)] − ui,j
2(1 + β 2 ) i−1,j

• To accelerate the convergence ∆u is multiplied by ω, the relaxation parameter


k+1 k
ui,j |SOR = ui,j + ω∆u|GS
ω
= k
(1 − ω)ui,j + [u k+1 + ui+1,j
k k+1
+ β 2 (ui,j−1 k
+ ui,j+1 )]
2(1 + β 2 ) i−1,j

• For a convergent solution 0 < ω < 2. The optimum value of the relaxation parameter is
usually determined by numerical experimentation.
• If 0 < ω < 1, it is called under-relaxation. In the solution of certain non-linear PDEs it
slows the convergence to prevent divergence.
İ.H. TUNCER & Y. ÖZYÖRÜK 136 AEE305-Numerical Methods in Aerospace Engineering

Solution of Elliptic PDEs - Line Gauss-Seidel (LGS) Iteration Method


In this iterative solution method, one more unknown variable
is expressed at the k + 1 iteration level:
k+1 k+1 k+1 k+1
β 2 ui,j−1 + ui−1,j − 2(1 + β 2 )ui,j + ui+1,j + β 2 ui,j+1
k
=0

or
k+1 k+1 k+1 k+1
ui−1,j − 2(1 + β 2 )ui,j + ui+1,j = −β 2 (ui,j+1
k
+ ui,j−1 )

• This equation is applied to all i’s at j = constant grid lines, and a system of linear
equations, which has a tridiagonal coefficient matrix, is obtained.
• This method converges faster than the Gauss-Seidel method, but requires more
computation per iteration, since a system of simultaneous equations is solved.
• Note that the influence of the BC at i = 1 and i = imax are reflected into the solution
immediately.
• For problems in which the solution variable changes more rapidly in one direction, it is
advantageous to use LGS in that direction.

İ.H. TUNCER & Y. ÖZYÖRÜK 137 AEE305-Numerical Methods in Aerospace Engineering

Solution of Elliptic PDEs - Successive Line Over-Relaxation (SLOR)


• The Line GS solution can be accelerated by introducung a relaxation parameter, ω, similar
to the one used in the SOR method:
k+1 k+1 k+1
k+1
−ui−1,j − ui+1,j − β 2 (ui,j+1
k
+ ui,j−1 )
ui,j |LGS = −
2(1 + β 2 )
k+1 k+1 k+1
k+1 k
−ui−1,j − ui+1,j − β 2 (ui,j+1
k
+ ui,j−1 ) k
∆u|LGS = ui,j |LGS − ui,j =− − ui,j
2(1 + β 2 )
k+1 k
ui,j |SLOR = ui,j + ω ∆u|LGS
" k+1 k+1 k+1
#
k
−ui−1,j − ui+1,j − β 2 (ui,j+1
k
+ ui,j−1 ) k
= ui,j + ω − − ui,j
2(1 + β 2 )

• The final form of the equation then becomes:


k+1 1 k+1 k+1 k+1 1
ui−1,j − [2(1 + β 2 )] ui,j + ui+1,j = −β 2 (ui,j+1
k
+ ui,j−1 ) + 2(1 − )(1 + β 2 )ui,j
k
ω ω
• ω is again determined by trial and error. Note that ω = 1 recovers LGS.
İ.H. TUNCER & Y. ÖZYÖRÜK 138 AEE305-Numerical Methods in Aerospace Engineering
Solution of Elliptic PDEs - Alternating Direction LGS Method

• Similar to the ADI used in the solution of parabolic


equations, the Laplace’s eqn. may also be solved by
alternating the direction of Line Gauss-Seidel solutions in
consecutive iteration levels:
k+1 k+1 k+1 k+1
ui−1,j − 2(1 + β 2 )ui,j + ui+1,j = −β 2 (ui,j−1 k
+ ui,j+1 )

and
k+2 k+2 k+2 k+2 k+1
β 2 ui,j−1 − 2(1 + β 2 )ui,j + β 2 ui,j+1 = −(ui−1,j + ui+1,j )

• The above alternating direction LGS solutions may


further be over-relaxed similar to the SLOR method.

İ.H. TUNCER & Y. ÖZYÖRÜK 139 AEE305-Numerical Methods in Aerospace Engineering

Solution of Hyperbolic PDEs

• The linear convection equation is an hyperbolic PDE :


∂w ∂w
+V =0
∂t ∂x

• In the solution of hyperbolic equations, the dependent variables have a domain of


influence and dependence.
• As shown earlier, the explicit FTCS FDE for the linear convection equation is
unconditionally unstable. However, the FTBS FDE

win+1 − win w n − wi−1


n
+V i = O(∆x, ∆t)
∆t ∆x
is conditionally stable for Courant number, σ ≡ V∆x
∆t
≤ 1, as indicated by the Fourier
stability analysis.
• If V < 0, then a forward differencing should be used for the spatial derivative.

İ.H. TUNCER & Y. ÖZYÖRÜK 140 AEE305-Numerical Methods in Aerospace Engineering

Solution of Hyperbolic PDEs - Dissipation Errors

• The consistency analysis of FTBS FDE for the linear convection equation leads to
∆t ∆x
wt + Vwx = − wtt + V wxx + O(∆t 2 , ∆x 2 )
2 2

∂2w 2
• Note that ∂w
∂t ≡ −V ∂w
∂x and ∂t 2 ≡ V 2 ∂∂xw2 :

V ∆x
wt + Vwx = (1 − σ)wxx + O(∆t 2 , ∆x 2 )
2

• The dominant error term appears as a diffusion term: V ∆x


2 (1 − σ)wxx .
• Recall that even space derivative terms are associated with diffusion/dissipation. Thus,
the FDE has an inherent numerical error which diffuses/dissipates the solution.
The gradients are reduced and the wave forms are smeared.

İ.H. TUNCER & Y. ÖZYÖRÜK 141 AEE305-Numerical Methods in Aerospace Engineering


Solution of Hyperbolic PDEs - Numerical Dissipation
• The coefficient V ∆x
2 (1 − σ)
Solution of wt + Vwx = 0 with FTBS, σ = 1.0 and σ = 0.5:
is known as the numerical nσ = 1, σ = 1.0 nσ = 8, σ = 1.0

diffusion coefficient or 1
FTBS
exact
1
FTBS
exact
artificial viscosity. 0.8 0.8

• Note that for σ = 1 the 0.6 0.6

numerical dissipation w

0.4
w

0.4

disappears.
0.2 0.2

• The dissipation error reduces


the amplitudes of waves. in 0
-6 -4 -2 0 2 4 6
0
-6 -4 -2 0 2 4 6

time and as the σ value is x x

reduced. 1
nσ = 4, σ = 0.5
1
nσ = 8, σ = 0.5

FTBS FTBS

• In order to increase the 0.9


0.8
exact 0.9
0.8
exact

accuracy, or reduce smearing 0.7 0.7


0.6 0.6
of sharp gradients, grid w
0.5 w
0.5

refinement is required. But, 0.4


0.3
0.4
0.3
smaller ∆x would require 0.2 0.2

smaller ∆t and it would lead 0.1


0
0.1
0
to an computationally -6 -4 -2
x
0 2 4 6 -6 -4 -2 0
x
2 4 6

expensive solution.
İ.H. TUNCER & Y. ÖZYÖRÜK 142 AEE305-Numerical Methods in Aerospace Engineering

Solution of Hyperbolic PDEs - Lax-Wendroff Explicit Method


• Consider the Taylor series expansion of the linear convection equation:
∂w ∆t 2 ∂ 2 w
win+1 = win + ∆t + + O(∆t 3 )
∂t 2! ∂t 2
Since wtt ≡ V 2 wxx ,
∂w ∆t 2 2 ∂ 2 w
win+1 = win + ∆t(−V )+ (V )
∂x 2 ∂x 2

• The FDE is obtained by using the second-order accurate central differencing for the spatial
derivatives:
n n
wi+1 − wi−1 1 w n − 2win + wi−1
n
win+1 = win − V ∆t( ) + V 2 ∆t 2 ( i+1 ) + O(∆t 3 , ∆x 2 )
2∆x 2 ∆x 2
The second-order accurate Lax-Wendroff method is then given by

1 1
win+1 = win − σ(wi+1
n n
− wi−1 ) + σ 2 (wi+1
n
− 2win + wi−1
n
)
2 2
İ.H. TUNCER & Y. ÖZYÖRÜK 143 AEE305-Numerical Methods in Aerospace Engineering

Solution of Hyperbolic PDEs - Lax-Wendroff Explicit Method


Solution of wt + Vwx = 0 using Lax-Wendroff algorithm:
nσ = 10, σ = 1.0 nσ = 20, σ = 1.0 nσ = 30, σ = 1.0
1.2 1.2 1.2
Lax-Wendroff Lax-Wendroff Lax-Wendroff
1 exact 1 exact 1 exact

0.8 0.8 0.8

0.6 0.6 0.6


w w w

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0

-0.2 -0.2 -0.2


-6 -4 -2 0 2 4 6 -6 -4 -2 0 2 4 6 -6 -4 -2 0 2 4 6
x x x

nσ = 10, σ = 0.5 nσ = 20, σ = 0.5 nσ = 30, σ = 0.5


1.2 1.2 1.2
Lax-Wendroff Lax-Wendroff Lax-Wendroff
1 exact 1 exact 1 exact

0.8 0.8 0.8

0.6 0.6 0.6


w w w

0.4 0.4 0.4

0.2 0.2 0.2

0 0 0

-0.2 -0.2 -0.2


-6 -4 -2 0 2 4 6 -6 -4 -2 0 2 4 6 -6 -4 -2 0 2 4 6
x x x

İ.H. TUNCER & Y. ÖZYÖRÜK 144 AEE305-Numerical Methods in Aerospace Engineering


Solution of Hyperbolic PDEs - Lax-Wendroff Explicit Method

• Lax-Wendroff method is stable for σ ≤ 1.


• As the accuracy of the FDE is improved in Lax-Wendroff method, another problem is
faced: The second-order methods has a leading error term with a third order derivative,
which is associated with oscillations.
• It can be shown that the truncation error involves a a third order derivative:
∆t 3 ∂ 3 w
− + ...
3! ∂t 3

• Third order error terms associated with second-order methods are known as dispersion
errors. They are indicated by wiggles (oscillations) in the solution

İ.H. TUNCER & Y. ÖZYÖRÜK 145 AEE305-Numerical Methods in Aerospace Engineering

Solution of Hyperbolic PDEs - Implicit Solutions


• The BTCS formulation
win+1 − win w n+1 − wi−1
n+1
+ V i+1 =0
∆t 2∆x
or
1 n+1 1
− σwi−1 + win+1 + σwi+1n+1
= win
2 2
produces a tridiagonal coefficient matrix, and unconditionally stable. It is of the order
O(∆t, ∆x 2 ).
• The Crank-Nicolson method, which is widely used, takes the form
n+1 n+1
win+1 − win 1 w − wi−1 w n − wi−1
n
+ V ( i+1 + i+1 )=0
∆t 2 2∆x 2∆x
It is of the order O(∆t 2 , ∆x 2 ), and similarly produces a tridiagonal coefficient matrix.
• Implicit methods similarly suffer from the dissipation and dispersion errors. Large
time-step sizes produce poor solutions. Therefore, the advantages of implicit methods
(which are unconditionally stable) are lost.
İ.H. TUNCER & Y. ÖZYÖRÜK 146 AEE305-Numerical Methods in Aerospace Engineering

Solution of Hyperbolic PDEs - Non-Linear Convection Equation


• The majority of the PDEs in engineering are nonlinear. The non-linear convection
equation may be interpreted as the propagation of a wave where each point on the wave
moves with a different velocity, which eventually leads to a discontinuity in the domain:
ut + uux = 0
• The numerical techniques developed for linear convection equation may, in general, be
applied to the nonlinear convection equation.
• The non-linear convection equation is expressed in conservative form for numerical
solutions:
u2 u2
ut + ( )x = 0 → ut + Ex = 0 where E =
2 2

• The FTBS explicit FDE developed for the linear convection eqn. may be used for the
solution of the non-linear eqn. provided that the sign of u is taken into account at each
grid point or the proper forward and backward differencing algorithm is employed.
• LAX METHOD: Another explicit method is derived from the unstable FTCS FDE:
uin+1 − uin E n + Ei−1
n
+ i+1 = O(∆t, ∆x 2 )
∆t 2∆x
İ.H. TUNCER & Y. ÖZYÖRÜK 147 AEE305-Numerical Methods in Aerospace Engineering
Solution of Hyperbolic PDEs - Non-Linear Convection Equation
• For stability uin is replaced by its average

1 n ∆t
uin+1 = n
(ui+1 + ui−1 )− (E n − Ei−1
n
)
2 2∆x i+1
1 n n ∆t
= (u + ui−1 )− [(u n )2 − (ui−1
n
)2 ]
2 i+1 4∆x i+1
u
which is similarly stable for ∆t∆xmax
≤ 1.
• In IMPLICIT methods, the FDE needs to be linearized by first factoring the non-linear
term and lagging the non-linear part in time. BTCS leads to

uin+1 − uin (u n+1 )2 − (ui−1


n+1 2
) u n u n+1 − ui−1
n n+1
ui−1
= − i+1 ≈ − i+1 i+1
∆t 2∆x 2∆x

• Again it produces a tridiaogonal matrix system. In order to reduce linearization errors, it


may be necessary to iterate at the same time level.
• The Crank-Nicolson method may similarly be employed.

İ.H. TUNCER & Y. ÖZYÖRÜK 148 AEE305-Numerical Methods in Aerospace Engineering

You might also like