mtmw14 4
mtmw14 4
Week 5: Synthesis
5.1 Revision
5.2 Test
Key idea
Move the grid with the flow so that there
is no longer any advection term and
hence advective CFL instability can be
avoided ( so larger time steps can be
used).
Frames of reference
1-dimensional example
Good points and bad points of the
method
i
x
D
u F
Dt t x
f i dt dx
x (t )
t x
F u dt dx
x (t )
x x
Eulerian: dx-udt=-udt
Lagrangian: dx-udt=0
(c) 2006 d.b.stephenson@reading.ac.uk 5
4.1 Eulerian and Lagrangian schemes
t f
Eulerian
grid points
don t move
i
x
t f
Lagrangian
grid points
advect from a
regular grid
i
x
t f
Semi
-Lagrangian
grid points
advect onto
a regular grid i
(c) 2006 d.b.stephenson@reading.ac.uk
x 6
4.1 Semi-Lagrangian
n 1 n
x i xi Fdt
x (t )
Steps:
Back trajectory calculation to find out
where grid point was on previous time
step e.g. ~ n n n 1
xi xi ui h
Find the field at this location by
interpolating the field from neighbouring
grid points (e.g. cubic interpolation)
Example:
Ritchie et al. 1995 ECMWF
h=3mins (Eulerian) 15 mins (Semi-Lagr)
SL takes 20% more CPU per step so net speed up
is factor of 4.
(c) 2006 d.b.stephenson@reading.ac.uk 8
4.1 Summary of main points
Once gravity waves have been slowed
down using semi-implicit schemes, the
maximum time step is determined by
advective CFL
Key idea
use a finite set of spatial basis functions
to represent the spatial variation (rather
than a finite set of grid point variables).
http://www.cs.ut.ee/~toomas_l/linalg/dv/node1.html
(c) 2006 d.b.stephenson@reading.ac.uk 11
4.2 Finite volume schemes
Advection term can be written in different ways:
u. uij i 1, j i 1, j vij i, j 1 i, j 1
.(u ) ui 1, j i 1, j ui 1, j i 1, j vi , j 1 i, j 1 vi , j 1 i, j 1
k. (u k) ???
t
Equivalent weak form integral formulation:
w d w .( )d
t
w. d
N
t i t i
i 1
Where
Ai the i are the basis functions at
node i.
N
i (x) 1
i 1
1
1
0
0
1
0
Nodes 25,000
Elements
(c) 2006 d.b.stephenson@reading.ac.uk
65,000 17
4.2 Pros and cons of FE schemes
Advantages of finite element schemes:
can conform very accurately to the basin
geometry;
various natural boundary conditions can be
included in a very straightforward manner;
formulation based on rigorous mathematical
foundations, allowing statements about errors,
convergence to be made.
i ( kx ly )
e
ik
x
Perfectly accurate derivatives
Note: ik not 2isin(kd)
Very simple Laplacian terms
Nice smooth solutions (continuous
differentiable)
(c) 2006 d.b.stephenson@reading.ac.uk 19
4.2 1-d example
2
u 2
0
t x x
N
i 2 kx / N
( x, t ) k (t )e
k 1
N 2
d k 2 j 2 k
uk j j k 0
dt j 1 N N
PDE converted into a set of N ODEs
one for each Fourier mode amplitude
Diffusion term is very simple just a
wavenumber dependent damping for
each Fourier mode
Advection term consists of non-linear triad
interaction between mode amplitudes
Method takes O(N2) CPU operations
rather than O(N) for finite difference so
becomes prohibitive for large N!
(c) 2006 d.b.stephenson@reading.ac.uk 20
4.2 The transform method
Fast Fourier Transform (FFT) algorithm
O(NlogN) rather than O(N2) operations
Carl Friedrich Gauss, "Nachlass: Theoria interpolationis methodo
nova tractata," Werke band 3, 265 327 (Königliche Gesellschaft der
Wissenschaften, Göttingen, 1866). See also M. T. Heideman, D. H.
Johnson, and C. S. Burrus, "Gauss and the history of the fast Fourier
transform," IEEE ASSP Magazine 1 (4), 14 21 (1984).
James W. Cooley and John W. Tukey, "An algorithm for the machine
calculation of complex Fourier series," Math. Comput. 19, 297 301
(1965).
m
( x, sin , t ) mn (t )Y ( x, sin )
n
n m
2(n m)! 2 n n! dy n m
0 1
P 0
2
3 3(1 y 2 )
P10 y P11
2 4
5 15 15
P20 (3 y 2 1) P21 y 1 y2 P22 1 y2
8 4 16
2 1
1 m '* m 1 m' m n' n
Y Y dydx
n' n
4 0 1
0 otherwise
2 m n(n 1) m
Y n 2
Yn
a
m
Two types of truncation:
Triangular e.g. T42
Rhomboidal e.g. R15