You are on page 1of 36

Lecture 6

AE 410 / CSE 461

Computational Aerodynamics
Instructor: Prof. Marco Panesi

1. 1
AE 410
Summary of the Previous Lecture

1. Linear Advection Equation

1. Solution of the Linear Advection Equation with Fourier Series

1. Method of Lines

1. Solution of the model equation using the characteristic variables

1. 2
AE 410
Advection Equation with Periodic Boundary Condition

The flow simulated is periodic. At a given time what enters on one side of
the domain must be the same as what leaves the opposite side.

u(x, 0) = u0 (x), x 2 [0, L]

The solution is

u(x, t) = u0 (x at)

1. 3
AE 410
Advection Equation (Solution)
The wave moves from left to right with speed a.

1. 4
AE 410
Fourier Series

By linearity I can sum over m:


1
X
u(x, t) = fˆm eikm (x at)

m= 1

It turns out that this is equivalent to a Fourier Series solution, where:

fˆm are the Fourier coefficients of

1
X 2⇡
u0 (x) = fˆm eikm x , km = m
1
L

1. 5
AE 410
The Matrix Operator Periodic Domains

Then the N eigenvalues are:

N
X1
m = bj exp [i(2⇡j(m 1)/N )], m = 1, . . . , N
j=0
p
Note that: i= 1
With the corresponding ~xm eigenvectors:
2 3
exp [i(2⇡(m 1)/N )]
6 7
6 exp [i(2⇡(m 1)/N ) · 2] 7
~xm =6
6 ..
7,
7 8m = 1, . . . , N
4 . 5
exp [i(2⇡(m 1)/N ) · N ]
1.
AE 410
Semi-discrete approach to PDEs

Recall early on our statement that we will consider a space-discretized


linear PDE as:

d~u
= A~u; ~u(0) = ~u0
dt

where A is some matrix related to the approximation of @x , @xx . We


need to develop (or recall) certain properties of the solution ~
u(t).
Unless stated otherwise we shall assume that A is a matrix at constant
coefficients.

1. 7
AE 410
Method of Lines

Suppose that A is a complete matrix (i.e., all the eigenvectors are linearly
independent). Then we can diagonalize A:

1
X AX = ⇤

where:

X = [~x1 , ~x2 , . . . ~xN ] Matrix of the right eigenvectors

⇤ = diag( 1, 2, · · · , N) Diagonal matrix of eigenvalues


