• Keine Ergebnisse gefunden

Numerical Modeling of Weather and Climate

N/A
N/A
Protected

Academic year: 2021

Aktie "Numerical Modeling of Weather and Climate"

Copied!
14
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Numerical Modeling of Weather and Climate

Christoph Schär, Institute for Atmospheric and Climate Science, ETH Zürich

Lecture Notes Chapter 2:

Repetition of finite differencing

March 2007

Elementary Schemes...

Leapfrog scheme, centered time stepping ...

Upstream scheme, Forward/Euler time stepping...

Stability ...

Courant-Friedrichs-Levy stability criteria...

Von-Neumann Analysis: phase- and amplitude errors ...

Numerical dispersion ...

Classification of time stepping schemes ...

Nonlinear instability...

Consistence and convergence ...

Order of a scheme ...

Higher-order schemes ...

convergence, Lax-Richtmeyer theorem ...

Conservative schemes ...

Further information:

Schär, C, 2006: Skript der Vorlesung "Numerische Methoden in der Umweltphysik".

Verfügbar via Internet unter http://www.iac.ethz.ch/staff/schaer/

Durran, D. R., 1998: Numerical methods for wave equations in geophysical fluid dynamics.

Text in Applied Mathematics, 32, Springer

(2)

Derivative with finite differencing

Discretization in space

!

x

i

= i " x

#

i

= # ( x

i

)

Spatial derivative using finite differences

!

x

i

x x

i-1

analytical

"x

"!

numerical

#

$ !

$ x

x

i

:= !

i

% !

i%1

" x

#

$ !

$ x

x

i

: =

"x&0

lim !

i

% " x !

i%1

(3)

Leapfrog Scheme

One-dimensional linear advection (or transport) equation

!

"#

"t + u "#

"x = 0

(u=const) Discretization in space and time

!

x

i

= i "x, t

n

= n"t

#

in

= # (x

i

,t

n

)

Centered differences in space and time

!

"#

" t

$

% & ' ( )

i n

* #

in+1

– #

in–1

2 +t

!

"#

" x

$

% &

' ( )

i n

* #

i+1n

+ #

in+1

2 ,x

Solving for !

in+1

yields the Leapfrog scheme

!

"

in+1

= "

in–1

– # " (

in+1

$ "

in–1

) with # = u %x %t = Courant number This is a three-level time-stepping scheme:

n n+1 t

n-1

(4)

Upstream Scheme

Forward discretization in time (Euler or forward time stepping)

!

"#

" t

$

% & ' ( )

i n

* #

in+1

– #

in

+t

Upstream discretization in space

!

"#

" x

$

% & ' ( )

i n

* #

in

+ #

i+1n

, x (for u - 0).

Solving for !

in+1

yields the Upstream scheme

!

"

in+1

= "

in

– # " (

in

$ "

in–1

) with # = u %x %t

where α is the Courant number.

This is a two-level time-stepping scheme.

(5)

Courant-Friedrichs-Levy stability criterion

Stability criterion for a large class of schemes:

!

u "t

"x # 1

For the advection equation: u refers to the advection velocity

=> Interpretation: the physical domain of dependence of !

jn+1

must be included in the numerical domain of dependence.

=> For a large class of schemes, this is a necessary but not sufficient stability criterion!

In the general case, u is the largest speed at which information may propagate in the system under consideration (propagation speed).

Information can propagate by advective processes (with velocity v), or by wave propagation (with group velocity c

g

).

Thus, in the general case u represents:

!

u = max v + c

g

(6)

Von Neumann analysis

Ansatz: wave-like perturbation of the form

!

" ( x, t) = e

