1 / 22

Finite differences

Finite differences. Introduction. 1. 2. j-1. j. j+1. N. N+1. <------------------------------- L ---------------------------------->. Taylor series expansion:. Finite differences approximations. =. forward approximation. Consistent if , ,…. are bounded. =.

navid
Download Presentation

Finite differences

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Finite differences Finite differences

  2. Introduction 1 2 j-1 j j+1 N N+1 <------------------------------- L ----------------------------------> Taylor series expansion: Finite differences

  3. Finite differences approximations = forward approximation Consistent if , ,…. are bounded = backward approximation adding both == centered differences Finite differences

  4. Finite differences approximations (2) Also === fourth order approximation to the first derivative === Second order approximation to the second derivative Finite differences

  5. The linear advection equation + initial and boundary conditions Analytical solution Substituting we get Eigenvalue problems for the operators With periodic B.C. λ can only have certain (imaginary) values where k is the wavenumber The general solution is a linear combination of several wavenumbers Finite differences

  6. The linear advection equation (2) The solution is then: Propagating with speed U0 No dispersion For a single wave of wavenumber k, the frequency is ω=kU0 Energy conservation If periodic B.C. Finite differences

  7. Space discretization centered second-order approximation ; substituting whose solution is with c U0 The phase speed c depends on k; dispersion kΔx= π ---> λ=2Δx ==> c=0 kΔx  Finite differences

  8. Group velocity Continuous equation Discretized equation =-U0for kΔx=π Approximating the space operator introduces dispersion Finite differences

  9. If b>0, φjn increases exponentially with time (unstable) If b<0, φjn decreases exponentially with time (damped) If b=0, φjn maintains its amplitude with time (neutral) Time discretization first-order forward approx. Try Substituting we get \--v--/ α(Courant-Friedrich-Levy number) ω=a+ib Finite differences Also another dispersion is introduced, as we have approximated the operator ∂/ ∂t

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

  11. Stability analysis Energy method define Periodic boundary conditions Discretized analog : En φn N+1≡φn1 If En=const, stable Finite differences

  12. x j-1 j Example of the energy method upwind if U0>0 downwind if U0<0 α=0 ==> U0=0 no motion α=1 Δt= Δx/U0 En+1=En if if En+1 > En -------> unstable α > 0 ==> U0 > 0 (upwind) α < 1 U0Δt/ Δx < 1 (CFL condition) En+1 < En Finite differences damped

  13. Von Neumann method Consider a single wave if |λk| < 1 the scheme is damping for this wavenumber 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 Vf= ω/k vg=∂ω/∂k Finite differences

  14. Matrix method Let for a two-time-level scheme is called the amplification matrix And call the eigenvectors of Expanding the initial condition In terms of these eigenvectors and applying n times the amplification matrix exponential therefore Finite differences

  15. Stability of some schemes using Von Neumann, we find • Forward in time, centered in space (FTCS) scheme • Upwind or downwind scheme unstable upwind if U0 > 0 downwind if U0 < 0 Using Von Neumann: α < 0 downwind α > 1 CFL limit α(α-1) > 0 ------> unstable Finite differences -1/4 < α(α-1) < 0==> 0 ≤α≤ 1 -------------> stable damped scheme

  16. Stability of some schemes (cont) • Leapfrog Using von Neumann we find |α|≤1 as stability condition Finite differences

  17. Stability of some schemes (cont) (Taylor in t) From • Lax Wendroff Applying Von Neumann we can find that |α| ≤1 -----> stable Equivalent to x Finite differences j j+1/2 j+1

  18. where Stability of some schemes (cont) where • Implicit centered scheme • Krank-Nicholson using von Neumann Always neutral Dispersion worse than leapfrog Always neutral Dispersion better than implicit. No computational mode Finite differences

  19. j-1 j-1 j-1 j j j j+1 j+1 j+1 “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 U0Δt Downwind scheme x--> point where the information comes from (xj-U0Δt) x Interval used for the computation of ∂φ/∂x Upwind scheme o x x ----> α < 1 o ----> α > 1 CFL number ==> fraction of Δx traveled in Δt seconds o x Leapfrog Implicit Finite differences

  20. Dispersion and group velocity Leapfrog vg vf U0 K-N Implicit ωΔt Finite differences π/2 π

  21. Effect of dispersion Initial Leapfrog implicit Finite differences

  22. Two-dimensional advection equation Using von Neumann, assuming a solution of the form we obtain using we obtain, for |λ| to be ≤1 the condition where Δs= Δx= Δy This is more restrictive than in one dimension by a factor Finite differences

More Related