1 / 52

Chapter 4

Chapter 4. Theoretical Background. 4.1 Convergence. QUESTIONS? Under what conditions the numerical solution will coincide with the exact solution? What guarantee the numerical solution will be close to the exact solution of the PDE?

thisbe
Télécharger la présentation

Chapter 4

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. Chapter 4 Theoretical Background

  2. 4.1 Convergence QUESTIONS? • Under what conditions the numerical solution will coincide with the exact solution? • What guarantee the numerical solution will be close to the exact solution of the PDE? • Consistency – discretization solution process can be reversed, through a Taylor series expansion, to recover the original PDEs • Stability – solution algorithm must be stable • Convergence– solution of the discretization equations (approximate solution) approaches the exact solution for the original PDE when x  0 and t  0(grid refinement)

  3. Numerical Convergence • Convergence -- Numerical solution approaches the exact solution of PDE for each value of the independent variable • Solution error --truncationand round-off errors • Numerical Convergence -- Numerical solution converges to a unique solution with grid refinement (very expensive to prove) • The converged solution may not be the exact solution unless the numerical scheme is also consistent

  4. Numerical Convergence • FTCS Scheme tmax = 5000 Grid refinement is a very expensive process (especially for unsteady 3D problems)

  5. Numerical Convergence • FTCS Scheme

  6. Lax Equivalence Theorem • The necessary and sufficient condition for convergence of a properly posed linear initial value problem -- Satisfies the consistency condition -- The algorithm is stable • Applicable to any discretization procedure (not only finite-differences) that leads to nodal unknowns • For nonlinear boundary value problems or mixed initial /boundary value problems, Lax equivalence theorem cannot be rigorously applied. It may be considered as a necessary, but not always sufficient condition Consistency + Stability = Convergence

  7. Convergence • Discretization– Replace (approximate) the PDE by algebraic equations • Consistency – Recover (x, t  0) PDE from algebraic equations

  8. Convergence Discretization System of algebraic equations Partial differential equations (PDE) Consistency Exact solution Stability Approximate solution Exact solution Convergence

  9. 4.2 Consistency • The discretization (algebraic) equation is consistent with the original PDE if the two are equivalent at each grid point as x, y, z, t 0 • But the exact or converged solutions are unknown! • Consistency is a necessary, but not sufficient condition • The algorithm must also be STABLE to achieve CONVERGENCE

  10. Numerical Consistency • Use Taylor series expansion and examine the remainder • Substitute the exact solution into the discretization equation, and compare with the original PDE • The numerical solution satisfies the discretization equation exactly (assuming no round-off error), but not the original PDE Truncation error analysis Modified equation approach

  11. 4.2.1 FTCS Scheme Parabolic • Include both marching and equilibrium behaviors n + 1 1 s s 12s n j  1 j j + 1

  12. FTCS Scheme • Taylor series expansion

  13. FTCS Scheme • Taylor series expansion • Consistency • Recovers the original PDE! • Convergence?

  14. Numerical Accuracy • Time- and spatial-derivatives are not independent • We need to know the accuracy of the discretization equation, not just individual terms in the equation • Use the PDE to relate time- and spatial-derivatives

  15. FTCS Scheme • Convert to pure time-derivative or pure spatial-derivative

  16. FTCS Scheme • s = t /x2 is dimensionless Time derivative Spatialderivative Error Cancellation !

  17. 4.2.2 Fully Implicit Scheme Level n+1 Level n n  s  s 1+2s 1 n - 1 j  1 j j + 1

  18. Fully Implicit Scheme • Taylor series expansion

  19. Fully Implicit Scheme • Convert to pure time- or spatial-derivative • Unconditionally stable; but only second-order

  20. Richardson Scheme • Centered-Time, Centered Space (CTCS) • Second-order in space and time • Unconditionally unstable! 1 n + 1  4s n 2s 2s n1 1 j  1 j j + 1

  21. DuFort-Frankel Scheme • Replace in Richardson scheme • Second-order in space and time • Unconditionally stable! 1+2s n + 1 2s 2s n 1 2s n1 j  1 j + 1 j

  22. Finite Difference Methods

  23. Finite Difference Methods FTCS Fully-Implicit s s 12s  4s 2s 2s 1 DuFort-Frankel Richardson

  24. Truncation Errors • Time spatial Time spatial

  25. 4.3 Stability • Stability is concerned with the growth, or decay, of errors introduced at any stage of the computation • Round-off errors - machine dependent • Intermediate solution for an iterative scheme • For propagation problems, a given method is stable if the accumulated round-off errors are negligible • For equilibrium problems: • Direct inversion -- round off errors only • Iterative methods – round-off and iteration errors

  26. Numerical Stability • T numerical solution without round-off errors • T* numerical solution including round-off errors • Error bound -- assume the worst possible combinations of individual errors

  27. Numerical Stability • FTCS Scheme, s  ½ for stability s = 0.6

  28. Round-Off Errors • Neutral stability – round-off error introduced at each time step may accumulate (although cancellation often occurs), but never grow in time • Division of small numbers 1/2 may introduce significant round-off errors

  29. Stability of FTCS Scheme • If there is no round-off error and j = 0 on all boundaries, then jn = 0 stable • In practice, for all j at step n(max is machine dependent) Stability limit: s  1/2

  30. Stability - Matrix Method • Eigenvalue of a tridiagonal matrix J = 4 (j = 1,2) J = 5 (j = 1,2,3) J = 6 (j=1,2,3,4) In general ……

  31. 4.3.1 Matrix Method: FTCS Scheme j = 1 2 3 4 ……….. J2 J1 J (B.C.) Eigenvalues (B.C.)

  32. Matrix Method: FTCS Scheme • The magnitude of all eigenvalues are less than 1

  33. Matrix Method: Fully-Implicit Scheme • Diagonally-dominant for all s Unconditionally stable Pick minimum j (negative sign) so that j = 1/ j is maximum

  34. 4.3.2 Matrix Method: General Two-Level Scheme • Linear combination of FTCS and fully-implicit schemes n+1   = 0, FTCS scheme  = 1, Fully-Implicit  = ½, Crank-Nicolson n 1  j1 j j+1

  35. General Two-Level Scheme • Matrix Method

  36. Matrix Method: General Two-Level Scheme • Eigenvalues • Pick “+” sign for numerator and “” sign for denominator for “worst possible” conditions • Stability criterion

  37. Numerical Stability:General Two-Level Scheme • Stability criterion  = 0, FTCS scheme: s  1/2  = 1, Fully-Implicit:unconditionally stable  = ½, Crank-Nicolson:unconditionally (neutrally) stable, but oscillatory solution may still occur

  38. 4.3.3 Matrix Method: Derivative Boundary Conditions • Modify A and B matrices to account for Neumann BCs T2 To Error in textbook Table 4.2 indicates slight reduction of stability for Neumann conditions

  39. Numerical Stability • Generalized two-level scheme

  40. Von Neumann Method • Fourier stability method • Most commonly used, easy to apply, straightforward and dependable • Can only be used for linear, initial value problem (propagation problem) with constant coefficients • for nonlinear problems with variable coefficients, the method may still be applied “locally” to provide necessary, but not sufficient stability criterion • may also provide heuristic information about the influence at the boundary

  41. 4.3.4 Von Neumann Method: FTCS Scheme • Expand the error as a Fourier series • For linear problems (superposition implied), it is sufficient to consider just one term

  42. 4.3.5 Von Neumann Method: General Two-Level Scheme • For linear problems

  43. Von Neumann Method • For more complex equations, it may be necessary to evaluate the amplification factor G(s,, ) numerically for a range of s,, and  values • For three time level schemes, need to solve a quadratic equation in G • For a system of equations of several variables (i.e., u, v, w, p), need to solve the eigenvalues for amplification matrix and require |m| 1 • This section deals with numerical instability, but not the physical instability (transition to turbulence)

  44. Stability and Consistency • FTCS scheme--s  1/2 • Fully Implicit scheme-- unconditionally stable • Richardson scheme-- unconditionally unstable • DuFort-Frankel scheme-- unconditionally stable, but inconsistent!! DuFort-Frankel scheme is consistent with ahyperbolic wave equation!

  45. 4.4 Numerical Accuracy • Convergence, Consistency, and stability: establish limiting behavior for discretization scheme as x, t  0 • Asymptotic rate of convergence: x, t  0 • Accuracy: deals with practical approximate solution on a finite grid • Higher-order scheme may not be more accurate than lower-order ones if the grid is not fine enough • Higher-order scheme has faster rate of convergence, but the absolute error for a given x (coarse grid) may still be larger than low-order schemes • Accuracy is problem-dependent, superiority for a simple model problem may not necessarily imply the same superiority for more complex problems

  46. Numerical Accuracy • How to determine accuracy when the exact solution is not available? 1. Grid-refinement study: very expensive to obtain grid-independent solutions 2. Comparison with experimental data 3. Comparison with analytic solutions / theory  log E Higher-order Lower-order log x coarse fine

  47. Numerical Accuracy • How to improve numerical accuracy? (1) Different choices of independent variables – Cartesian, cylindrical, orthogonal curvilinear, general curvilinear (2) Different choices of dependent variables – vorticity/stream-function or primitive variables? (3) Adaptive grid – fine grid in high-gradient regions (4) Grid refinement together with Richardson extrapolation

  48. 4.4.1 Richardson Extrapolation • Numerical accuracy may be established through successive grid refinements • For a sufficiently fine grid, the solution error reduces like the leading term of truncation error • Richardson extrapolation: cancel the leading term of truncation error for two numerical solutions with different grid resolutions to achieve higher-order accuracy • Assume that the leading term dominate the truncation error, valid only if x is sufficiently fine • More economical than using higher-order scheme directly

  49. Richardson Extrapolation E • Consider two different grids xa and xb m = 2 m = 4 x Construct a composite solutionTc = a Ta + (1 a)Tbto eliminate thetruncation error leading term

  50. Richardson Extrapolation • Example: FTCS Scheme (for fixed s)

More Related