i(k x#$t)

For linear advection we have

!

" = uk .

Conversion to computational grid

!

( x, t) = ( j"x, n"t)

!

"

nj

= e

i k(j#x$u n#t)

= e

i k j#x

(e

$i k u#t

) 1 2 4 3

%

4

n

= e

i k j#x

%

n

The complex number λ = λ (k) determines time evolution.

Plug Ansatz into numerical scheme to derive λ = λ (k).

Then, λ determines stability of scheme:

• | λ (k)| > 1 for one wave number k: unstable

• | λ (k)| = 1 for all wave numbers k: stable, neutral

• | λ (k)| < 1 for all wave numbers k: stable

In addition, λ (k) contains detailed information about the amplitude and

phase error of a scheme, as a function of wave number k.

(7)

Amplitude and phase errors

Example: Upstream scheme

0.1 0.2 0.3 0.4 0.5

0.2 0.4 0.6 0.8 1 1.2

1.4

u

num

/ u

wavelength in !x

10 5 3.3 2.5 2

!

wavelength–1 in !x–1

" = 0.5

" = 0.75

" = 1

" = 0.25

0.1 0.2 0.3 0.4 0.5

0.5 1 1.5 2

" = 1

" = 1.25

" = 1.5

" = 0.25

" = 0.5 " = 0.75

|#|

(8)

Numerical dispersion

Example: Leapfrog scheme

wavelength in !x

10 5 3.3 2.5 2

!

0.1 0.2 0.3 0.4 0.5

0.5 1 1.5

2

0 0.1 0.2 0.3 0.4 0.5

0.2 0.4 0.6 0.8 1 1.2 1.4

0.1 0.2 0.3 0.4 0.5

-1 -0.5

0.5 1

cnum / u unum / u

| " |

# = 0.5

# = 0.5

–1 " # " 1

| "2| (#=1.5)

| "1| (#=1.5)

wavelength–1 in !x–1

(a)

(b)

(c)

(9)

Classification of time stepping algorithms

Consider an ordinary differential equation

!

"#

" t = F ( ) #

Explicit schemes: the discretized form of the equation does not contain the time level n+1 on the right-hand side.

Example: Forward (Euler) step

!

"

n+1

# "

n

$t = F ( ) "

n

Explicit schemes can be solved for

!

"

n+1

, i.e. there is an explicit form of the time step.

Explicit schemes: F ( ) ! is evaluated at time level n+1 (or some time level > n).

Example: Trapezoidal rule

!

"

n+1

# "

n

$ t = 1

2 [ F ( ) "

n+1

+ F ( ) "

n

]

In general (depending on F) such an equation cannot be solved for

!

"

n+1

.

(10)

Nonlinear instability

The von Neumann method is restricted to linear schemes and linear (or linearized) governing equations.

However, instability can also result from nonlinear interactions, even if linear stability criteria (e.g. the CFL condition) are met.

Nonlinear instability often derives in the context of strong scale

interactions, for instance when the governing equations attempt to create

a scale collapse. As the scale collapse cannot fully be represented on the

computational grid (as a result of limited spatial resolution), the nonlinear

amplification of small-scale wave may result in instability.

(11)

Order of schemes

Example: Upstream scheme

Using Taylor series expansion, one can estimate the error of a discretization. In the case of the upstream finite differencing

!

"

i'

= "

i

– "

i–1

# x + "

i''

#x

2 – "

i'''

#x

2

3! + "

i(iv)

#x

3

4! + $ #x ( )

4

or

!

"

i'

= ( ) "

i' upstream

+ F mit F = "

i''

#x

2 – "

i'''

#x

2

3! + $ #x ( )

3

The leading term of the error F is ! "x ( )

1

=> 1

st

order in space

A scheme of order n has leading error terms of (at least) order n in space and time.

Example: Leapfrog scheme

Leading term of the error F is " # ( ) x

2

=> 2

nd

order in space

(12)

4

th

-order centered differencing

2

nd

-order centered spatial differencing

!

"

#

j

= #

j+1

$ #

j$1

2 % x

4

th

-order centered spatial differencing

!

"

#

j

= $ #

j+1

% #

j%1

2 & x + ' #

j+2

% #

j%2

4 & x

With β = 4/3 and γ = –1/3, the leading error term is

!

" #x ( )

4

=> fourth order in space

(13)

Convergence and consistency

A numerical scheme is convergent, if the integration (over a finite time interval T) for

!

"x # 0 and "t # 0 yields the exact solution. With

!

"x # 0 , stability and accuracy considerations imply that also

!

"t # 0, and thus the number of time steps increases as

!

N" # . Addressing convergence thus is a difficult topic, as it requires consideration of an infinite number of time steps.

Lax-Richtmeyer theorem (Lax and Richtmeyer 1956):

A finite difference numerical scheme is convergent, if and only if it is consistent and stable.

A scheme is referred to as consistent, if the discretization error per time step disappears with

!

"x # 0 and "t # 0 . Thus, any scheme that is at least 1

st

order in space and time is consistent.

The Lax-Richtmeyer theorem thus allows addressing convergence (which

involves an infinite number of time steps) by considering consistency

(which may be framed in terms of one single time step) and stability

(which refers to a large number of time steps but not to accuracy).

(14)

Conservative schemes

Equations in divergence form, e.g. the continuity equation

! "

! t + # $ ( v " ) = 0

are conservative. This expresses that the integrated mass in a domain G can only change in response to mass fluxes at the surface ∂G.

G !G

n

n

At the level of numerical schemes, conservation may be guaranteed by using the flux form. For the one-dimensional continuity equation

!

" #

" t + "

" x ( ) u # = 0 this is

!

"

n+1j

# "

nj

$ t + F

j+1/ 2n+1/ 2

# F

jn+1/ 2#1/ 2

$ x = 0

where F is an approximation of the mass flux u ρ .

Referenzen

ÄHNLICHE DOKUMENTE

We provide a simple necessary and su¢cient condition for when a multiproduct demand system can be generated from a discrete choice model with unit demands1. Keywords: Discrete

As for the conductivity sensor, the result of calibration shows that a set of coefficient for the conversion from the frequency to the conductivity decided at the time of the

I temi specifici che vengono qui trattati riguardano, anzitutto il divario fra Nord e Sud del mondo e l’emigrazione, in secondo luogo, il mercato del lavoro italiano

Finalmente, dado que la distribución de los residuos de la ecuación de corto plazo es unimodal y no presenta mayor masa de probabilidad en sus colas (o valores extremos),

Figure 25 Mean absolute error for 5-day-averaged forecasts of 500hPa geopotential height fields (m) over Northern Hemisphere Extratropics between 40°N-90°N for CNT (solid) as well

1.. deterministic systems deriving rates for pointwise and uniform convergence, and is orga- nized as follows: In Section 2 we start by describing the general setup. In Section 3

Seven of the nine pi geons that had participated in the pre- vious experiment were used. Two pigeons were excluded.. The same apparatus and procedures were used. Then the

[r]