1 faculty name prof. a. a. saati. type of course core lecture, lab., credit2 / 3 / 3 prerequisites...

77
Engineering Analysis – 804 441 Computational Fluid Dynamics – 804 416 1 Faculty Name Prof. A. A. Saati

Upload: shannon-garrison

Post on 13-Dec-2015

216 views

Category:

Documents


3 download

TRANSCRIPT

  • Slide 1

1 Faculty Name Prof. A. A. Saati Slide 2 Type of course Core Lecture, Lab., Credit2 / 3 / 3 Prerequisites Heat Transfer (804405-3) Engineering Math. II (800202-3) Engineering Computational Methods (804242-3) Course Description The course focuses on finite difference solution for ordinary and partial differential equations, Different numerical methods to solve various problems of engineering system to gain a deeper understanding of the principles of physical problems. Individual student projects exploring and analyzing a complex physical problems and communicating the results in a written report. Examples and applications using computer. 2 Slide 3 Textbook - Computational Fluid Dynamics For Engineers. By Hoffmann, K. A. and Chiang, S.T., 2004. References - An Introduction to Computational Fluid Mechanics by Example, By Sedat Biringen & Chuen-Yen Chow (2011) - Numerical Methods for Engineers and Scientists BY Joe D. Hoffman (2000) - Computational Fluid Mechanics and Heat Transfer, By J. C. Tannehill, D. A. Anderson & R. H. Pletcher - Fundamentals of Engineering Numerical Analysis By Parviz Moin Cambridge Univ Pr (Pap Txt), 2001. - Numerical Heat Transfer and Fluid Flow, By S. V. Patankar, McGraw-Hill. - Computational Methods for Fluid Dynamics, Springer. By J. H. Ferziger and M. Peric, 3 Slide 4 4 Slide 5 5 Slide 6 6 Slide 7 7 Topics to be covered Lec Grade 1 Introduction to Computational methods1-2Lab -- HW Extra 2 Classification of ODE and PDE Equations2Lab -- HW - 1 2 2 Classification of ODE and PDE Equations (canted.)3 4Lab -- HW 2 3 3 Approximate Solutions of Differential Equations5 6Lab -- HW 3 4 4 FDM - Parabolic PDE7 8Lab -- HW 4 6 5 FDM - Parabolic PDE9 10 App-1 ch3 sec 3.5 p66 - DuFort- Frankel 4 6 FDM - Elliptic PDE11 12App-1 ch3 sec 3.5 p66 - Laasonen 4 7 FDM - Elliptic PDE13 14App-1 ch3 sec 5.4 p167 - PGS 4 Exam ( open book only ) 15 8 FDM - Hyperbolic PDE15 16App-1 ch6 sec 6.5 p191 4 9 FDM - Hyperbolic PDE17 18App-2 ch6 sec 6.5 p200 4 10 Fundamentals of Discretization Finite Element- Difference-Volume 19 20Project 1 5 11 Fundamentals of Discretization Finite Element- Difference-Volume 21 22 12 Fundamentals of Discretization Finite Element- Difference-Volume 23 24Project 2 5 13 Final project25 26 Final project 10 14 27 - 28 15Final Exam( open book only ) 30 F. Grade 100 Course Calendar Slide 8 8 Schedule of Assessment Tasks for Students During the Semester Assessment task (e.g. essay, test, group project, examination, speech, oral presentation, etc.) Week Due Proportion of Total Assessment 1Lab -- HW Extra12% 2Lab -- HW - 132% 3Lab -- HW 243% 4Lab -- HW 354% 5Lab -- HW 466% 6Mid-term Exam715% 7Project - App-1 ch3 sec 3.5 p66 - DuFort-Frankel74% 8Project - App-1 ch3 sec 3.5 p66 - Laasonen94% 9Project - App-1 ch3 sec 5.4 p167 - PGS104% 10Project - App-1 ch6 sec 6.5 p191114% 11Project - App-2 ch6 sec 6.5 p200124% 12Project 1135% 13Project 2145% 14Final Group project1210% 15Final Exam1430% Total Grade 100% Slide 9 40%Projects 15%Lab. & Home Works 15%Exam ( open book only ) 30%Final Exam( open book only ) 100% F. Grad Grade Distribution 9 Slide 10 Introduction (Joe D. Hoffman - 2001) 10 1.OBJECTIVE AND APPROACH The objective of the course is to introduce the engineer and scientist to numerical methods which can be used to solve mathematical problems arising in engineering and science that cannot be solved by exact methods. By using the of high-speed digital computers, it is now possible to obtain rapid and accurate solutions to many complex problems that face the engineer and scientist. Slide 11 Introduction 11 2.EXAMPLES All of the numerical methods are illustrated by applying them to solve an example problem. Each chapter has one or two example problems, which are solved by all of the numerical methods. This approach lets the analyst to compare various methods for the same problem, so accuracy, efficiency, strength, and ease of application of the various methods can be evaluated. Most of the example problems are rather simple and straightforward, Slide 12 Introduction 12 3.PROBLEMS Two types of problems are presented at the end of each chapter: 1)Exercise problems are straightforward problems designed to give practice in the application of the numerical algorithms presented in each chapter. Exercise problems emphasize the mechanics of the methods 2)Applied problems involve more applied engineering and scientific applications which require numerical solutions. Slide 13 Introduction 13 4.SIGNIFICANT DIGITS, PRECISION, ACCURACY, ERRORS, AND NUMBER REPRESENTATION Numerical calculations obviously involve the manipulation (i.e., addition, multiplication, etc.) of numbers. Numbers can be integers (e.g., 4, 17, -23, etc.), fractions (e.g., -2/3, etc.), or an infinite string of digits (e.g., = 3.1415926535...). When dealing with numerical values and numerical calculations, there are several concepts that must be considered:, 1)Significant digits 2)Precision and accuracy 3)Errors 4)Number representation These concepts are discussed briefly ha this section. Slide 14 1)Significant digits: The significant digits, or figures, in a number are the digits of the number which are known to be correct. Engineering and scientific calculations generally begin with a set of data having a known number of significant digits. When these numbers are processed through a numerical algorithm, it is important to be able to estimate how many significant digits are present in the final computed result. 2)Precision and accuracy: Precision refers to how closely a number represents the number it is representing. Accuracy refers to how closely a number agrees with the true value of the number it is representing. Precision is governed by the number of digits being carried in the numerical calculations. Accuracy is governed by the errors in the numerical approximation, Precision and accuracy are measured by the errors in a numerical calculation. Introduction 14 Slide 15 3)Errors: The accuracy of a numerical calculation is measured by the error of the calculation. Several types of errors can occur in numerical calculations such as: o Iteration error is the error in an iterative method that approaches the exact solution of an exact problem. o Iteration errors must decrease toward zero as the iterative process progresses. o The iteration error itself may be used to determine the successive approximations to the exact solution. o Iteration errors can be reduced to the limit of the computing device. o The errors in the solution of a system of linear algebraic equations by the successive-over-relaxation (SOR) method presented in Section 1.5 are examples of this type of error. o Approximation errors. o Round off errors. Introduction 15 Slide 16 3)Errors: The accuracy of a numerical calculation is quantified by the error of the calculation. Several types of errors can occur in numerical calculations such as: o Approximation error is the difference between the exact solution of an exact problem and the exact solution of an approximation of the exact problem. o Approximation error can be reduced only by choosing a more accurate approximation of the exact problem. o Roundoff error is the error caused by the finite word length employed in the calculations. o Roundoff error is more significant when small differences between large numbers are calculated. o Most computers have either 32 bit or 64 bit word length, corresponding to approximately 7 or 13 significant decimal digits, respectively. o Some computers have extended precision capability, which increases the number of bits to 128. Introduction 16 Slide 17 4)Number representation: o Numbers are represented in number systems. Any number of bases can be employed as the base of a number system, for example, o the base 10 (i.e., decimal) system, o the base (i.e., octal) system (The octal numeral system, or oct for short, is the base-8 number system, and uses the digits 0 to 7. Octal numerals can be made from binary numerals by grouping..), o the base 2 (i.e., binary) system, etc. o The base 10, or decimal, system the most common system used for human communication. o Digital computers use the base 2, or binary, system. In a digital computer, a binary number consists of a number of binary bits. o The number of binary bits in a binary number determines the precision with which the binary number represents a decimal number. o The most common size binary number is a 32 bit number, which can represent approximately seven digits of a decimal number. o Some digital computers have 64 bit binary numbers, which can represent 13 to 14 decimal digits. o .. Introduction 17 Slide 18 5.SOFTWARE PACKAGES AND LIBRARIES A.Software Packages Excel MacsymMa Maple Mathematica Mathcad Matlab B.Libraries IMSLI NAG NETLIBN C.Numerical Recipes D.Languages: Fortran, C++, . Introduction 18 Slide 19 19 Part 1 - Introduction to Computational methods Steps in Solving an Engineering Problem Measuring Errors 1) True Error 2) Relative True Error 3) Approximate Error 4) Relative Approximate Error 5) How is Absolute Relative Error used as a stopping criterion? Sources of Error 1) Round off error 2) Truncation error Truncation Error Propagation of Errors Taylor Series Revisited Slide 20 20 Why use Numerical Methods? To solve problems that cannot be solved exactly Slide 21 21 Why use Numerical Methods? To solve problems that are inflexible! Slide 22 22 Steps in Solving an Engineering Problem Slide 23 23 How do we solve an engineering problem? Problem Description Mathematical Model Solution of Mathematical Model Using the Solution Slide 24 24 Example of Solving an Engineering Problem Slide 25 25 Bascule Bridge THG Slide 26 26 Trunnion Hub Girder Bascule Bridge THG Slide 27 27 Trunnion-Hub-Girder Assembly Procedure Step1.Trunnion immersed in dry-ice/alcohol Step2.Trunnion warm-up in hub Step3.Trunnion-Hub immersed in dry-ice/alcohol Step4.Trunnion-Hub warm-up into girder Slide 28 28 Problem After Cooling, the Trunnion Got Stuck in Hub Slide 29 29 Why did it get stuck? Magnitude of contraction needed in the Trunnion was 0.015 or more. Did it contract enough? Slide 30 30 Consultant calculations Slide 31 31 Measuring Errors Slide 32 32 Why measure errors? 1) To determine the accuracy of numerical results. 2) To develop stopping criteria for iterative algorithms. Slide 33 33 True Error Defined as the difference between the true value in a calculation and the approximate value found using a numerical method etc. True Error = True Value Approximate Value Slide 34 34 ExampleTrue Error The derivative,of a functioncan be approximated by the equation, If and a) Find the approximate value of b) True value of c) True error for part (a) Slide 35 35 Example (cont.) Solution: a) Forand Slide 36 36 Example (cont.) Solution: b) The exact value ofcan be found by using our knowledge of differential calculus. So the true value ofis c) True error is calculated as True Value Approximate Value Slide 37 37 Relative True Error Defined as the ratio between the true error, and the true value. Relative True Error ( ) = True Error True Value Slide 38 38 ExampleRelative True Error Following from the previous example for true error, find the relative true error forat with From the previous example, Relative True Error is defined as as a percentage, Slide 39 39 Approximate Error What can be done if true values are not known or are very difficult to obtain? Approximate error is defined as the difference between the present approximation and the previous approximation. Approximate Error () = Present Approximation Previous Approximation Slide 40 40 ExampleApproximate Error Foratfind the following, a)using b)using c) approximate error for the value offor part b) Solution: a) Forand Slide 41 41 Example (cont.) Solution: (cont.) b) Forand Slide 42 42 Example (cont.) Solution: (cont.) c) So the approximate error,is Present Approximation Previous Approximation Slide 43 43 Relative Approximate Error Defined as the ratio between the approximate error and the present approximation. Relative Approximate Error ( Approximate Error Present Approximation ) = Slide 44 44 ExampleRelative Approximate Error Forat, find the relative approximate error using values fromand Solution: From Example, the approximate value of usingandusing Present Approximation Previous Approximation Slide 45 45 Example (cont.) Solution: (cont.) Approximate Error Present Approximation as a percentage, Absolute relative approximate errors may also need to be calculated, Slide 46 46 How is Absolute Relative Error used as a stopping criterion? Ifwhereis a pre-specified tolerance, then If at least m significant digits are required to be correct in the final answer, then Slide 47 47 Table of Values Foratwith varying step size, 0.310.263N/A0 0.159.88003.877%1 0.109.75581.273%1 0.019.53782.285%1 0.0019.51640.2249%2 Slide 48 48 THE END Slide 49 49 Sources of Error Slide 50 50 Two sources of numerical error 1) Round off error 2) Truncation error Slide 51 51 Round-off Error Slide 52 52 Round off Error Caused by representing a number approximately Slide 53 53 Problems created by round off error 28 Americans were killed on February 25, 1991 by an Iraqi Scud missile in Dhahran, Saudi Arabia. The patriot defense system failed to track and intercept the Scud. Why? Slide 54 54 Problem with Patriot missile Clock cycle of 1/10 seconds was represented in 24-bit fixed point register created an error of 9.5 x 10 -8 seconds. The battery was on for 100 consecutive hours, thus causing an inaccuracy of Slide 55 55 Problem (cont.) The shift calculated in the ranging system of the missile was 687 meters. The target was considered to be out of range at a distance greater than 137 meters. Slide 56 56 THE END Slide 57 57 Truncation Error Slide 58 58 Truncation error Error caused by truncating or approximating a mathematical procedure. Slide 59 59 Example of Truncation Error Taking only a few terms of a Maclaurin series to approximate If only 3 terms are used, Slide 60 60 Another Example of Truncation Error Using a finiteto approximate P Q secant line tangent line Figure 1. Approximate derivative using finite x Slide 61 61 Another Example of Truncation Error Using finite rectangles to approximate an integral. Slide 62 62 Example Differentiation Findforusing and The actual value is Truncation error is then, Can you find the truncation error with Slide 63 63 THE END Slide 64 64 Propagation of Errors Slide 65 65 Propagation of Errors In numerical methods, the calculations are not made with exact numbers. How do these inaccuracies propagate through the calculations? Slide 66 66 Example 1: Find the bounds for the propagation in adding two numbers. For example if one is calculating X +Y where X = 1.5 0.05 Y = 3.4 0.04 Solution Maximum possible value of X = 1.55 and Y = 3.44 Maximum possible value of X + Y = 1.55 + 3.44 = 4.99 Minimum possible value of X = 1.45 and Y = 3.36. Minimum possible value of X + Y = 1.45 + 3.36 = 4.81 Hence 4.81 X + Y 4.99. Slide 67 67 Propagation of Errors In Formulas If is a function of several variables then the maximum possible value of the error in is Slide 68 68 Example 2: The strain in an axial member of a square cross- section is given by Given Find the maximum possible error in the measured strain. Slide 69 69 Example 2: Solution Slide 70 70 Example 2: Thus Hence Slide 71 71 THE END Slide 72 72 Taylor Series Revisited Slide 73 73 What is a Taylor series? Some examples of Taylor series which you must have seen Slide 74 74 General Taylor Series The general form of the Taylor series is given by provided that all derivatives of f(x) are continuous and exist in the interval [x,x+h] What does this mean in plain English? As Archimedes would have said, Give me the value of the function at a single point, and the value of all (first, second, and so on) its derivatives at that single point, and I can give you the value of the function at any other point ( fine print excluded ) Slide 75 75 ExampleTaylor Series Find the value ofgiven that and all other higher order derivatives ofatare zero. Solution: Slide 76 76 Example (cont.) Solution: (cont.) Since the higher order derivatives are zero, Note that to findexactly, we only need the value of the function and all its derivatives at some other point, in this case Slide 77 77 THE END Part 1 - Introduction to Computational methods