Baixe o app para aproveitar ainda mais
Prévia do material em texto
Numerical Properties of Discretized Equation 1 Numerical Properties of Discretized Equation The following properties are crucial to the performance of a discretization equation: Truncation Error Consistency Stability Conservation Boundedness Realizibility Convergence Numerical Properties of Discretized Equation 2 [Truncation Error] Consider the diffusion equation 2 2 f f t x α∂ ∂= ∂ ∂ (1) Using a forward difference for the time derivative and a central difference for the second spatial derivative (FTCS), we have the discretized algebraic equation (DAE) of 1 -1 1 2 2n n n n ni i i i if f f f f t x α + +− − += ∆ ∆ (FTCS scheme) (2) Numerical Properties of Discretized Equation 3 By Taylor’s expansion about the grid point i 2 2 3 3 4 4 5 1 2 3 4 ( ) ( ) ( )( )( ) ( ) ( ) ( ) ( ) 2 3! 4! n n i i i i i i f x f x f x ff f x O x x x x x+ ∂ ∆ ∂ ∆ ∂ ∆ ∂ = + ∆ + + + + ∆ ∂ ∂ ∂ ∂ (3) 2 2 3 3 4 4 5 1 2 3 4 ( ) ( ) ( )( )( ) ( ) ( ) ( ) ( ) 2 3! 4! n n i i i i i i f x f x f x ff f x O x x x x x− ∂ ∆ ∂ ∆ ∂ ∆ ∂ = − ∆ + − + + ∆ ∂ ∂ ∂ ∂ (4) 2 2 3 3 1 4 2 3 ( ) ( )( ) ( ) ( ) ( ) 2! 3! n n i i i i i f t f t ff f t O t x t t + ∂ ∆ ∂ ∆ ∂= + ∆ + + + ∆ ∂ ∂ ∂ (5) Numerical Properties of Discretized Equation 4 Substituting into Eq. (2) yields 2 2 4 4 3 2 5 2 2 2 4 ( )( ) ( ) ( ) [( ) ( ) ( ) ( )] 2 ( ) 4!i i i i f t f f x fO t x O x t t x x x α∂ ∆ ∂ ∂ ∆ ∂ + + ∆ = ∆ + + ∆ ∂ ∂ ∆ ∂ ∂ ⇒ 2 2 2 4 3 3 2 2 4( ) ( ) ( ) ( ) ( ) ( ) 02 12 , [ . ] i i i i f f t f x f O t O x t x PDE Truncation Error T x E t α α∂ ∂ ∆ ∂ ∆ ∂− + − + ∆ + ∆ = ∂ ∂ ∂ ∂ (6) (Expanded Differential Equation (EDE) of Discretized Algebraic Equation) ⇒ 2[ . [[ ] , [ ]]] .T E O tPD xEEDE = = ∆ ∆− user 註解 高階項 user 螢光標示 Numerical Properties of Discretized Equation 5 Further, consider Crank-Nicolson scheme for diffusion equation 1 1 1 1 1 1 -1 -12 [ 2( ) ]2 n n n n n n n ni i i i i i i i f f f f f f f f t x α+ + + + + + − = + − + + + ∆ ∆ (7) The expanded differential equation of Eq. (7) can be obtained as 2 2 3 2 2 2 2 2( ) ( ) ( ) ( ) [ , ]2 2i i i i f f t f t f O t x t x t t x α α∂ ∂ ∆ ∂ ∆ ∂− = − + + ∆ ∆ ∂ ∂ ∂ ∂ ∂ (8) ⇒ 2[ . .] [ , ]T E O t x= ∆ ∆ However, we have 2 3 2 2 2 2( ) ( ) [( ) ( ) ]2 2 2i i i i t f t f t f f t t x t t x α α∆ ∂ ∆ ∂ ∆ ∂ ∂ ∂− + = − − ∂ ∂ ∂ ∂ ∂ ∂ (9) Numerical Properties of Discretized Equation 6 Thus, Eq. (8) takes the form 2 2 2 2 2 0 ( ) ( ) [( ) ( ) ] [( ) ] [( ) ] 2i i i i f f t f f O t O x t x t t x α α = ∂ ∂ ∆ ∂ ∂ ∂ − + − = ∆ + ∆ ∂ ∂ ∂ ∂ ∂ (10) It follows that the truncation error for the Crank-Nicolson scheme is 2 2[ . .] [ , ]T E O t x= ∆ ∆ The leading terms in the truncation error should be examined very carefully to see if they can be identified as a multiple of a derivation of the original PDE. If they can, they should be replaced by expressions of higher order! user 螢光標示 user 螢光標示 Numerical Properties of Discretized Equation 7 [Consistency] A descritized algebraic equation (DAE) analogous to a PDE is said to be “consistent” if 0 0 lim [ . .] 0 x t T E ∆ → ∆ → = For example, the Dufort-Frankel (1953) finite difference scheme for the diffusion equation takes the form 1 1 1 1 1 -12 [ ( ) ]2 n n n n n ni i i i i i f f f f f f t x α+ − + − + − = − + + ∆ ∆ (11) user 螢光標示 user 螢光標示 Numerical Properties of Discretized Equation 8 The leading terms in the truncation error for Eq. (11) are 4 2 3 2 2 2 4 2 3 2 1[ . .] ( ) ( ) ( ) ( ) ( ) ( ) 12 6i i i f f t fT E x t x t x t α α β ∂ ∂ ∆ ∂ = ∆ − − ∆ + ∂ ∂ ∆ ∂ (12) 2 2 20 0 lim [ . (12)] ( ) 0ix t fEq t αβ ∆ → ∆ → ∂ = − ≠ ∂ (13) where ( / )t x β∆ ∆ = . It follows that the Dufort-Frankel scheme is consistent with a hyperbolic equation 2 2 2 2 f f f t t x αβ α∂ ∂ ∂+ = ∂ ∂ ∂ (14) Numerical Properties of Discretized Equation 9 [Stability] (Marching Stability) During numerical simulation for a marching PDE, errors may be accumulated as a result of Round-off Truncation Mistakes A DAE is said to be “stable” if the cumulative errors are not permitted to grow in the sequence of numerical procedures as the calculation proceeds from one marching step to the next. user 註解 儲存時因為記憶的上限而刪除的位數 Numerical Properties of Discretized Equation 10 In practice, the stability of a numerical solution may imply the following properties of numerical solution: Conservation Boundedness Realizibility Numerical Properties of Discretized Equation 11 [Conservation] – A discretization scheme possesses the conservation property if it preserves certain integral conservation relations of the continuum equation. Conservation laws of physical quantities, such as mass, momentum, energy, species, …, at the discrete level are satisfied adequately, which can only be distributed improperly. V S V convection diffusion accumulation influx generation dV f ndS dV f t φ φ φ α φ∂ = − ⋅ + = − ∇ ∂ ∫ ∫ ∫ , where v Conservative discretization does generally give more accurate solution. user 註解 等號左邊接近0 Numerical Properties of Discretized Equation 12 Non-conservative discretization may produce reasonably looking results which are totally wrong even non-conservative schemes can be consistent and stable correct solutions are recovered in the limits of very fine grids Any finite volume discretization is conservative by construction both locally (over every single control volume) and globally (for the whole domain) The conservation property of a finite difference discretization depends on the form of continuum equation used the finite difference scheme Numerical Properties of Discretized Equation 13 A finite difference discretization is conservative if it can be written in the form 1 1/ 2 1/ 2 n n i i i i i f f t x φ φ φ + + −− −+ = ∆ ∆ i = I1….., Im Summation of the finite difference over the grid points gives 1 1 1/ 2 1/ 2[ ] mI n n i i i i i i I f f x t x φ φ φ + + − = − − + = ∆ ∆ ∆∑ 1 1 1 1 1/ 2 1/ 2 1 [( ) ] ( ) m m mI I I n n i i i i i i I i I i I x f f x t φ φ φ+ + − = = = − ∆ + − = ∆ ∆ ∑ ∑ ∑ Numerical Properties of Discretized Equation 14 1 1 1 1 1 1 1 1 1/ 2 1/ 2 1/ 2 1/ 2 1/ 2 3/ 2 3/ 2 5/ 2 3/ 2 1/ 2 1/ 2 1/ 2 1/ 2 1/ 2 ( ) m m m m m m I i i I I I I I I i I I I I I I I f f f f f f f f f f f f f f + − − + + + + + = − − − + − + − = − + − + − + − − + − + = − + ∑ ⇒ 1 1 1 1 1/ 2 1/ 2 inf 1 [( ) ] m m m I I n n i i I I i i I i Ilux generation x f f x t φ φ φ+ − + = = − ∆ = − + ∆ ∆ ∑ ∑ i.e. The time rate of accumulation of φ over the solution domain equals the net influx of φ through the control surface plus total generation of φ within the domain. Numerical Properties of Discretized Equation 15 [Boundedness] - Numericalsolutions should lie within proper bounded Physically non-negative variables, e.g. density, kinetic energy of turbulence, etc., must always be positive In the absence of sources, some equations require that the minimum and maximum values of the variable be found on the boundaries of the domain (i.e., elliptic PDE, e.g., the heat equation for the temperature when no heat sources are present) Boundedness is difficult to guarantee Only some first order schemes guarantee this property All higher-order schemes prone to producing unbounded/overshot solutions may have “stability” and “convergence” problems, which may be avoided by means of grid refinement (at least locally) Numerical Properties of Discretized Equation 16 [Realizibility] – Numerical solutions should be physically realistic. Model of phenomena, which are too complex to treat directly (e.g., turbulence, combustion, or multiphase flow), should be designed to guarantee physically realistic solutions. Sometimes “instability” can be identified with a physical “implausibility”, i.e. unacceptable results in physical sense. Numerical Properties of Discretized Equation 17 Consider the FTCS scheme for a conduction equation 1 i i 1 i 1 i i 1 i 1 i2 2( ) (1 2 ) ( ) (1 2 ) n n n n n n nt tT T T T T T T x x τ α α τ τ+ + − + − ∆ ∆ ∆ = + + − = ∆ + + − ∆ ∆ ∆ (14) where 2( / )t xτ α∆ = ∆ ∆ . Suppose at a time t = n∆t, 1 1 100 n n o i iT T C+ −= = and 0n oiT C= . If 1τ∆ = , then Eq. (14) gives 1 200 n oiT C + = (Physically impossible value!) Numerical Properties of Discretized Equation 18 [Convergence] A solution to a discretized algebraic equation (DAE) which approximates a given PDE is said to be “convergence” if, at each grid point in the solution domain the numerical solution approaches the true/analytical solution of the P.D.E. having the same initial and boundary conditions as the grid sizes tend to zero. ∆x→0, ∆t→0 Numerical Solution to DAE True/Analytical Solution to PDE Numerical Properties of Discretized Equation 19 [Lax’s Equivalence Theorem] Given a properly posed initial value problem and a finite-difference approximation to it that satisfies the consistency condition, stability is the necessary and sufficient condition for convergence. [Consistency] + [Stability] ⇒ [Convergence] Most “real” flow problems are nonlinear and are boundary or mixed initial/boundary value problems so that the Lax equivalence theorem cannot always be applied rigorously. Consequently the Lax equivalence theorem should be interpreted as providing necessary, but not always sufficient, conditions. Numerical Properties of Discretized Equation 20 Governing PDE Discretization System of DAEs Consistency Stability Numerical Solution True Solution Convergence as ∆x, ∆t → 0 [Consistency] + [Stability] ⇒ [Convergence] user 註解 用TE判斷 Numerical Properties of Discretized Equation 21 [Accuracy] Accuracy of numerical solution to a PDE is closely related with three kinds of errors: (1) Modeling error - the difference between the actual physical phenomenon and the analytical/true solution of the mathematical model. (2) Discretization error - the difference between the analytical/true solution of the PDE and the exact solution of the system of DAEs, due to truncation error and errors introduced by the treatment of boundary conditions. (3) Convergence error - the difference between the “iterative” and “exact” solutions of the system of DAEs, due to run-off errors. user 螢光標示 user 註解 要盡量減少 Numerical Properties of Discretized Equation 22 True Solution to PDE Numerical Solution to DAE ∼ Discretization Error Convergence Error Numerical Properties of Discretized Equation 23 END The path towards good numerical solutions is paved with uncertainty, trial and error.
Compartilhar