Download as pdf
Download as pdf
You are on page 1of 13
em pretEeviyzon CHAPTER 4 BASIC ASPECTS OF DISCRETIZATION Numerical precision is the very soul of science, Sir D'Arcy Wentworth Thompson, Scottish biologist and natural scientist, 1917 4.1 INTRODUCTION The word) “discretization” requires some explanation. Obviously, it comes fom ct defined in The American Heritage Dictionary of the English Language dividual; distinct; consisting of unconnected distinct parts.” However, the word “discretization” cannot be found in the same dictionary; it cannot be found in Webster's New World Dictionary either. The fact that it does not appear in two of the most popular dictionaries of today implies, at the very least, that it is a rather new and esoteric word. Indeed, it seems to be unique) to the literature of numerical analysis, first being introduced in the German literature in 1955 by W. R. Wasow, carried on by Ames in 1965 in his classic book on partial differential equations (Ref. 24), and recently embraced by the found in Refs. 13, 14, and 16. In essence, discretization is the process by which a closed-form mathematical expression, such as a function or a differential or integral equation involving functions, all of which are viewed as having an infinite continuum of values throughout some domain, ‘a analogous (but different) expressions which prescribe values at only ‘number of discrete points or volumes in the domain. This may sound a bit mysterious, so let us elaborate for the sake of clarity. Also, we will single out partial differential equations for purposes of discussion. Therefore, the remainder of this introductory section dwells on the meaning of “discretization.” 125 126. aasic aspects oF piscreTiZaTION of partial differential equations i closed-form ich give the variation of the dependent va throughout the domain. dn contrast, numerical solutions can give answers at only discrete points in the domain, called grid points. For example, consider Fig. 4.1, Which shows @ section of a discrete grid in the xy plane. For convenience, let us that the -and that the s ein ate ve spacing in bh cretion, where is dierent value between ech sueesve pairs of grid points, and similarly for Ay. However, the majority of CFD applications olve numerical solutions on a grid which contains spacing in each n, because this greatly simplifies the pr of th storage space, and usually results in greater accuracy. ci t ‘(ave to occur in he GRIM 2°: as is frequently done in CFD, the numerical calculations are carried out in a transformed computational space which has uniform spacing in the transformed independent variables but which corresponds to nonuniform spacing in the physical plane. These matters will be discussed in detail in Chap. 5. In any event, we will assume uniform spacing in cing fc we will assume Av and Ay'to but qual Aye (We should note that recent reseatch in CFD has focused on unstructured gtids, where the grid points are placed in the flow field in a very irregular fashion; this is in contrast to a structured grid which reflects’some type of consistent geometrical regularity. Figure 4.1 is an example of a structured grid. Some aspects of unstructured grids will be discussed in Chap. 5.) Returning to Fig. 4.1, /hich fins in ee anidjan inde ich y . Hence, if (i, f) is the index for point P in Fig. 4.1, then the point immediately to the right of P is labeled as (i + 1, J), the point immediately to the left is @ — 1, /), the point directly above is (47+ Vy and the point directly below is (i,j = 1). FIG. 4.1 Discrete grid points. iwrropuction 127 equations, or as the case may be, the Euler equations, as derived in Chap. 2. These An analytical solution of these equations would provide, in principle, closed-form expressions for u, v, p, p, etc., a8 functions of x and yp which could be used to give values of the flow-field vatiables at any point we wish to choose in the flow, ie., at any of the infinite number of (x, y) points in the domain. On the other hand, if the partial derivatives in the governing equations are replaced by approximate algebraic difference quotients (to be derived in the next section), whete the algebraic difference quotients are ssed strictly in terms of the flow-field variables at wo or more ofthe discete gra points shown in Fig. 4.1, then the partial differential equations are totally replaced by a system of pay equations which can bi for the vi . Moreover, this method of discretization is called the es. Finite-difference solutions are widely employed in CFD, and hence much of this chapter will be devoted to matters concerning finite differences. So this is what discretization means. Al of discretization. The purpose of this chapter is to derive and discuss the more common forms of discretization in use today for finite-difference applications. This constitutes one of the three main headings in Fig. 4.2, which is the road map for this Diseretization techniques Finite Finite Finite difference volume element Basic derivations Basic derivations of finite differences: of finite-volume order of accuracy | | equations (Problem 4.7) difference equations: truncation errors ‘Types of solutions explicit and implicit Stability analysis FIG. 42 Road map for Chap. 4. 128 Basic aspects OF DISCRETIZATION chapter. The seeofd and thiflimain headings are labeled finite Volume and finite respectively. Both fi been in widespread use in Computational mechanics for years. H s or finite-element methods in this book, mainly because of The essential aspects of finite volume discretization are dealt with via Problem 4.7 at the end of this chapter. It is important to note that CRD caf be) a using any fi 42. Examining the road map in Fig. 4.2 further, the purpose of the present chapter is to construct the basic discretization formulas for finite differences, while at the same time addressing the order of accuracy of these formulas. The road map in Fig. 4.2 gives us our marching orders—let’s go to 4.2 INTRODUCTION TO FINITE DIFFERENCES Here, we are interested in feplacing a partial/detivative with/alSuitable algebraié ‘difference quotient, ic. a finite difference. Most common finite-difference repre- \sentations of derivatives are based on s. For example, referring to Fig. 4.1, component of velocity at point (i, /), then the velocit expanded about point Wey = + (5), (4.1) +(e 1 Equation (4.1) if () the number of | terms aad Seopa AMAT TRAD Example 4.1. Since some readers may not be totally comfortable with the concept of a Taylor series, we will review some aspects in this example, enmas an a ee 2 ——-. ith all derivatives So crn Gnaljoat tr oF pe es (ax? af (Axy" Fort Ax) =flx) + 5 Ae + Qt ge gt [Note in Eq. (E.1) that we continue (0 use the partial derivative nomenclature to be consistent with Eq, (4.1), although for a function of one variable, the derivatives in Eq. (E.1) are really ordinary derivatives.] The significance of Eq. (E.1) is diagramed in Fig. E4.1 that we know the value of fat x (point 1 in Fig. E4.1); we want to calculate the value of fat x + Ax (point 2 in Fig. E4.1) using Eq. (E.1). Examining the right-hand side of Eq. (E4.1), we see that the first term, f(x), is not a good guess for J (x + Ax), unless, of course, the function f (x) is a horizontal line between points 1 and 2. An improved guess is made by approximately accounting for the slope of the curve at point 1, which is the role of the second term, O//0x Ax, in Eq. (E.1). To obtain an even better estimate of fat x + Ax, the third term, 0°//0x" (Ax)"/2, is added, which approximately accounts for the curvature between points 1 and 2. Im|genéfal, to obtain (E1) INTRODUCTION To FINITE o1rFERENCES 129 Sorayese) + Lar + % oT wont een ‘eocane FIG. E4.1 Tlustration of behavior of the first —— three terms in a Taylor series (for ae Example 4.1) uded. Indee carried on the right-hand side. To examine some numbers, let f(x) = sin 2m Atx=02: f(x) =0.9511 (£2) This exact value of f (0.2) corresponds to point 1 in Fig. E4.1, Now, let Ax = 0,02, We wish to evaluate f(x + Ax) = (0.22), From Eq. (E.2), we have the exact value: Atx=0.22: f(x) = 0.9823 This corresponds to point 2 in Fig. E4.1. Now, let us estimate f (0.22) using Eq. (E.1). Using just the first term on the right-hand side of Eq, (E.1), we have f (0.22) = f(0.2) = This corresponds to point 3 in Fig. E4.1, The percentage error in this estimate is [(0.9823 — 0.9511)/0.9823] x 100 = 3.176 percent. Using two terms in Eq, (E.1), 9511 Set Ax) = f(x) + Zar F(0.22) = f(0.2) + 20s [27(0.2)](0.02) 70.9511 +0.388 = 0.9899 This corresponds to point 4 in Fig. E4.1, The percentage error in this estimate is [0.9899 — 0.9823)/0.9823] x 100 = 0.775 percent. This is much closer than the previous estimate, Finally, to obtain yet an even better estimate, let us use three terms in Eq, (E.1). 130. aasic aseacts oF oiscerrzation OF (Ax)? Oe 2 ‘£(0.22) ~ f (0.2) + 2mc0s [2(0.2)|(0.02) — 4x” sin {2n(0.2)| ——— 0.9511 + 0.0388 — 0.0075 = 0.9824 This corresponds to point 5 in Fig. E4.1. The percentage error in this estimate is (0.9824 — 0.9823)/0.9823] x 100 = 0.01 percent. This is a very close estimate of f(0.22) using just three terms in the Taylor series given by Eq. (E.1). set dx) ste) + Laws BF (oon Let us now return to Eq. (4.1) and pursue our discussion of finite-difference representations of derivatives. SOIR Eq. (4.1) for(OWOX)g), we dbtain au) _iviy—my (Pu) Ax (Ow) (Ax)? (&),, ‘Ar ar),,2 \as),, 6 * 62) ee Finite- difference ‘Truncation error representation he sl AEA RST GES The firsfiiterm/on the right side, namely, (+1) — uj, VAX, is a finite- difference representation of the partial derivative. The remaining terms on the right side constitute the truncation error, That is, if we wish to approximate the partial derivative with the above algebraic finite-difference quotient, Quy Misty = Mis ( ae py Hh (43) then the truncation erfomin Eq. (4.2) tells us what is being neglected) in this TE, (4.2) the lowesvorder term inthe approximation. the ‘Ax to the first power; hence, the finite-difference expression in Eq. (4.3) is called stordeaccurate, We can more formally write Eq, (4.2) as OuN _ Mivy — Ms @ , + O(Ax) (4.4) In Eq, (4.4), the syiibolO(Ax) isa fo tion which ts “emsororden Ax.” Equation (4.4) Stich d. AS a result, the finite difference in Eq. (4.4) is called a forward) Gj) is uses difference. For this reason, we now i urate difference representation for |, expressed by Eq. (4.4) as a first-order forward difference, repeated below. INTRODUCTION TO FINITE OIFFERENCES 131. Bix aN (&) aa” G3) Mig Lj — Mig De + O(Ax) J Gs) 44,3) Let us now waite a/Taylor series expansion for upaigy, expanded about Wj moins (5) a9 +( Pu “Ge, or Ou Pu\ (Ax? @Pu\ (Ax) (43) - ) ce bx Mv KN (Golving, for (@ulORy, we obtain “ey a = (itn) 3) 4413) @),- ce 43 4 O(Ax) (4.6) to the rearward (or backward) difference. sa result, The information) used in forming the finite-difference quotient in Eq. (4.6) comes from tele of i pin th se el ea ite difference in Eq. (4.6) is called a the in the trunca- tion error involves Ax to the first power. As a result, the finite difference in Eq. (4.6) is called a curacy is fot Sufficient To construct a finite-difference quotient of second-order accuracy, simply subtract Eq. (4.5) from Eq, (4.1): Ou ®u\ (Ax)? ons mas=2 ) as+2(F5) ay, hy hy) Equation (4.7) can be written as (3) = MHI MAY O(Ayy? i C443) fe) G43) (48) Ox, 2Ax The information used in forming the finite-difference quotient in Eq, (4.8) comes from hoth sides Of the grid point located at (i,,); that is, it uses upynyjas well as j=, Grid point (i, falls between the two adjacent grid points, Moreover, in the 132 _aasic asrects oF piscaeniZarion truncation error in Eq. (4.7), the lowest-order terms involves (Ax)’, which is second- order accuracy. Hence, the finite-differenice quotient in Eq. (4.8) is called a second- order central difference. ‘he derivatives arejobtainedinexactly the’ same fashion. (See Prob. 4.1 and 4.2.) The results are directly analogous to the previous equations for the x derivatives. They are: ee + O(Ay) Forward difference (4.9) (2) _ wee + 0(Ay) Rearward difference (4.10) hy) ara +O(Ay)? Central difference, (4.11) Equations (4.4), (4.6), and (4.8) to (4.11) are examples of finite-difference quotients for first partial derivatives. Is this all that we need for CFD?\Let us return to Chap. 2 for a moment and tak€a@l0oK at the governi ion. If we mily, the governing equations are the Euler b summarized = 2.8.2 and expressed Eqs. (2.82) to (2.86). Note that the highest-order derivatives which such as those expressed by s. (4.4), (4.6), and (4.8), at s. On the if we are dealing with the governing equations are the Navier-Stokes equations, summarized in Sec. 2.8.1 and expressed by Eqs. (2.29), (2.50), (2.56), and (2.66). Note that the “highest-order_ defitves “which appear in the Navier-Stokes equations (ate flect appears in Eq. (2.66). anded, these terms such second partial derivatives as just for example. there is a r derivatives oes CFD. We can such fini -xpression: ith a TAylORSEHGs analysis, as follows. Summing the Taylor series expansions given by Eqs. (4.1) and (4.5), we have Pu tw (Ax)* yt Maa = 2m, +(33) ay +(F ) + Mra tinny = Why +55 ) i 2 Solving for (2’w/Ax),, ;, Pu Uy, 2a + Mi Mi us Ol 4. (Fi) ot = In Eq. (4.12), the first term on the right-hand side is a central finite difference for the second derivative with respect to x evaluated at grid point (i, /); from the remaining order-of-magnitude term, we see that this central difference is of second-order INTRODUCTION TO FINITE DIFFERENCES 133 accuracy. An analogous expression can easily be obtained for the second derivative with respect t oH hai — Why + my 3) a Mast Das aad ae 4 0(Ay)? (4.13) td Equations (4.12) and (4.13) are examples of second-order Central second differences. the case of mixed, derivatives, such as PulOx’dy, appropriate finite- difference quotients c: \d as follows. Differentiating Eq. (4.1) with respect toy, we have Ow ‘ou ou) ( Ou ) (Ax? ( Ou ) (Ax? = +H Art + spoon Bani 6), Gry hj \OP y),, 2 "Oe w/),, 6 (4.14) Differentiating Eq. (4.5) with respect to y, we have CB)... @), Cera), 8 ee) atu \ (Ax) (3 hace ° (4.15) Subtracting Eq. (4.15) from Eq. (4.14) yields Es (%) (2 , ( ou ) (Ax)* > -(— =2(-—]} Art + G ing \OPAina3 — \O8 Ov); ax Ay}, ; 6 SELLER, which is the mixed derivative for which We are seeking’a finite-difference expression, the above equation yields es) - Ooo OUP E (en), In Ea 16), the i tm ihehandsde involves Ou, Heese at gtid point (i + 1, j) and then at grid point (i ~ 1, j). Returning to the grid sketched in Fig. 4.1, we can see that Gu/Oy at each of these two grid points can be replaced with a second-order central difference patterned 11) but . To be “more specific, in Eq. (4.16) first replace (OwAy),.+1, ; with a) Up jet shied +4 [| eae OG: G Heh) aa ca (4.16) 134 Basic ASPECTS OF DISCRETIZATION Sea ae aS ag dt and then replace (Jwdv);1,, with the analogous difference, (ne a ny] a vj ee an In this fashion, Eq, (4.16) becomes N a LUr—s—S—e—SOOCOC_ONsNN Ox Ov), 4dx Ay (4.17) 2 + O[(ax)?, (Ay)"] » fiafan a Ax in Eq. (4.11) is of O(Ay), Hence, the in Eq. (4.17) must/be Ofary, any) Equation (4.17) gives a second-order central difference for the mixed derivative, (Pw/x Oy), It is important to note that when the governing flow equations are used in the form of Eq. (2.93), only first derivatives are needed, even for viscous flows. The dependent variables being differentiated are U, F, G, and H in Eq, (2.93), and only as first derivatives. Hence, these derivatives can be replaced with the appropriate finite- difference expressions for first derivatives, such as Eqs. (4.4), (4.6), and (4.8) to (4.11). In turn, some elements of F, G, and H involve viscous stresses, such as t,., ‘Tx, and thermal conduction terms. These terms depend on velocity or temperature gradients, which are also first derivatives. Hence, the finite-difference forms for first derivatives can also be used for the viscous terms inside F, G, and H. In this fashion, the need to use a finite-difference expression for second derivatives, such as Eqs. (4.12), (4.13), and (4.17), is circumvented. To this stage, we have derived a number of different forms of finite-difference expressions for various partial derivatives. To help reinforce these finite differences in your mind, the graphical concept of finite-différence modules is useful. LoS eae eR Te et context of t in Fig. 4.3. This figure is a cea wellaiustatng on geil especie gd of each finite diference n hese participating gtid points are shown by large filled circles connected by bold lines; schematic isicalledwfinite-ifference module. The jin ‘The-truncation @fror in Eq. (4.17) (Comes from Eq. (4.16), where the “order ied term is of O(Ax), gn the fact that the o similarly, a (—2) beside a grid point connotes that twice the variable at that grid point is subtracted in the formation of the finite-difference quotient. Compare the (+), (—), and (—2) in the finite-difference modules with the corresponding formula for the finite difference which appears to the left of each module in Fig. 4.3. The finite-difference expressions derived in this section and displayed in Fig. 4.3 represent just the “tip of the iceberg.” Many other difference approximations can be obtained for the same derivatives we treated above. In particular, more INTRODUCTION To FINITE DivERENCES 135 Firstorder forward difference with respect. tox raved uy Mad = ey Ar marward (Zt) = Hatt co) +) with respect tox Second-order central difference with respect tox FIG. 43 Finite-difference expressions with their appropriate finite-difference modules. accurate finite-difference quotients can be derived, exhibiting third-order accuracy, fourth¢order accuracy, and more. Such higher-order-accurate difference quotients generally involve informationyat more grid points than those we have derived. For example, a fourth-order-accurate central finite-difference for P°u/dx" is () tia tN — 30M + 16H Hs, Oat (48) ar), 12(An)? Note that information at five grid points is required to form this fourth-order finite difference; compare this with Eq. (4.12), where (0°u/0x°), ; is represented in terms of information at only three grid points, albeit with only second-order accuracy. Equation (4.18) can be derived by repeated application of Taylor’s series expanded about grid points (/ + 1, /), (i,j), and (i — 1, {); the details are considered in Prob. 4.5, We are simply emphasizing that an almost unlimited number of finite-difference expressions can be derived with ever-increasing accuracy. In the past, second-order accuracy has been considered sufficient for most CFD applications, so the types of difference quotients we have derived in this section have been, by far, the most 136 Basic aspects oF DISCRETIZATION Second-order central difference with respect toy Met = Ms 2ay 4 Secoid-order a, ein 22st Ms second (ap, = ay difference with respect toy Seoond- order central (24) Meyert wins tendt tess mixed \3xay/, “ax Ay | R = Z respect - toxandy Gy EL FL reeled FIG. 43. (continued) 2D ecw OTIW Ws (SO) D> “\L> \ deustore AW Cour vee Q J ) : aw

You might also like