Faculty Name Prof. A. A. Saati Umm Al-Qura University

Embed Size (px)

Citation preview

  • Slide 1

Faculty Name Prof. A. A. Saati Umm Al-Qura University Slide 2 2 Slide 3 Finite Difference Method Parabolic Elliptic Hyperbolic Partial Differential Equations CH3 3 Umm Al-Qura University Slide 4 Linear Second order PDEs are important sets of equations that are used to model many systems in many different fields of science and engineering. Classification is important because: Each category relates to specific engineering problems. Different approaches are used to solve these categories. Classification in lecture Part 2, Part 3 & Part 4.1show that 2 nd Order Linear PDEs as: Elliptic if Parabolic if Hyperbolic if 4 Finite Difference Method Slide 5 Parabolic Partial Differential Equations Introductory Remarks Equations of science and engineering such as motion in fluid mechanics are frequently reduced to parabolic formulation Example: Boundary layer equation Parabolized Navier-Stokes (PNS) equation Unsteady heat conduction equation Various finite difference of the model Parabolic Differential Equation (PDE) will be investigated. 5 Finite Difference Method Slide 6 Finite Difference Formulations Consider 1-D 2 nd order PDE ( unsteady heat conduction equation ) The model equation has the following form Various finite difference approximations can be used to represent the derivatives in the equation Let forward finite difference for of order and central finite difference for of order 6 Finite Difference Method Slide 7 Finite Difference Formulations [ Explicit Method ] The equation can be approximated by the following difference equation. In this equation, is the only unknown and therefore, it can be computed from the following and the time level n is known form a previous solution or given as initial data. The 2 nd -order PDE has been replaced by algebraic equation. 7 Slide 8 8 Slide 9 9 Slide 10 Finite Difference Formulations [Im plicit Method ] When a first-order backward difference approximation for the time derivative And a second-order central difference approximation for the spatial derivative is used The equation takes the form: There are three unknowns: 10 Slide 11 Finite Difference Formulations [Im plicit Method ] The computation of the unknowns would require a set of coupled finite difference equations The above equation can be rearranged as: A formulation of this type, which includes more than one unknown in each FDE, is known as an implicit method. The equation may expressed in the general form as: This FDE is written for all grid points, resulting in a set of algebraic equations, These equation are put in a matrix form. 11 Slide 12 Explicit Methods This section introduces some of the commonly used explicit methods for solving parabolic equations. 12 Finite Difference Method Slide 13 The Forward Time/Central space (FTCS) method This is read truncation error of order The method is stable for 13 Slide 14 The Richardson method In this approximation, central differencing is used for both time and space derivatives. - this is read truncation error of order - The method is unconditionally unstable 14 Slide 15 The DuFort-Frankel method This method is a modification of the Richardson method - this is read truncation error of order The equation can be solve explicitly for at time level The method is unconditionally stable 15 Slide 16 The grid point involved in the method are shown in the figure. 16 Slide 17 17 Example - 1 (Explicit Methods) x ice Slide 18 18 Example - 1 (Explicit Methods) Slide 19 19 Example - 1 (Explicit Methods) t=0 t=0.25 t=0.5 t=0.75 t=1.0 x=0.25x=0.5 x=0.0 x=0.75 x=1.0 0 0 0 0 0 0 0 0 0 0 Sin(0.25)Sin(0. 5)Sin(0.75) Slide 20 20 Example - 1 (Explicit Methods) t=0 t=0.25 t=0.5 t=0.75 t=1.0 x=0.25x=0.5 x=0.0 x=0.75 x=1.0 0 0 0 0 0 0 0 0 0 0 Sin(0.25)Sin(0. 5)Sin(0.75) Slide 21 21 Example - 1 (Explicit Methods) t=0 t=0.25 t=0.5 t=0.75 t=1.0 x=0.25x=0.5 x=0.0 x=0.75 x=1.0 0 0 0 0 0 0 0 0 0 0 Sin(0.25)Sin(0. 5)Sin(0.75) Slide 22 22 Example - 1 (Explicit Methods) Remarks on Example 1 Slide 23 23 Example - 1 (Explicit Methods) t=0 t=0.025 t=0.05 t=0.075 t=0.10 x=0.25x=0.5 x=0.0 x=0.75 x=1.0 0 0 0 0 0 0 0 0 0 0 Sin(0.25)Sin(0. 5)Sin(0.75) Slide 24 24 t=0 t=0.025 t=0.05 t=0.075 t=0.10 x=0.25x=0.5 x=0.0 x=0.75 x=1.0 0 0 0 0 0 0 0 0 0 0 Sin(0.25)Sin(0. 5)Sin(0.75) Example - 1 (Explicit Methods) Slide 25 25 Example - 1 (Explicit Methods) t=0 t=0.025 t=0.05 t=0.075 t=0.10 x=0.25x=0.5 x=0.0 x=0.75 x=1.0 0 0 0 0 0 0 0 0 0 0 Sin(0.25)Sin(0. 5)Sin(0.75) Slide 26 26 Implicit Methods Slide 27 When a first-order backward difference approximation for the time derivative And a second-order central difference approximation for the spatial derivative is used The equation takes the form: A formulation of this type, which includes more than one unknown in each FDE, is known as an implicit method. 27 Slide 28 Implicit methods offer great advantage on the stability, since most are unconditionally stable * A larger step size in time is permitted * An increase in time step will increase the truncation error. 28 Slide 29 The Laasonen Method When a first-order backward difference approximation for the time derivative And a second-order central difference approximation for the spatial derivative is used The equation takes the form: - this is read truncation error of order 29 Slide 30 The Crank-Nicolson method The diffusion term is replaced by the average of the central differences at time levels n and n+1 30 Slide 31 The left side of the equation is a central difference of step Which is of order The equation would be of the form - this is read truncation error of order - The method is unconditionally stable 31 Slide 32 In terms of the grid point ( see figure) the left side can be interpreted as the central difference representation of at point A the right side is the average of the diffusion term at the same point using the explicit method using implicit method Adding this tow equations we obtains 32 Slide 33 The Beta Formulation A general form of the finite difference equation - The method is unconditionally stable for Note: the formulation is Crank-Nicolson implicit for the formulation is conditionally stable for the formulation is FTCS explicit for 33 Slide 34 34 Example - 2 (Implicit Methods) Slide 35 35 Example - 2 (Implicit Methods) Slide 36 36 Example - 2 (Implicit Methods) Slide 37 37 Example - 2 (Implicit Methods) u 1,1 u 2,1 u 3,1 t 0 =0 t 1 =0.25 t 2 =0.5 t 3 =0.75 t 4 =1.0 x 1 =0.25 x 2 =0.5x 0 =0.0 x 3 =0.75 x 4 =1.0 0 0 0 0 0 0 0 0 0 0 Sin(0.25)Sin(0. 5)Sin(0.75) u 1,4 u 2,4 u 3,4 u 1,3 u 2,3 u 3,3 u 1,2 u 2,2 u 3,2 Slide 38 38 Example - 2 (Implicit Methods) Solution of Row 1 at t1=0.25 sec Slide 39 39 Example - 2 (Implicit Methods) Solution of Row 2 at t2=0.5 sec u 1,1 u 2,1 u 3,1 t 0 =0 t 1 =0.25 t 2 =0.5 t 3 =0.75 t 4 =1.0 x 1 =0.25 x 2 =0.5x 0 =0.0 x 3 =0.75 x 4 =1.0 0 0 0 0 0 0 0 0 0 0 Sin(0.25)Sin(0. 5)Sin(0.75) u 1,4 u 2,4 u 3,4 u 1,3 u 2,3 u 3,3 u 1,2 u 2,2 u 3,2 Slide 40 40 Example - 2 (Implicit Methods) Solution of Row 3 at t3=0.75 sec Slide 41 41 Example - 2 (Implicit Methods) Solution of Row 4 at t4=1 sec Slide 42 42 Remarks The Explicit Method: One needs to select small time step to ensure stability. Computation per point is very simple but many points are needed. Implicit Nicolson: Requires the solution of a Tri-diagonal system. Stable (Larger time step can be used). Slide 43 Applications - 1 Various finite difference equations were used to represent the parabolic model equation It is important to write computer codes and analyzing the results which give additional insights into the solution procedures are gained 43 Slide 44 Example Consider a fluid bounded by two parallel plates extended to infinity such that no end effects are encountered. The planar walls and the fluid are initially at rest. The lower wall is suddenly accelerated in the x-direction the Navier-Stokes equations for this problem may be expressed as. 44 Slide 45 - The fluid is oil with a kinematic viscosity of - The spacing h = 40 mm. - The velocity of the lower wall - It is required to compute the velocity profile - A solution for the velocity is to be obtained up to 1.08 seconds 45 Slide 46 The initial and boundary conditions for this problem are stated as Initial condition Boundary conditions Let assume various of time step is to be used to investigate the numerical schemes and the effect of time step on the stability. 46 Slide 47 47 Slide 48 Solve the above example with the following methods 1)The FTCS explicit method with I. II. 2)The DuFort-Frankel explicit method with I. II. 3)The Laasonen implicit method with I. II. 4)The Crank-Nicolson method with I. II. 48 Slide 49 Solution Case 1.I the FTCS explicit method is to be used the stability require the term is known as diffusion number for this case the diffusion number is therefore the stability condition is satisfied 49 Slide 50 50 Slide 51 51 Slide 52 Case 1.II the FTCS explicit method is to be used for this case the diffusion number is therefore the stability condition is not satisfied 52 Slide 53 53 Slide 54 Analysis In the earlier section, various finite difference formulation were applied to the PDE and ODE The effect of the stability imposed by the diffusion number on the FTCS explicit method This method the step sizes is limited due to the stability The implicit methods are unconditionally stable and allow larger time steps. But the accuracy requirement limits the use of large time step (increase the time step will increase the truncation errors) 54 Slide 55 Analysis For the simple problem, an analytical solution may be obtained This analytical result is used for: Code validation. Comparison of various methods Study the effect of step size on the accuracy of the solution An error term is defined as: A comparison of various methods. 55 Slide 56 Analysis Comparison of error distribution for various schemes at t=0.18 using the following error term: 56 Slide 57 Analysis Comparison of error distribution for various schemes at t=1.08 using the following error term: 57 Slide 58 Analysis Comparison of error distribution for different time steps by using Lassonen method at t = 1.0 sec. 58 Slide 59 Parabolic Equations in Two-Dimension Various finite difference formulations of parabolic PDEs have been discussed for 1-D The space dimension is extended to two An efficient method of solution is presented. Consider the model equation. Where is considered to be constant. 59 Slide 60 Parabolic Equations in Two-Dimension Consider an explicit formulation. By using forward differencing for the time derivative and central differencing for the space derivatives. This is read truncation error of order The method is stable for Define the diffusion numbers The stability requirement is expressed as 60 Slide 61 Parabolic Equations in Two-Dimension Consider an implicit formulation. By using backward differencing for the time derivative and central differencing for the space derivatives. By defining the coefficients of the unknowns as a, b, c, d and e and the right hand side by f, the equation may be written as 61 Slide 62 Parabolic Equations in Two-Dimension Consider the 5 by 5 grid system as shown in the Figure There are nine unknown at time level n+1 A total of nine simultaneous equations must be solved. The implicit finite difference equations for the grid system are 62 Slide 63 63 Slide 64 The known quantities from the imposed boundary conditions have been moved to the right side and added to the known quantities from the previous n time level. The set of equations can be written in a matrix form as. 64 Slide 65 The coefficient matrix is pent-diagonal. The solution procedure for this matrix is very time consuming. One way to overcome the time consuming is by using a splitting method. This method is known as alternating direction implicit method ADI. The algorithm produces two sets of tri-diagonal simultaneous equations to be solved in sequence. The finite difference equations of the model in ADI formulation are 65 Slide 66 - The method is of order - The method is unconditionally stable 66 ADI method Slide 67 The method can be written in the tri-diagonal form as: 67 Slide 68 ADI method solution procedure Start the solution with the first equation, the formulation is implicit in the x-direction and explicit in the y-direction; the solution at this stage is referred to as the x sweep. Then the solution with the second equation, the formulation is implicit in the y-direction and explicit in the x-direction; the solution at this stage is referred to as the y sweep. Graphical presentation of the method is shown in the following Figure. 68 Slide 69 69 Slide 70 70 Application - 2 Slide 71 71 Consider the 2-D heat conduction equation Where the thermal diffusivity It is required to determine the temperature distribution in a long bar with a rectangular cross-section. Assume the bar is composed of chrome steel, which has cross sectional dimensions of 3.5 ft by 3.5 ft (b=h=3.5) Initial condition t = 0 Boundary condition Slide 72 72 The rectangular plate with B.C. Application - 2 Slide 73 Application of the ADI method: FDE for x-sweep By defining the coefficients for the tri-diagonal system as: Application - 2 Slide 74 74 Application of the ADI method: Note that in order to rearrange the equations as tridiagonal system C(I,4) must be modified at i = 2 & i = IM-1. At I = 2 At I = IM-1 = IMM1 Since are known from the boundary conditions and constant Application - 2 Slide 75 75 Application of the ADI method: FDE for y-sweep By defining the coefficients for the tri-diagonal system as: Application - 2 Slide 76 76 Application of the ADI method: Note that in order to rearrange the equations as tridiagonal system C(I,4) must be modified at J = 2 & J = JM-J. At J = 2 At J = JM-1 = JMM1 Since are known from the boundary conditions and constant Application - 2 Slide 77 77 Application of the ADI method: Tri-diagonal matrix can be solved by using the Gaussian elimination method According to Gaussian elimination method, we multiply the second equation by and the first by and then take the difference of the two to eliminate The resulting equation is If we replace the following Application - 2 Slide 78 78 Application of the ADI method: The same process is repeated for i = 3, 4, .., n-1 Where I = 2,3,4,,n-1 and n = IM-2 or JM-2 The value of can immediately be found by solving simultaneously the last two equations Application - 2 Slide 79 79 Application of the ADI method: The remaining unknowns can be calculated in a backward order the following formula j = n-1, n-2, n-3, , 2, 1 Application - 2 Slide 80 80 Initial temperature distribution. Temperature distribution at t = 0.1 hr. Temperature distribution at t = 0.4 hr. See pages (83 - 84) Application - 2 Slide 81 Sections 3.8 .. 3.13 for advance courses 3.8 Approximate Factorization 3.9 Fractional Step Methods 3.10 Extension to Three-Space Dimensions 3.11 Consistency Analysis of Finite Difference Equations 3.12 Linearization 3.13 Irregular Boundaries Slide 82 END OF Parabolic Partial Differential Equations 82