Introduction to numerical fluid dynamics for geophysical flows - PowerPoint PPT Presentation

1 / 39
About This Presentation
Title:

Introduction to numerical fluid dynamics for geophysical flows

Description:

Leap Frog. Can we do even better? Choose and such that m is maximal. Solution m=2, for Leap-Frog scheme... Numerical diffusion and - dispersion. Example: ... – PowerPoint PPT presentation

Number of Views:173
Avg rating:3.0/5.0
Slides: 40
Provided by: ima48
Category:

less

Transcript and Presenter's Notes

Title: Introduction to numerical fluid dynamics for geophysical flows


1
Introduction to numerical fluid dynamics for
geophysical flows
  • Peter Jan van Leeuwen
  • IMAU

2
(No Transcript)
3
The basics discretization
Write xj j ?x and tn n ?t
Time
n1
n
n-1

j
j1
j3
j-1
j-2
space
4
Discretization of derivatives
Euler
How good is this?
Use Tayor-series expansion
To find
5
So, the discretization error is of order ?t
Can we make this any better?
Yes! Consider
Leap Frog
An error of only ?t2 !
6
Can we do even better?
Choose ????? and ? such that m is maximal.
Solution m2, for Leap-Frog scheme
7
Numerical diffusion and - dispersion
Example
From Taylor
and
Leading to
8
Use
and a similar equation for the 3rd derivatives,
to find
numerical diffusion
numerical dispersion
, the Courant number
in which
The computer puts the right-hand side to zero
(upwind scheme). So, in fact, it solves the
left-hand side 0
9
Stability
When we solve a physical ocean model
numerically, the numerical scheme used is applied
every time step. When the time step is chosen
too large the solution may blow up, i.e. become
very irregular and starts to produce Infinitely
large values for the model variables. Sometimes
the solution blows up with a very small time
step, and making the time step even smaller
doesnt help. We say that the numerical scheme
is unstable with that time step.
10
Wave equation
power
The numerical solution can be written as
index
in which
and ? is the amplification factor.
The numerical scheme is stable when
11
Representation of waves
x
x
x
x
x
x
x
x
x
x
x
Long wave is well represented
Short wave is represented very badly
Shortest wave length that can be represented is
2??x
12
A simple example
Discretize as
Plug in expression for unj to find
or
For a stable scheme ??has to be smaller than 1
for all ??
Use
to find
Hence this scheme will always blow up!!!
13
Leap-frog scheme
Discretize
Leading to
or
Two numerical solutions, dont excite the
negative root !!!
For the positive root
when
or
14
Courant-Friedrichs-Lewy (CFL) criterion
A limit on the time step, can we understand that?
15
Diffusion equation
Discretize
Find
or
in which
or
Stable when
16
Leap-frog for diffusion
Discretize
Leading to
or
hence
Always unstable !!!
17
Implicit schemes
Can the limitations on the time step be avoided?
Yes! Discretize the diffusion equation as
Leading to
This scheme is stable independent of ? when
18
So the time step can be as large as possible. Why
cant one take one 100 year time step with a
climate model?
Indeed, accuracy, ?t can never be too large
Moreover, have a good look at the numerical
scheme
One equation with 3 unknowns Hence the
equations for all grid points have to be
combined one has to solve a system of coupled
(nonlinear) equations at each time step.
19
Staggered grids
Shallow water non rotating
Assume wave solution (as always)
Gives dispersion relation
and phase velocity
20
A numerical equivalent
Just concentrate on discretization in space
Plug in ( yes)
Gives dispersion relation
So
and
Shortest waves c 0 and cg -cg !!!
21
Leap-frog scheme
u,h
u,h
u,h
u,h
u,h
tn-1
Two grids that do not communicate
22
Staggered grid
h
u
h
u
h
tn1
h
u
h
u
h
tn
h
u
h
u,
h
tn-1
  • No 2-grid interval waves
  • Same truncation error
  • Factor 2 faster !

23
Now in 2 dimensions
Shallow-water equations
Plug in
Dispersion relation
24
Ordinary discretization
Again, for the shortest waves, the numerical
phase velocity is too small, and the group
velocity has the wrong sign.
EFASSITR
25
Some staggered grids
26
The Arakawa B-grid
Interpolation needed for pressure gradients and
horizontal mass divergences.
27
The Arakawa C-grid
Interpolation needed for Coriolis force
28
Which grid should one choose?
Dispersion relation
in which
Rewrite
so that
Large ? gives gravity waves, small ? gives
inertial oscillations.
Look at the B and C grid.
29
d0.1
d1
d10
30
The time scale problem
Shallow-water equations
Plug in plane wave solution to find
geostrophic
Inertial-gravity waves
31
The CFL criterion
Time scale geostrophic motions weeks to months
to
Time scale inertial-gravity waves (tides) few
hours
Suppose ?x 10 km
Phase velocity baroclinic Rossby waves 0.05 m/s.
From CFL the time step has to be
2.5 days
Phase velocity of tides is 200 m/s.
From CFL the time step has to be
50 s
32
Possible solutions
  • Filter out fast gravity waves, e.g.
    quasi-geostrophic models
  • Rigid-lid approximation (not used

  • anymore)
  • Use mode splitting
  • Make code fully implicit
  • Make code semi implicit

33
Semi-implicit codes
34
From the implicit momentum equations one finds
Use this in the continuity equation
This leads to an elliptic equation for hn1 .
The new velocities can be found from the the
implicit momentum equations
35
An example to increase accuracy
Start from the modified equation for the upwind
scheme
numerical diffusion
numerical dispersion
Now discretize the numerical diffusion error and
put it into the numerical scheme
n
upwind
negative diffusion
Lax-Wendroff
36
We increased the accuracy by putting a
discretization of minus the numerical diffusion
in the scheme.
So, we have put in anti diffusion in the
numerical scheme.
However, at large gradients the anti diffusion
can be too large, giving rise to ripples.
To avoid this, we first do a predictor step,
followed by a corrector step.
37
Predictor
(With ? 0 we get Lax-Wendroff back)
Corrector
with
In this way the anti-diffusive fluxes are limited.
Flux-Corrected Transport (FCT)
38
Summary what we did
  • Discretization
  • Numerical diffusion and dispersion from
    truncation of Taylor-series expansions
  • Stability, CFL, implicit schemes
  • Staggered grids
  • Time-scale problem

39
and what should be covered also
  • More accurate schemes
  • Conservative schemes
  • Boundary conditions
  • Open boundaries
  • Mixed-layer models
  • Parameterizations of sub-grid-scale processes
  • Coupling to atmosphere and biosphere
  • Sea ice
  • .
Write a Comment
User Comments (0)
About PowerShow.com