You are on page 1of 500
Fourth Edition COMPUTATIONAL FLUID DYNAMICS VOLUME I KLAUS A. HOFFMANN STEVE T. CHIANG A Publication of Engineering Education System™, Wichita, Kansas, 67208-1078, USA www.EESbooks.com Copyright ©2000, 1998, 1993, 1989 by Engineering Education System. All rights reserved. No part of this publication may be reproduced or distributed in any form or by any means, mechanical or electronic, including photocopying, recording, storage or retrieval system, without prior written permission from the publisher. ‘The data and information published in this book are for information purposes only. The authors and publisher have used their best effort in preparing this book. The authors and publisher are not liable for any injury or damage due to use, reliance, or performance of materials appearing in this book. ISBN 0-9623731-0-9 First Print: August 2000 This book is typeset by Jeanie Duvall dba SciTech Computer Typesetting of Austin, Texas. To obtain information on purchasing this or other texts published by EES, please write to: Engineering Education System™ P.O. Box 20078 Wichita, KS 67208-1078 USA Or visit: www.EESbooks.com CONTENTS Preface Introduction Chapter One: Classification of Partial Differential Equations 3 1.1 Introductory Remarks 3 1.2 Linear and Nonlinear Partial Differential Equations 3 1.3 Second-Order Partial Differential Equations 4 1.4 Elliptic Equations 6 1.5 Parabolic Equations 6 1.6 Hyperbolic Equations 8 1.7 Model Equations 10 1.8 System of First-Order Partial Differential Equations u 1.9. System of Second-Order Partial Differential Equations 16 1.10 Initial and Boundary Conditions 20 1.11 Remarks and Definitions 22 1.12 Summary Objectives 4 1.13. Problems 5 Chapter Two: Finite Difference Formulations 29 2.1. Introductory Remarks 29 2.2 Taylor Series Expansion 29 2.3 Finite Difference by Polynomials 36 2.4 Finite Difference Equations 37 ii Contents 2.5 Applications 40 2.6 Finite Difference Approximation of Mixed Partial Derivatives 51 2.6.1 Taylor Series Expansion 51 2.6.2 The Use of Partial Derivatives with Respect to One Independent Variable 52 2.7 Summary Objectives 53 2.8 Problems 55 Chapter Three: Parabolic Partial Differential Equations 60 3.1 Introductory Remarks 60 3.2 Finite Difference Formulations 60 3.3 Explicit Methods 64 3.3.1 The Forward Time/Central Space Method 64 3.3.2 ‘The Richardson Method 64 3.3.3. The DuFort-Frankel Method 64 3.4 Implicit Methods 65 3.4.1 The Laasonen Method 66 3.4.2 The Crank-Nicolson Method 66 3.4.3. The Beta Formulation 67 3.5 Applications 67 3.6 Analysis 2 3.7. Parabolic Equations in Two-Space Dimensions 76 3.8 Approximate Factorization 85 3.9 Fractional Step Methods 87 3.10 Extension to Three-Space Dimensions 87 3.11 Consistency Analysis of Finite Difference Equations 88 3.12. Linearization 90 3.13 Irregular Boundaries 92 3.14 Summary Objectives 94 3.15 Problems 96 Contents iii Chapter Four: Stability Analysis 113 4.1 Introductory Remarks 113 4.2 Discrete Perturbation Stability Analysis u4 4.3 Von Neumann Stability Analysis 124 44 Multidimensional Problems 137 4.5 Error Analysis 141 4.8 Modified Equation M43 4.7 Artificial Viscosity 46 4.8 Summary Objectives 148 4.9 Problems 149 Chapter Five: Elliptic Equations 152 5.1 Introductory Remarks 152 5.2 Finite Difference Formulations 152 5.3 Solution Algorithms 156 5.3.1 The Jacobi Iteration Method 157 5.3.2. The Point Gauss-Seidel Iteration Method 160 5.3.3 The Line Gauss-Seidel Iteration Method 162 5.3.4 Point Successive Over-Relaxation Method (PSOR) 164 5.3.5 Line Successive Over-Relaxation Method (LSOR) 165 5.3.6 The Alternating Direction Implicit Method (ADI) 165 5.4 Applications 167 5.5 Summary Objectives 174 5.6 Problems 175 iv Chapter Six: Contents | Hyperbolic Equations 185 6.1 Introductory Remarks 185 6.2 Finite Difference Formulations 185 6.2.1 Explicit Formulations 186 6.2.1.1 Buler’s FTFS Method 186 6.2.1.2 Euler's ETCS Method 186 6.2.1.3 The First Upwind Differencing Method 186 6.2.1.4 The Lax Method 186 6.2.1.5 Midpoint Leapfrog Method 186 6.2.1.6 The Lax-Wendroff Method 187 6.2.2 Implicit Formulations 188 6.2.2.1 Euler's BTCS Method 188 6.2.2.2 Implicit First Upwind Differencing Method 188 6.2.2.3. Crank-Nicolson Method 188 6.3 Splitting Methods 189 6.4 Multi-Step Methods 189 6.4.1 Richtmyer/Lax-Wendroff Multi-Step Method 189 6.4.2 The MacCormack Method 190 6.5 Applications to a Linear Problem. 191 6.6 Nonlinear Problem 206 6.6.1 The Lax Method 207 6.6.2 The Lax-Wendroff Method 208 6.6.3 The MacCormack Method 2 6.6.4 The Beam and Warming Implicit Method 213 6.6.5 Explicit First-Order Upwind Scheme 218 6.6.6 Implicit First-Order Upwind Scheme 218 6.6.7 Runge-Kutta Method 219 6.6.8 Modified Runge-Kutta Method 225 6.7 Linear Damping 228 6.7.1 Application 231 Contents 68 Flux Corrected Transport 233 6.8.1 Application 235 6.9 Classification of Numerical Schemes 236 6.9.1 Monotone Schemes 236 6.9.2 Total Variation Diminishing Schemes 237 6.9.3 Essentially Non-Oscillatory Schemes 238 6.10 TVD Formulations 238 6.10.1 First-Order TVD Schemes 239 6.10.2 Entropy Condition 243 6.10.3 Application 243 6.10.4 Second-Order TVD Schemes 244 6.10.4.1 Harten-Yee Upwind TVD Limiters 245 6.10.4.2 Roe-Sweby Upwind TVD Limiters 247 6.10.4.3 Davis-Yee Symmetric TVD Limiters 250 6.11 Modified Runge-Kutta Method with TVD 251 6.12 Summary Objectives 253 6.13 Problems 254 Chapter Seven: Scalar Representation of the Navier-Stokes Equations 272) 7.1 Introductory Remarks 272 7.2 Model Equation 273 7.3 Equations of Fluid Motion 24 74 Numerical Algorithms 276 7.4.1 ETCS Explicit 276 7.4.2, FTBCS Explicit aT 74.3 DuFort-Frankel Explicit amr 7.4.4 MacCormack Explicit 278 7.4.5 MacCormack Implicit 278 7.4.6 BICS Implicit 279 7.4.7 BTBCS Implicit 279 7.5 Applications: Nonlinear Problem 280 7.5.1 FTCS Explicit 282 7.5.2. FTBCS Explicit 285 7.5.3 DuFort-Frankel Explicit 235 7.5.4 MacCormack Explicit 236 7.5.8 MacCormack Implicit 287 BTCS Implicit 289 BTBCS Implicit 289 Modified Runge-Kutta 290 5.9 Second-Order TVD Schemes 292 7.6 Summary Objectives 294 7.7 Problems 295 Chapter Eight: Incompressible Navier-Stokes Equations 302 8.1 Introductory Remarks 302 8.2 Incompressible Navier-Stokes Equations 303 8.2.1 Primitive Variable Formulations 304 8.2.2 Vorticity-Stream Function Formulations 307 8.2.3 Comments on Formulations 309 8.3 Poisson Equation for Pressure: Primitive Variables 310 8.4 Poisson Equation for Pressure: Vorticity-Stream Function Formulation 311 8.5 Numerical Algorithms: Primitive Variables 314 8.5.1 Steady Flows 315 8.5.1.1 Artificial Compressibility 315 8.5.1.2 Solution on a Regular Grid 316 8.5.1.3 Crank-Nicolson Implicit 321 8.6 Boundary Conditions 322 8.6.1 Body Surface 323 8.6.2 Far-Field 325 8.6.3 Symmetry 325 Contents. 8.6.4 Inflow 326 8.6.5 Outflow 326 8.6.6 An Example 326 8.7 Staggered Grid 328 8.7.1 Marker and Cell Method 330 8.7.2 Implementation of the Boundary Conditions 332 8.7.3. DuFort-Frankel Scheme 333 8.7.4 Use of the Poisson Equation for Pressure 334 8.7.5 Unsteady Incompressible Navier-Stokes Equations 335 8.8 Numerical Algorithms: Vorticity-Stream Function Formulation 337 8.8.1 Vorticity Transport Equation 338 8.8.2 Stream Function Equation 343 8.9 Boundary Conditions 343 8.9.1 Body Surface 344 8.9.2 Far-Field 346 8.9.3 Symmetry 346 8.9.4 Inflow 347 8.9.5 Outflow 348 8.10 Application 348 8.11 Temperature Field 351 8.11.1 The Energy Equation 382 8.11.2 Numerical Schemes 354 8.11.3 Boundary Conditions 355 8.12 Problems 387 Chapter Nine: Grid Generation — Structured Grids 358 9.1 Introductory Remarks 358 9.2 Transformation of the Governing Partial Differential Equations 362 9.3. Metrics and the Jacobian of Transformation 363 9.4 Grid Generation Techniques 364 9.5 Algebraic Grid Generation Techniques 365 wih eee eee 9.6 Partial Differential Equation Techniques 383 9.7 Elliptic Grid Generators 383 9.7.1 Simply-Connected Domain 385 9.7.2 Doubly-Connected Domain 395 9.7.3 Multiply-Connected Domain 401 9.8 Coordinate System Control 404 9.8.1 Grid Point Clustering 404 9.8.2 Orthogonality at the Surface 407 9.9 Hyperbolic Grid Generation Techniques 411 9.10 Parabolic Grid Generators 418 9.11 Problems 420 Appendices Appendix A: An Introduction to Theory of Characteristics: Wave Propagation 426 Appendix B: Tridiagonal System of Equations 438 Appendix C: Derivation of Partial Derivatives for the Modified Equations 443 Appendix D: Basic Equations of Fluid Mechanics 445 Appendix E: Block-Tridiagonal System of Equations 464 Appendix F: Derivatives in the Computational Domain 473 References 478 Index 481 PREFACE This three-volume text is designed for use in introductory, intermediate, and advanced courses in computational uid dynamics (CFD) and computational fluid turbulence (CFT). The fundamentals of computational schemes are established in the first volume, presented in nine chapters. The first seven chapters include basic concepts and introductory topics, whereas Chapters 8 and 9 cover advanced topics. In the second volume, the fundamental concepts are extended for the solution of the Euler, Parabolized Navier-Stokes, and Navier-Stokes equations. Finally, unstruc- tured grid generation schemes, finite volume techniques, and finite element method are explored in the second volume. In the third volume, turbulent flows and several computational procedures for the solution of turbulent flows are addressed. The first two volumes are designed such that they can be easily adapted to two sequential courses in CFD. Students with an interest in fluid mechanics and heat transfer should have sufficient background to undertake these courses. In addition, fundamental knowledge of programming and graphics is essential for the applications of methods presented throughout the text. Typically, the first course is offered at the undergraduate level, whereas the second course can be offered at the graduate level. The third volume of the text is designed for a course with the major emphasis on turbulent flows. ‘The general approach and presentation of the material is intended to be brief, with emphasis on applications. A fundamental background is established in the first seven chapters, where various model equations are presented, and the proce- dures used for the numerical solutions are illustrated. For purposes of analysis, the numerical solutions of the sample problems are presented in tables. In many instances, the behavior of a solution can be easily analyzed by considering graphical presentations of the results; therefore, they are included in the text as well. Before attempting to solve the problems proposed at the end of each chapter, the student should try to generate numerical solutions of the sample problems, using codes de- veloped individually or available codes modified for the particular application. The results should be verified by comparing them with the solutions presented in the text. If an analytical solution for the proposed problem is available, the numerical solution should be compared to the analytical solution. x Preface The emphasis in the first volume is on finite difference methods. Chapter 1 classifies the various partial differential equations, and presents some fundamental concepts and definitions. Chapter 2 describes how to achieve approximate repre- sentation of partial derivatives with finite difference equations. Chapter 3 discusses procedures for solving parabolic equations. Stability analysis is presented in Chap- ter 4. The order for Chapters 3 and 4 can be reversed. In fact, the results of stability analysis are required for the solution of parabolic equations in Chapter 3. The reason that the solution procedure of parabolic equations is developed first in Chapter 3 is to spread the computer code developments, since they require a substantial amount of time compared to other assignments. This will prevent the concentration of code development in the latter part of the course. Procedures for solving elliptic and hyperbolic partial differential equations are presented in Chap- ters 5 and 6, respectively. Chapter 7 presents a scalar model equation equivalent of the Navier-Stokes equations. In this chapter numerical algorithms are investigated to solve a scalar model equation which includes unsteady, convective, and diffusive terms. The solution schemes established in the first seven chapters are extended to the solution of a system of partial differential equations in Chapter 8. In particular, the Navier-Stokes equations for incompressible flows in primitive variables, as well as vorticity-stream function formulations, are reviewed. Subsequently, the numerical schemes and specification of appropriate boundary conditions are introduced. Fi- nally, Chapter 9 is designed to introduce the structured grid generation techniques. Various schemes, along with applications, are illustrated in this chapter. While every attempt has been made to produce an error-free text, it is inevitable that some errors still exist, The authors would greatly appreciate the reader's input on any corrections, so that they may be incorporated into future printings. Fur- thermore, we would appreciate any comments and/or suggestions from the read- ers on the improvement of the text. Please forward your comments by mail to: Klaus Hoffmann P.O. Box 20078 Wichita, KS 67208-1078 or e-mail to: Hoffmann@ae.twsu.edu_ In addition to this three-volume text, Computational Fluid Dynamics, a threc- volume text, Student Guide to CFD, has been developed. The text, Student Guide to CED, includes computer codes, description of input/output, and additional example problems. However, it is important to emphasize that computer code development Preface xi is an important aspect of CFD, and that, in fact, one learns a great deal about the numerical schemes and their behaviour as one develops, debugs, and validates his or her own computer code. Therefore, it is important to state here that the computer codes provided in the text Student Guide to CFD should not be used as ‘an avenue to replace that aspect of CFD and that code development must be an important objective of the learning process. However, these codes can be used as a basis upon which one may develop other codes, or the codes can be modified for other applications. The authors greatly appreciates the support and help of many friends and col- Ieagues — in particular, Dr. John Bertin and Dr. James Forsythe of the U.S. Air Force Academy, Dr. Walter Rutledge of Sandia National Laboratories; Dr. Dennis Wilson and Dr. Douglas Cline of The University of Texas at Austin; Dr. Shamoun Siddiqui of the Ministry of Defense, Pakistan; Mr. John Buratti of IBM; Mr. Shigeki Harada of Hewlett-Packard, Japan; Dr. Yildirim B. Suzen of University of Ken- tucky; Mr. Apichart Devahastin; Mr. Jean-Francois Dietiker; and Mr. Henri-Marie Damevin of Wichita State University. Furthermore, we are indebted to many of our students at The University of Texas, The Wichita State University, and those who have participated in various CFD correspondence and short courses offered by AIAA, EES, and ASME. Finally, we greatly appreciate the efforts of Mrs. Karen Rutledge for editorial work, Mr. Tim Valdez for art work, and Ms. Jeanie Duvall for her skillful typing of the manuscript. Klaus A. Hoffmann Steve T. Chiang INTRODUCTION The task of obtaining solutions to the governing equations of fluid mechanics represents one of the most challenging problems in science and engineering. In most instances, the mathematical formulations of the fundamental laws of fluid mechanics are expressed as partial differential equations (PDE). Second-order partial differ- ential equations appear frequently and, therefore, are of particular interest in fluid mechanics and heat transfer. Generally, the governing equations of Auid mechanics form a set of coupled, nonlinear PDEs which must be solved within an irregular domain subject to various initial and boundary conditions. In many instances, analytical solutions of the equations of fluid mechanics are limited. This is further restricted due to the imposed boundary conditions. For example, a PDE subject to a Dirichlet boundary condition (i.e., values of the de- pendent variable on the boundary are specified) may have an analytical solution. However, the same PDE subject to a Neumann boundary condition (where normal gradients of the dependent variable on the boundary are specified) may not have an analytical solution. Experimental fluid mechanics can provide some information regarding a par- ticular flowfield. However, the limitation on the hardware, such as the model and tunnel size and the difficulty in adequately simulating the prototype flowficld, makes it an impractical means of obtaining flowfields for many problems. Nevertheless, the flowfield information from experiments is valuable in validating mathematical solutions of the governing equations. Thus, experimental data is used along with computational solutions of the equations for design purposes. A technique that has gained popularity in recent years is computational (numer- ical) fluid dynamics, Of course, numerical analysis has been around for many years. However, improvements in computer hardware, resulting in increased memory and efficiency, have made it possible to solve equations in fluid mechanics using a variety of numerical techniques. These advancements have stimulated the introduction of newer numerical techniques which are being proposed almost on a daily basis. Un- like experimental fluid mechanics, the geometry and flow conditions can be easily varied to obtain various design goals. The solution that any such numerical program generates should be validated by comparing it to a set of experimental data; but Bo Introduction once its validity has been established, the program can be used for various design purposes, within the limits imposed by the assumptions on which it was based. The fundamental concept of numerical schemes is based on the approximation of partial derivatives by algebraic expressions. Once the partial differential equa- tion has been approximated by an algebraic equation, it can be solved numerically with the aid of a computer. The schemes by which the approximations to par- tial differential equations can be develoepd may be categorized into three groups. They are: finite difference (FD) methods, finite volume (FV) methods, and finite element (FE) methods. The finite difference methods are used in conjunction with structured grids, whereas the finite volume or finite element methods are typically used in conjunction with unstructured grids. The emphasis in this text is on finite difference methods, even though both finite volume and finite element methods are introduced in Volume IT. In the first seven chapters, we will explore the fundamental concepts of numerical methods used to solve PDEs, investigate how various methods are to be applied to the proposed model equations, and analyze the resulting solutions. In Chapter 8, the concepts of the computational schemes for the solution of a system of PDEs are explored. The numerical procedures introduced in the first volume are extended to the solutions of Euler, Parabolized Navier-Stokes, and Navier-Stokes equations in Vol- ume II, Furthermore, unstructured grid generation schemes, finite volume schemes, and finite element method are explored in the second volume of the text. Turbulent flows and numerical considerations for the solution of turbulent flows are provided in Volume III. Fundamental concepts and definitions are established in Chapter 20. Subsequently, the modification of the Navier-Stokes equation to include the effect of turbulence and turbulence models is introduced in Chapter 21. Compact finite difference formulation is developed in Chapter 22. Finally, Large Eddy Simulation and Direct Numerical Simulation are discussed in Chapter 23. Chapter 1 Classification of Partial Differential Equations 1,1 Introductory Remarks Since the solution procedure of a partial differential equation (PDE) depends on the type of the equation, it is important to study various classifications of PDEs. Imposition of initial and/or boundary conditions also depends on the type of PDE. Most of the governing equations of fluid mechanics and heat transfer are expressed as second-order PDEs and therefore classification of such equations is considered in this chapter. In addition, a system of first-order PDEs and a system of second-order PDEs are considered as well. 1.2 Linear and Nonlinear PDEs Partial differential equations can be classified as linear or nonlinear. In a linear PDE, the dependent variable and its derivatives enter the equation linearly, i.e., there is no product of the dependent variable or its derivatives. Individual solutions of this type of PDE can be superimposed, e.g., two solutions to the governing equation can be added together to give a third solution to the original equation. An example of a linear PDE is the one-dimensional wave equation du ou aot ot oz where a is the speed of sound which is assumed constant. On the other hand, a nonlinear PDE contains a product of the dependent vari- able and/or a product of its derivatives. Two solutions to a nonlinear equation 4 Chapter 1 cannot be added to produce a third solution that also satisfies the original equa- tion. An example of a nonlinear PDE is the inviscid Burgers equation: If a PDE is linear in its highest order derivatives, it is called a quasi-linear PDE. 1.3 Second-Order PDEs To classify the second-order PDE, consider the following equation ad ay ag pe 4 24 Aga t age cS 4 DET EG, + Fe+G=0 (1-1) where, in general, the coefficients A, B, C, D, E, F, and G are functions of the inde- pendent variables x and y and of the dependent variable ¢, Assume that ¢ = 4(z,y) is a solution of the differential equation. This solution describes a surface in space, on which space curves may be drawn, These curves patch various solutions of the differential equation and are known as the characteristic curves. Some fundamental concepts of characteristics are provided in Appendix A. By definition, the second-order derivatives along the characteristic curves are indeterminate and, indeed, they may be discontinous across the characteristics. However, no discontinuity of the first derivatives is allowed, i.e., they are continuous functions of x and y. Thus, the differentials of ¢s and ¢,, which represent changes from location (2, y) to (z+ dr, y + dy) across the characteristics, may be expressed as = bea, 4 egy — Fb a, 4 FO. E dos = on et ty w= r= e+ Fay dy (1-2) and = by an 5, Ob4 gy & a6, = Gide + SH = Chae Thay (1-3) The original equation, i.e., Equation (1-1), may be expressed as follows Fo Fo ag Aga + Bag, + Cae (1-4) where oe =-(v%% 4 5% H= (88 +E + Pe e+c) Now Equation (1-4), along with Equations (1-2) and (1-3), can be solved for the second-order derivatives of ¢. For example, using Cramer's rule, Classification of Partial Differential Equations 5 AH Cc) dz dé, 0 | ao | 0 dé wy | drdy TA BC] dz dy 0 0 dr dy Since it is possible to have discontinuities in the second-order derivatives of the dependent variable across the characteristics, these derivatives are indeterminate. Thus, setting the denominator equal to zero, (15) ABO dr dy 0|=0 (1-6) 0 de dy yields the equation a(#)'-2(#) +0=0 (7) dz dr Solving this quadratic equation yields the equations of the characteristics in physical space: (2) _ B+ BITC (8) a8 2A Setting the numerator of (1-5) equal to zero provides a set of characteristic curves in the $., dy plane. These are known as hodograph characteristics. Depending on the value of (B?—4AC), characteristic curves can be real or imaginary. For problems in which real characteristics exist, a disturbance can propagate only over a finite region, as shown in Figure 1-1. The downstream region affected by a disturbance at point A is called the zone of influence (indicated by horizontal shading). A signal at point A will be felt only if it originated from a finite region called the zone of dependence of point A (vertical shading). ‘The second-order PDE previously expressed as Equation (1-1) is classified ac- cording to the sign of the expression (B?— 4AC). It will be (a) elliptic if B® - 4a <0 (0) parabolic if B?—4AC =0 or (c) hyperbolic if B® - 4A >0 Note that the classification depends only on the coefficients of the highest order derivatives. 6 Chapter 1 1.4 Elliptic Equations Figure 1-1. Zone of influence (horizontal shading) and zone of dependence (vertical shading) of point A. A partial differential equation is elliptic in a region if (B? - 4AC) < 0 at all points of the region. An elliptic PDE has no real characteristic curves. A disturbance is propagated instantly in all directions within the region. Examples of elliptic equations are Laplace's equation a a gat i =0 (1-9) and Poisson’s equation # 2 & Fat ga few (10) The domain of solution for an elliptic PDE is a closed region, R, shown in Figure 1-2. On the closed boundary of R, cither the value of the dependent variable, its normal gradient, or a linear combination of the two is prescribed. Providing the boundary conditions uniquely yields the solution within the domain. 1.5 Parabolic Equations A partial differential equation is classified as parabolic if (B?—4AC) = 0 at all points of the region. The solution domain for a parabolic PDE is an open region, as shown in Figure 1-3, For a parabolic partial differential equation there exists one characteristic line. Unsteady heat conduction in one dimension o_ er Hae (1-11) Classificatic 7 of Partial Differential Equations and diffusion of viscosity, expressed as 2 oe = ve (1-12) are examples of parabolic PDEs. An initial distribution of the dependent variable and two sets of boundary conditions are required for a complete description of the problem. The boundary conditions are prescribed as the value of the dependent variable or its normal derivative or a linear combination of the two. The solution of the parabolic equation marches downstream within the domain from the initial plane of data satisfying the specified boundary conditions. The parabolic partial differential equation is the counterpart to an initial value problem in an ordinary differential equation (ODE). Boundary Condition Prescribed Figure 1-2. The domain of solution for an elliptic PDE. A /s Boundary Boundary ‘ondition Condition rescribe Prescribed Initial Condition Prescribed Figure 1-3, The domain of solution for a parabolic PDE. 8 _ Chapter 1 1.6 Hyperbolic Equations A partial differential equation is called hyperbolic if (B? — 4AC) > 0 at all points of the region. A hyperbolic PDE has two real characteristics. An example of a hyperbolic equation is the second-order wave equation: a} _ 20% : eo ie a A complete description of the flow governed by a second-order hyperbolic PDE requires two sets of initial conditions and two sets of boundary conditions. The initial conditions at t = 0 may be expressed as 6(2,0) = fla) and éx(2,0) = 9(2) where the functions f and g are specified for a particular problem. For a first-order hyperbolic equation, such as 94 __,2b ot ox only one initial condition needs to be specified. Note that the initial condition cannot be specified along a characteristic line. A classical method of solving a hyperbolic PDE with two independent variables is the method of characteristics (MOC). Along the characteristic lines, the PDE reduces to an ODE, which can be easily integrated to obtain the desired solution. Details of MOC and the appropriate solution schemes will not be discussed here. However, some essential elements of characteristics are provided in Appendix A. Additional materials on MOC may be found in References {1-1} or [1-2]. To illustrate classification of a second-order PDE, an example is proposed as follows: Example 1.1: Classify the steady two-dimensional velocity potential equation. (1-40) r+ dy =0 Solution: According to notations used in Equation (1-1), A=(1-M?), B=0, and C=1 Thus, (B?~4AC) = —4(1~ M?). If M < 1 (subsonic flow), then (B?-44C) <0 and the equation is elliptic. For M = 1 (sonic flow), (B?~ 4AC) = 0 and the Classification of Partial Differential Equations 9 equation is parabolic. For M > 1 (supersonic flow), (B? ~ 4AC) > 0 and the equation is hyperbolic. Now consider the physical interpretation of various classifications. Assume that a body moving with a velocity u in an inviscid fluid is creating disturbances which propagate with the speed of sound, a. If the velocity u is smaller than a, that is, if the flow is subsonic, then the disturbance is felt everywhere in the flowfield (Figure 1-4a). Note that this is what happens for an elliptic PDE. As the speed of the body u increases and approaches the speed of sound, a front is developed, with a region ahead of it which does not feel the presence of the disturbance (Figure 1-4b). This region is known as the zone of silence. Thus the disturbance is felt only behind the front. This region is known as the zone of action. When the speed u is further increased, to the extent that it exceeds the speed of sound, a conical front (in three-dimensional analysis) is formed (Figure 1-4c). The effect of the disturbance is felt only within this cone. Figure 1-4a, Propagation of disturbance in subsonic flow. Zone of silence Zone of action Figure 1-4b. Propagation of disturbance in sonic flow. 10 Chapter 1 Zone of action Zone of silence Mach con Figure 1-4c. Propagation of disturbance in supersonic flow. This conical front is known as the Mach cone in three-dimensional space or as Mach lines in two-dimensional space. Mach lines patch two different solutions of the PDE and thus represent the characteristics of the PDE. 1.7 Model Equations Several partial differential equations will be used as model equations in the fol- lowing chapters. These equations will be used to illustrate the application of various finite differencing techniques and stability analyses. By observing and analyzing the behavior of the numerical methods when applied to simple model equations, an un- derstanding should be developed which will be useful in studying more complex problems. The selected equations are primarily derived from principles of fluid me- chanics and heat transfer. However, this selection should not limit our discussion to problems in fluid mechanics. Many PDEs in science and engineering may be represented by the selected model equations investigated here. ‘The selected model PDEs which will be used in the next chapters are as follows: 1. Laplace's equation: (1-14) 2. Poisson's equation: Fo Fo _ ae F(z,y) (1-15) 3. The equation for unsteady heat conduction: or or eT z -0( +) (1-16) Classification of Partial Differential Equations Li 4. The y-component of the Navier-Stokes equation reduced to Stokes’ first prob- vem: du Fu mae (417) 5. The wave equation: ou =a (3) (1-18) 6. The Burgers equation: 2 = m (1-19) ‘These equations are expressed in one- or two-space dimensions in the Cartesian coordinate system. Some of the model equations in two-space dimensions will be reduced to one-space dimension in the upcoming discussions. In most cases, the selected model equation subject to imposed initial and bound- ary conditions has an analytical solution. In such instances, the analytical solution is used as a basis for comparison with various numerical solutions. These compar- isons are very useful in determining the accuracy of the various numerical algorithms employed. 1.8 System of First-Order PDEs ‘The equations of fluid motion are composed of conservation of mass, conserva tion of momentum, and conservation of energy. The governing equations may be expressed by partial differential equations, thus forming a system of second-order PDEs. For certain classes of problems, the governing equations are reduced to a system of first-order PDEs. For example, the equations of fluid motion for inviscid flowfields, known as the Euler equations, belong to this category. Furthermore, in some applications a higher-order PDE may be reduced to a system of first-order PDEs by introducing new viariables. In this section, the conditions under which a system of first-order PDEs is classified will be explored. Consider a set of first-order PDEs expressed in the following form Eas +i + az +¥=0 (1-20) where @ represents a vector «ft column matrix) containing the unknown variables. The elements of the coefficient matrices (A] and [B] are functions of z, y, and t; and the vector W is a function of &, x, and y. For example, a set of two first-order PDEs could be represented by the following a ou ou av Ou Bt MDG + Age + OG, +o eth (1-21) 12 Chapter 1 dv, du av, du, av Bi tot gg tage tgs thZE + a= 0 (1-22) where f a; a2 ay ay wy! 1a) GC ee w= [Sf aw [ey If the eigenvalues of the matrix [A] are all real and distinct, the set of equations is classified as hyperbolic in t and x. For complex eigenvalues of [A], the system of equations is elliptic in t and x. Similarly, the set of equations is hyperbolic in t and y if all the eigenvalues of matrix [B] are real and distinct; otherwise, for complex eigenvalues, the set of equations is classified as elliptic. If the system of equations has the following form (the steady-state form of Equation (1-20)), aie + teige +V=0, (1-23) then the set of equations is classified according to the sign of H=R?-4PQ (1-24) where P =|Aj (determinant of A), Q= (BI and a, Oy dy Oe TT by bef] bs be ee The set of first-order PDEs is hyperbolic for H > 0, parabolic for H = 0, and elliptic for H <0. This classification is presented in Ref. {1-3]. At this point, consider a general form of a system of first-order PDEs and its classification. This consideration should also clarify the origin of relation H = FR? — 4PQ, i., Equation (1-24). In the arguments to follow, the mathematical details are omitted; instead, applications are emphasized. Recall that characteristics represent a family of lines across which the properties are continuous, whereas there may be discontinuities in their derivatives. Now, define S to represent characteristic surfaces and normal to these surfaces denoted by ji. In the Cartesian system, we may write (for 2-D problems) anit ny At this point, we seek a relation whereby the number of possible characteristics may be determined. If the characteristic normals are all real, then the system is classified as hypertolic. If they are complex, then the system is elliptic. For mixed real and complex values, the system is mized elliptic/hyperbolic. The system is Classification of Partial Differential Equations 13 classified as parabolic if there is less than K real characteristics, where K is the number of PDEs in the system. To introduce the required relation, consider the following model equation: sey ae =o (1-26) A wave-like solution (characteristics direction) for the system may be obtained if |r| =0 (1-27) where (T] = [A] ne + [B] ry (1-28) For mathematical details, sec Reference (1-4]. The matrices [A] and [B] were previously defined from Equations (1-21) and (1-22). Now, matrix [T]] is formed as i= [ any ayns ] + [ any ary | [ aynztasn, dans + aan, bins bans byny Deny dims + byny bates + barry from which the determinant is computed as IT| = (asbs — bsaa)n + (arba — aabi)nz + (dibs + asbe ~ dabs — braa)nen, = 0 Divide by n? to obtain ; (asda = baa) (4) + (aybe + bs — ands ~ bite) (32) + (arba~ ani This equation may be written as a(t) n(n (@) _ Rt VR —4PQ _-RtVH Te) 2Q a) Note that the notation previously defined for Equation (1-23) is used in the equation above. Therefore it is seen that, if H > 0, the system is hyperbolic; if H <0, the system is elliptic; and if H = 0, the system is parabolic. To illustrate the procedure described above, the following applications are pro- posed. from which Example 1.2 Classify the following system of partial differential equations. Gu, dv ey 4 Chapter 1 Solution: The system may be expressed in a vector form as aq ane loi] 2-[-1 0] where Therefore, P=1, Q=1 and 11 0.0 R + 0 0 0 -1 01 Now, from Equation (1-24), H is determined as H = R’ — 4PQ = —4, Since H is negative, the system is classified as elliptic. As a second approach, Equation (1-27) may be used. For this purpose, [T] is determined as [ 0 O02, Te ty [T] = [A] nz + [B]ny = | = (T)=[A)n. + [B] ny {0 ltl 0 0 r=0 , r=L y=0 and y=H , T=T, ‘These are shown in Figure 1-5. tT se : hoe Bart jx = oy Hepa’ Figure 1-5. Sketch illustrating the imposed boundary conditions on the rectangular bar. 22 Chapter 1 1.11 Remarks and Definitions In order to solve a given PDE by numerical methods, the partial derivatives in the equation are approximated by finite difference relations. These representations of the partial derivatives are obtained from Taylor series expansions, as will be shown in the next chapter. The resulting approximate equation, which represents the original PDE, is called a finite difference equation (FDE). To illustrate the objectives and the procedures to be developed, consider a two- dimensional rectangular domain. We wish to solve a PDE within this domain subject to imposed initial and boundary conditions. The rectangular domain is divided into equal increments in the z and y directions. Denote the increments in the x direction by Aw and the increments in the y direction by Ay. Note that the increments in the x direction do not need to be equal to the increments in the y direction. These increments may be defined as mesh size, step size, or grid size. The location of mesh points, grid points, or nodes is designated by i in the x direction and by j in the y direction, The maximum number of grid points in the x and v directions are denoted by JM and JM, respectively. These nomenclatures are shown in Figure 1-6. The finite difference equation that approximates the PDE is an algebraic equa- tion. This algebraic equation is written for each grid point within the domain. The solution of the finite difference equations provides the values of the depen- dent variable at each grid point. The objectives are to study the various schemes to approximate the PDEs by finite difference equations and to explore numerical techniques for solving the resulting approximate equations. Figure 1-6. Sketch illustrating the nomenclature of computational! space. Classification of Partial Differential Equations 23 Before proceeding with an analysis of numerical techniques, it is necessary to de- fine additional terminology for concepts which will be investigated in the upcoming chapters, 1, Consistency: A finite difference approximation of a PDE is consistent if the finite difference equation approaches the PDE as the grid size approaches zero. 2. Stability: A numerical scheme is said to be stable if any error introduced in the finite difference equation does not grow with the solution of the finite difference equation. 3. Convergence: A finite difference scheme is convergent if the solution of the fi- nite difference equation approaches that of the PDE as the grid size approaches zero. 4, Laz’s equivalence theorem: For a FDE which approximates a well-posed, linear initial value problem, the necessary and sufficient condition for convergence is that the FDE must be stable and consistent. 5. The conservative (divergent) form of a PDE: In this formulation of a physical law, the coefficients of the derivatives are either constant or, if variable, their derivatives do not appear anywhere in the equation. For example, the conser- vation of mass for steady two-dimensional flow is written in conservative form as V-(¥) or in Cartesian coordinate system as 0 8 8 elas If this equation is written in expanded form as it is known as the nonconservative form of the equation. 6. Conservative property ofa FDE: If the finite difference approximation of a PDE maintains the integral property of the conservation law over an arbitrary re- gion containing any number of grid points, it is said to possess a conservative property. In closing, a few points should be emphasized. 24 Chapter 1 (a) First-order PDEs occur only occasionally in engincering problems. Al- most all first-order equations have real characteristics and thus behave much like hyperbolic equations of the second order. (b) Equations with more than two independent variables may not fit neatly into the classification of PDEs described in this chapter. However, the concepts of elliptic, parabolic, and hyperbolic can be extended to such PDEs. (c) Not all problems are expressed as purely elliptic, parabolic, or hyperbolic problems, On many occasions, a problem is expressed as a mixture of elliptic and parabolic equations, i., the governing equations are elliptic in one region and parabolic in another region of the domain. 1.12 Summary Objectives After completing this chapter, you should be able to do the following: 1. Define and give examples of: a. Linear and nonlinear PDEs b. Elliptic, parabolic, and hyperbolic PDEs ¢. Initial and boundary conditions d. The conservative form of a PDE 2. Define: a, Zone of influence and zone of dependence b. Convergence c. Consistency d. Stability 3. Solve the problems for Chapter One. Classification of Partial Differential Equations 25 1.13 Problems Classify the following second-order partial differential equations. as 8 ae Li 3a Ozdy +25 =o 12 on a: * oF oo ae 13 28 Bie Fat 14 42d, p96, 96, FH % = Saat as tt ast ay t eay Y= Determine the values of z and y to make the following partial differential equa- tions elliptic, parabolic, or hyperbolic. 1S oot +2 Ze +158 = =0 16 Fb yeh Kao LT yeh ee vs 0 18 sinz 28 + 2eos2 28 + sinz 4 =0 or Ordy 1.9 Classify the following system of equations: Gu Ly at | ae + 7a: du, du, av 26 Chapter 1 1.10 The z-component of the momentum equation for an incompressible how with zero pressure gradient is given by Assume v to be a constant. Reformulate the equation into the conservative form. 1.11 The governing equations for stationary, shallow water are expressed as du, du, oh oe ust + go = 0 "55 +’ Dy + 9D dv | dv, Oh a a a 8 = (wh) = Beluh) + 5 (vm) =0 where u and v represent the velocity components, and A represents the surface elevation. (a) Define the unknown vector Q as u Q=]e h and rewrite the system of equations in a vector form similar to (1-23). (b) Classify the system. 1.12 Classify the following system of PDEs: Oe 4 gt net an ou tu big thay = 92 Consider three cases where Classification of Partial Differential Equations 27 (a) a =) =a, = b= 1 (b)ay=h=1, b= () 4==m=1, 1.13 Consider the system (a) Reduce the system to a first-order system. (b) Write the system in a vector form. (c) Show that the system is parabolic. 1.14 A system of PDEs is given by the following: fu oz By Ou ou Pu Pu "het Bg = (Fo+ 32) oe yt 2 Oa oe ry ont * Oy where the kinematic viscosity v and the density p are constants. (a) Reduce the system to a first-order system. (b) Write the system in a vector form. (c) Classify the system. 1.15 Classify the following system of equations: 28 du, ov @ @ +05. + 5 eo 4 Yo * ay du_ dv dw ©) 357 bc” Or oy oe ou dz Oy dy oy _ dw _y Chapter 1 Chapter 2 Finite Difference Formulations 2.1 Introductory Remarks ‘The differentials of the dependent variables appearing in partial differential equations must be expressed as approximate expressions, so that a digital com- puter (which can perform only standard arithmetic and logical operations) can be employed to obtain a solution. Two methods for approximating the differentials of a function f are considered in this chapter. One method of approximation often used is the Taylor series expansion of the function f. A second method is the use of a polynomial of degree n. The Taylor series expansion will be considered first, and subsequently some examples using the polynomial representation of the function f are given. 2.2 Taylor Series Expansion Given a function f(z), which is analytical, f(x + Az) can be expanded in a ‘Taylor series about x as Az) &f On5 (2-1) (2-2) 30 _ Chapter 2 Summing all the terms with factors of Ax and higher and representing them as O(Az) (that is read as terms of order Az) yields £2) 5 oc), (2:3) OF flex & ox Az which is an approximation for the first partial derivative of f with respect to z. Graphically, as shown in Figure 2-1, this approximation may be interpreted as the slope of the function at point B, using the values of the function at points B and C. If the subscript index é is used to represent the discrete points in the z-direction, Equation (2-3) is written as of oz (2-4) This equation is known as the first forward difference approximation of Of /Ox of order (Az). It is obvious that as the step size decreases, the error term is reduced and therefore the accuracy of the approximation is increased. Now consider the ‘Taylor series expansion of f(z — Az) about z. af | (Ax)? #F (Ax) HF see Az) = sa) ~a2bl , CEL COO (28) ~ 109+ ¥ [or SE] Solving for Of /Az, of fe) fe- 89) 5 (a2) ; flx) {xt Ax) IC Figure 2-1. Illustration of grid points used in Equation (2-3). Finite Difference Formulations a1 or af! Ozh Az which represents the slope of the function at B using the values of the function at points A and B, as shown in Figure 2-2. Equation (2-6) is the first backward difference approximation of Af /dz of order (Az). Now, consider the Taylor series expansions (2-1) and (2-5), which are repeated here: (Aa)? Of , (Aa)? °F De ge G) + O(Az) (2-6) f(e+ Oz) = f(e)+ + and Ar)? af (Ar) OF fe~ 2) = f(a) aaSh CPP OO Ea 8) Subtracting Equation (2-8) ce Equation (2-7), one obtains fla+ Oa) — f(e- Az) rardl +4 aloo as fee (29) Figure 2-2. Dlustration of grid points used in Equation (2-6). Solving for 3f/8x, Of _ fet Az)- fe Az) oz 2 Of} _ fin fia @ck Wr +0(Az)* or +0(Az)? (2-10) which represents the slope of the function f at point B using the values of the function at points A and C,, as shown in Figure 2-3. This representation of Of /Ox 32 . - Chapter 2 is known as the central difference approximation of order (Az)?. Thus far, three ap- proximations for the first derivative Of /Ox have been introduced. Now, the deriva- tions of approximate expressions for the higher order derivatives are considered Again, consider the Taylor series aa Oa) OF , (Any oy (z+ Az) = f(z) + (ax) 3 on wae (2-11) Expanding by a Taylor series f(z + to about x produces the expansion f(z + 2Ac) = f(x) + (ean) Sh 4 Chay PF , (2Aa)" OF (2-12) a eo Figure 2-3. Illustration of grid points used in Equation (2-10). Multiply Equation (2-11) by 2 and subtract it from Equation (2-12), and the result is ~2fle+ Ae) + fle + 22) = se) + (day PL 4 (aay Le. as Solving for &f/8z?, Of _ flat 2a) - 2f(e+ Az) + f(z) = Toa)? +0(d2) of On8\, This equation represents the forward difference approximation for the second deriva- tive of f with respect to x and is of the order (A). A similar approximation for the second derivative can be produced using the Taylor series expansions of f(x — Az) and f(e—2Az). The result is os ox? (2-14) = 2firt fia (Ane + Ola) (2-15)

You might also like