2~ 3
`1
6 ~`2 7 ⇣ ⌘
1 6 7 ~`T A = ~ T
X = 6 . 7; m `
m m Matrix of the left eigenvectors
4 .. 5
~`N
1. 8
AE 410
Method of Lines

Since A is independent of time and so is X-1 :

dX 1 ~u 1
=⇤X ~u
dt
We call:

1
w
~ =X ~u Characteristic variables

The ODE becomes:

dw
~ 1
= ⇤w;
~ w(0)
~ =X ~u0 = w
~0
dt

1. 9
AE 410
Method of Lines
We are interested in the solution in terms of u(t) and we have to transform
back.

~u(t) = X w(t)
~ = Xe⇤ t w
~0
We found that the solution can be expressed in terms of eigenvalues and
eigenvectors:
Eigenvalue

N
X
mt
~u(t) = (w
~ 0 )m ~xm e
|{z}
m=1 Eigenvector

1. 10
AE 410
Example 1: 2nd Order Finite Difference

This example discusses the numerical solution of the linear advection


equation using 2nd order finite difference scheme.

@u? @u ?
+ a ?
=0 u? (x? , 0) = u0 (x? )
@t? @x ?

The star represents dimensional quantities. In order to re-write the


equation in dimensionless form we define the following characteristic
quantities:

x? u? ?
a
x = ?,u = ? t = t? ?
L U L

1. 11
AE 410
Example 1

The domain is assumed to be L-periodic

1 i-1 i i+1 Nx L

0 h 1

The non-dimensional form of the equation reads:

@u @u
+ =0 x 2 [0, 1), u(x + 1) = u(x)
@t @x
Use a second order central finite difference with 51 nodes (points).

1. 12
AE 410
Example 1

The analytical eigenvalues are:

N
X1
m = bj exp [i(2⇡j(m 1)/N )], m = 1, . . . , N
j=0

This is the matrix operator corresponding to the 2nd FD central scheme:


2 3
0 1 0 ··· 1
6 1 0 1 0 · · ·7
1 6
6 .. .. ..
7
7
M= 60 . . . · · ·7
2h 6 7
40 0 1 0 15
1 0 0 1 0

1. 13
AE 410
Example 1

You can prove that (see appendix B4 on circulant matrices):

In our case
✓ ◆
i 2⇡(m 1)
sin , m = 1, . . . N
h N
These are the analytical eigenvalues!

These eigenvalues are purely imaginary! A key result of this analysis is


that the imaginary eigenvalues of A result in a oscillatory behavior in time.
NO DECAYING SOLUTION! That type of solution can be obtained with
real eigenvalues and it is proper of diffusion type equations.

1. 14
AE 410
Computational Domain

1. 15
AE 410
The Matrix Operator

1. 16
AE 410
The Analytical Eigenvalues

1. 17
AE 410
Eigenvectors

1. 18
AE 410
Eigenvectors Part 2

1. 19
AE 410
Example 1

NOTE-- Eigenvalues:

1. All the eigenvalues are imaginary.

2. They have magnitude < 1/h

NOTE-- Eigenvectors:

1. Are the Fourier modes which FITS in the domain

1. 20
AE 410
Example 1

Example 1.1:

Let us study the time evolution of the pure advection of:

~u0 = Re{~x2 }

Example 1.2:

Let us study the time evolution of a localized pulse:


" #
1 2
x 2
~u0 = exp
0.12

1. 21
AE 410
Solution Example 1.1

The numerical wave speed is OFF!

1. 22
AE 410
Solution Example 1.2

The numerical approximation introduces dispersion.


1. 23
AE 410
The Modified Wave Number Analysis

The order of accuracy tells us how mesh refinement improves the


accuracy.

Example mesh refinement by factor two improves the accuracy of the


second order finite difference scheme by fourfold.

Another method which is more informative is the modified wave number


approach.

We ask: How well do FD schemes differentiate a certain class of functions,


namely sinusoidal functions.

An arbitrary periodic function can be expressed in terms of its Fourier


components, which are in the form of complex harmonics. It is therefore of
interest how well FD schemes approximate the derivative of these
harmonic functions as function of the WAVENUMBER!

1. 24
AE 410
The Modified Wave Number Analysis

Why this difference? We have already seen that:

@ ikm x ikm x
e = ikm e Continuous Problem
@x
M~xm = m~
xm Discrete Problem

2 i(
2⇡(m 1) 3 2 3
e )·1 ikm x1
N
e
6 ( i
2⇡(m 1)
)·2 7 6 eikm x2 7
6e N 7
~xm =6 7 = ... = 6
6 .
7
7 = e ikm ~
x
6 .. 7 4 .. 5
4 . 5
e i(
2⇡(m
N
1)
)·N eikm xN
1. 25
AE 410
The Modified Wave Number Analysis

The exact and the continuous solutions have the same eigenvectors! But

✓ ◆
i 2⇡
ikm 6 = sin m ; m = 0 . . . Nx 1
h Nx
Knowing that:

2⇡ 2⇡ L 2⇡
= = h
Nx L Nx L
The discrete eigenvalues do not match the continuous eigenvalues!

ikm h 6= i sin (km h); m = 0 . . . Nx 1

1. 26
AE 410
The Modified Wave Number Analysis
The discrete eigenvalues do not match the continuous eigenvalues!

ikm h 6= i sin (km h); m = 0 . . . Nx 1


In fact,
" #
3
(km h)
km h sin (km h) = km h km h + ...
3!
3
(km h)
= + O(h2 )
3!
m approximate the exact eigenvalues to O(h2 ), the same as the truncation
error.

1. 27
AE 410
The Modified Wave Number Analysis

1. 28
AE 410
The Modified Wave Number Analysis

1. The modified wave number is in good agreement with the


exact wave numbers for small values of k. For small values of
k the function is slowly varying and the FD scheme is
sufficiently accurate.

2. For high values of k the function varies rapidly in the domain


and the FD scheme is inaccurate. Higher order FD scheme can
do a better job, however, they are always more accurate at low
wave numbers.

1. 29
AE 410
Fourier Analysis

Let us now go back to the exact solution of the discrete problem:

d~u
= aM~u, ~u0 = u0 (~x)
dt

Nx
X
a mt
~u(t) = (w
~ 0 )m ~xm e
m=1
Nx
X
ikm ~
x a hi sin (km h)t
= (w
~ 0 )m e e
m=1

1. 30
AE 410
Fourier Analysis
Nx
X sin (km h)
ikm [~
x a t ]
= (w
~ 0 )m e km h

m=1 2 3
6 sin (km h) 7
6 7
ikm 6
6~x a t7
7
Nx 4 km h 5
X | {z }
= (w
~ 0 )m e a⇤

m=1
Nx
X
ikm [~
x a⇤ t]
= (w
~ 0 )m e
m=1

1. 31
AE 410
Numerical Phase Speed

a⇤ (km h) sin (km h)


= <1
a km h

The numerical speed is


the speed at which the
harmonic function
propagates.

Since a* is function of
the wavenumber the
numerical approximation
introduces dispersion.

1. 32
AE 410
The Modified Wave Number Analysis

Where ⇤ sin (km h)


a (km h) = a
km h

Is the numerical wave speed which depends on km h. The actual system


is dispersive, but original system was not.

• Different wavelengths travel at different speeds in discrete solution.


• So the pulse was split apart!

What about the energy?

d ⇤ d
(~u ~u) = ~ 0⇤ w
(w ~ 0) = 0
dt dt

NON-DISSIPATIVE
1. 33
AE 410
1. 34
AE 410
Numerical Solution of the ODE

1. 35
AE 410
What have we learned?

• Solution of the advection equation using the Method of


Lines

• Modified wave number analysis

• Dispersive system and numerical wave speed

1. 36
AE 410

You might also like