Download presentation

Presentation is loading. Please wait.

Published byBailey Andrews Modified over 2 years ago

1
Numerical methods 1 An Introduction to Numerical Methods For Weather Prediction by Joerg Urban office 012 Based on lectures given by Mariano Hortal

2
Numerical methods 2 Shallow water equations in 1 dimension advection adjustementdiffusion u … velocity along x direction h … absolute height g … acceleration due to gravity K …diffusion coefficient Non linear equations Velocity is equal in layers vertical direction (shallow) h

3
Numerical methods 3 Linearization u=U 0 +u h=H +h Const. + perturb. in the x-comp. of velocity Const. + perturb. in the height of the free surface Substitute and drop products of perturbations Small perturbations

4
Numerical methods 4 Classification of PDEs Boundary value problems D ΓDΓD f, g: known function; L, B: differential operator φ: unknown function of x φ: unknown function of t t=0 t Initial value problems (most important to us) open domain boundary

5
Numerical methods 5 Initial and boundary value problems Eigenvalue problems Classification of PDEs (II) φ: unknown eigenfunction λ: eigenvalue of operator L

6
Numerical methods 6 Existence and uniqueness of solutions ; y(t 0 )=y 0 (initial value problem) Does it have a solution? Does it have only one solution? Do we care? If it has one and only one solution it is called a well posed problem

7
Numerical methods 7 Picards Theorem Let andbe continuous in the rectangle then, the initial-value problem Has a unique solution y(t) on the interval Finding the solution (not analytical) Numerical methods (finite dimensions)

8
Numerical methods 8 Discretization Finite differences Spectral Finite elements Transform the continuous differential equation into a system of ordinary algebraic equations where the unknowns are the numbers f j

9
Numerical methods 9 Convergence Consistency Stability Lax-Richtmeyer theorem Discretized equation > continuous equation The Lax-Richtmeyer theorem Discretized solution > continuous solution discretization finer and finer Discretized solution bounded If a discretization scheme is consistent and stable then it is convergent, and vice versa

10
Numerical methods 10 Finite Differences - Introduction 1j-1jj+12NN+1 Taylor series expansion:

11
Numerical methods 11 Finite differences approximations forward approximation Consistent if … are bounded backward approximation adding both centered differences Consistent if … are bounded

12
Numerical methods 12 Finite differences approximations (2) Also fourth order approximation to the first derivative second order approximation of the second derivative Using the Taylor expansion again we can easily get the second derivative:

13
Numerical methods 13 The linear advection equation + initial and boundary conditions We start with a guess: Substituting we get: Eigenvalue problems for With periodic B.C. λ can only have certain (imaginary) values where k is the wave number The general solution is a linear combination of several wave numbers

14
Numerical methods 14 The linear advection equation (2) The analytic solution is then: Propagating with speed U 0 For a single wave of wave number k the frequency is ω=kU 0 No dispersion Energy: For periodic B.C.:

15
Numerical methods 15 Space discretization whose solution iswith U0U0 c kΔxkΔx The phase speed c depends on k dispersion kΔx= π ---> λ=2Δx ==> c=0 centered second-order approximation Try: results in π

16
Numerical methods 16 Group velocity Continuous equation Discretized equation =-U 0 for kΔx=π Approximating the space operator introduces dispersion

17
Numerical methods 17 Time discretization Try Substituting we get Courant-Friedrich- Levy number ω=a+ib If b>0, φ j n increases exponentially with time (unstable) If b<0, φ j n decreases exponentially with time (damped) If b=0, φ j n maintains its amplitude with time (neutral) Also another dispersion is introduced, as we have approximated the operator / t In addition to our 2 nd order centered approx. for the space derivative we use a 1 st order forward approx. for the time derivative:

18
Numerical methods 18 Three time level scheme (leapfrog) This scheme is centered (second order accurate) in both space and time Try a solution of the form exponential If |λ k | > 1 solution unstable if |λ k | = 1 solution neutral if |λ k | < 1 solution damped Substituting Δx--->0 Δt --->0 physical mode computational mode

19
Numerical methods 19 Stability analysis Energy method We have defined For periodic boundary conditions We have discretized t and hence the discretized analog of E(t) is E n φ n N+1 φ n 1 If E n =const, than the scheme is stable

20
Numerical methods 20 Example of the energy method upwind if U 0 >0 downwind if U 0 <0 x j-1j E n+1 =E n if α=0 => U 0 =0 no motion α=1 Δt= Δx/U 0 E n+1 > E n unstable E n+1 < E n if α > 0 => U 0 > 0 upwind α < 1 U 0 Δt/ Δx < 1 CFL cond. damped

21
Numerical methods 21 Von Neumann method Consider a single wave if |λ k | < 1 the scheme is damping for this wave number k if |λ k | = 1 k the scheme is neutral if |λ k | > 1 for some value of k, the scheme is unstable alternatively if Im(ω) > 0 scheme unstable if Im(ω) = 0 scheme neutral if Im(ω) < 0 scheme damping V f = ω/k v g = ω/ k

22
Numerical methods 22 Stability of some schemes Forward in time, centered in space (FTCS) scheme Upwind or downwind using Von Neumann, we find scheme unstable upwind if U 0 > 0 downwind if U 0 < 0 Using Von Neumann, we find α(α-1) > 0 unstable α < 0 downwind α > 1 CFL limit -1/4 0 α 1 stable damped scheme

23
Numerical methods 23 Stability of some schemes (cont) Leapfrog Using von Neumann we find |α|1 as stability condition As a reminder α is the Courant-Friedrich-Levy number:

24
Numerical methods 24 Lax Wendroff scheme Stability of some schemes (cont) From a Taylor expansion in t we get: Applying Von Neumann we can find that |α| > stable Discretization: Substitution the advection equation we:

25
Numerical methods 25 Stability of some schemes (cont) Implicit centered scheme using von Neumann We replace the space derivation by the average value of the centred space derivation at time level n-1 and n+1 Always neutral, however an Expensive implicit equation need to solved Dispersion worse than leapfrog

26
Numerical methods 26 Intuitive look at stability If the information for the future time step comes from inside the interval used for the computation of the space derivative, the scheme is stable. Otherwise it is unstable x, x … point where the information comes from (x j -U 0 Δt) Interval used for the computation of φ/x j-1jj+1 x U0ΔtU0Δt Downwind scheme (unstable) j-1jj+1 x x if α < 1 x if α > 1 Upwind scheme (conditionally stable) CFL number ==> fraction of Δx traveled in Δt seconds Leapfrog (conditionally stable) Implicit (unconditionally stable) j-1jj+1 x

27
Numerical methods 27 Dispersion and group velocity ωΔt π/2π U0U0 vgvg vfvf Leapfrog K-N Implicit V f = ω/k v g = ω/ k

28
Numerical methods 28 Effect of dispersion Initial Leapfrog implicit

29
Numerical methods 29 Two-dimensional advection equation Using von Neumann, assuming a solution of the form we obtain using we obtain, for |λ| 1 the condition where Δs= Δx= Δy This is more restrictive than in one dimension by a factor

30
Numerical methods 30 x u(x,0) x u(x,t) Change in shape even for the continuous form One Fourier component u k e ikx no longer moving with constant speed but interacting with other components Fourier decomposition valid at each individual time but it changes amplitude with time No analytical solution! Non linear advection equation Continuous form

31
Numerical methods 31 Energy conservation Define again: periodic B.C. == Discretization in space First attempt: Second attempt: terms joined by arrows cancel from consecutive js

32
Numerical methods 32 Aliassing Consider the product in the interval 0x 2π Minimum wavelength 12 n N+1 Maximum wave number representable with the discretized grid Aliasing occurs when the non-linear interactions in the advection term produce a wave which is too short to be represented on the grid.

33
Numerical methods 33 Aliassing (cont.) Trigonometrical manipulations lead to: sin(kx j )=-sin[(2k M -k)x j ] wave number k wave number 2k M -k x x x Therefore, it is not possible to distinguish wave numbers k and (2k M -k) on the grid.

34
Numerical methods 34 Non-linear instability If k 1 +k 2 is misrepresented as k 1 there is positive feedback, which causes instability k 1 = 2k M - (k 1 +k 2 ) > 2k 1 =2k M -k 2 2k M 2k 1 k M 2Δx λ 1 4Δx These wavelengths keep storing energy and total energy is not conserved We can remove energy from the smallest wavelengths by - Fourier filtering - Smoothing - Diffusion - Use some other discretization (e.g. semi-Lagrangian)

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google