Thompson, Warsi, Mastin - Numerical Grid Generation (523190), страница 18
Текст из файла (страница 18)
It should be understood that there is no incentive, per se, foraccuracy in the metric coefficients, since the object is simply to represent a discrete solutionaccurately, not to represent the solution on some particular coordinate system. The onlyreason for using any function at all to define the point distribution is to ensure a smoothdistribution. There is no reason that the representations of the coordinate derivatives have tobe accurate representations of the analytical derivatives of that particular distributionfunction.We are thus left with truncation error of the form(13)when the metric coefficient is evaluated numerically. As noted above, the last term occurseven with uniform spacing. The first term is proportional to the second derivative of thesolution and hence represents a numerical diffusion, which is dependent on therate-of-change of the grid point spacing.
This numerical diffusion may even be negative andhence destabilizing. Attention must therefore be paid to the variation of the spacing, andlarge changes in spacing from point to point cannot be tolerated, else significant truncationerror will be introduced.3. Evaluation of Distribution FunctionsIn Ref. [17] and Ref. [18] several distribution functions are evaluated on the basis of the sizeof the coefficients in the error expression. Some of this evaluation procedure is illustrated inthe exercises.
It appears that the following conclusions can be reached on basis of thesecomparisons:(1) The exponential is not as good as the hyperbolic tangent or the hyperbolic sine.(Implementation procedures for all three of these are given in Chapter VIII.)(2) The hyperbolic sine is the best function in the lower part of the boundary layer.Otherwise this function is not as good as the hyperbolic tangent.(3) The error function and the hyperbolic tangent are the best functions outside theboundary layer. Between these two, the hyperbolic tangent is the better inside, while theerror function is the better outside.
The error function is, however, more difficult to use.(4) The logarithm, sine, tangent, arctangent, inverse hyperbolic tangent, quadratic, andthe inverse hyperbolic sine are not suitable.Although, as has been shown, all distribution functions maintain order in the formalsense with nonuniform spacing as the number of points in the field is increased, thesecomparisons of particular distribution functions show that considerable error can arise withnonuniform spacing in actual applications. If the spacing doubles from one point to the nextwe have, approximately, x= 2x - x = x so that the ratio of the first term in Eq.(13) to the second is inversely proportional to the spacing x .
Thus for small spacing, sucha rate-of-change of spacing would clearly be much too large. Obviously, all of the errorterms are of less concern where the solution does not vary greatly. The important point isthat the spacing not be allowed to change too rapidly in high gradient regions such asboundary layers or shocks.4. Two-Dimensions FormsThe two-dimensional transformation of the first derivative is given by(14)where the Jacobian of the transformation is(15)With two-point central difference representations for all derivatives the leading term of thetruncation error is(16)where the coordinate derivatives are to be understood here to represent central differenceexpressions,e.g.,These contributions to the truncation error arise from the nonuniform spacing. The familiarterms proportional to a power of the spacing occur in addition to these terms as has beennoted.Sufficient conditions can now be stated for maintaining the order of the differencerepresentations, with a fixed number of points in each distribution.
First, as in theone-dimensional case, the ratiosmust be bounded as x , x , y , y approach zero. A second condition must be imposedwhich limits the rate at which the Jacobian approaches zero. This condition can be met bysimply requiring that cot remain bounded, where is the angle between the andcoordinate lines.
The fact that this bound on the nonorthogonality imposes the correct lowerbound on the Jacobian follows from the fact thatimplies(17)With these conditions on the ratios of second to first derivatives, and the limit on thenonorthogonality satisfied, the order of the first derivative approximations is maintained inthe sense that the contributions to the truncation error arising for the nonuniform spacing willbe second-order terms in the grid spacing.The truncation error terms for second derivatives that are introduced when using acurvilinear coordinate system are very lengthy and involve both second and third derivativesof the function f.
However, it can be shown that the same sufficient conditions, together withthe condition thatremain bounded, will insure that the order of the difference representations is maintained.It was noted above that a limit on the nonorthogonality, imposed by (17), is requiredfor maintaining the order of difference representations. The degree to whichnonorthogonality affects truncation error can be stated more precisely, as follows. Thetruncation error for a first derivative f x can be written(18)where T and T are the truncation errors for the difference expressions of f and f .Now all coordinate derivatives ncan be expressed using direction cosines of the angles ofinclination,and, of the and coordinate lines.
After some simplification, thetruncation error has the form(19)Therefore the truncation error, in general, varies inversely with the sine of the angle betweenthe coordinate lines. Note that there is also a dependence on the direction of the coordinatelines. To further clarify the effect of nonorthogonality, the truncation error terms arisingfrom nonuniform spacing are considered.The contribution from nonorthogonality can be isolated by considering the case ofskewed parallel lines with x = x=x=y=y= 0 as diagrammed below:Here (16) reduces toSince, this may be written(20)This first term occurs even on an orthogonal system and corresponds to the first term in (13).The last two terms arise from the departure from orthogonality. For <= 45° these terms areno greater than those from the nonuniform spacing.
Reasonable departure from orthogonalityis therefore of little concern when the rate-of-change of grid spacing is reasonable. Largedeparture from orthogonality may be more of a problem at boundaries where one-sideddifference expressions are needed. Therefore grids should probably be made as nearlyorthogonal at the boundaries as is practical. Note that the contribution from nonorthogonalityvanishes on a skewed uniform grid.Exercises1. Verify Eq. (4).2.
Derive Eq. (6) and (7) by repeated differentiation of Eq. (5).3. Verify Eq. (12).4. Show that the coefficient of f xxx in Eq. (12) can be reduced to a difference representationof.5. (a) Show that with an exponential distribution function,the ratio of the second term in Eq. (9) to the third term for very small spacing, s, atapproximately equal to 1/Ns at = 0 and to 1 at = N. Hint: Note that s = (x )O= 0 isapproaches zero as a approaches infinity, and that for large , /(e -1) approaches 1/e .(b) Show also that the average value of this ratio over the field is [Ns ln (1/Ns)]-1.
Hint: Notethat(c) Finally, show that the first term in Eq. (9) causes a fractional error of approximately-1/6N2ln2 (1/Ns) in f x that does not vary over the field. (Recall that this term can beeliminated by using numerical metrics, however.)6. Show that with a hyperbolic sine distribution function,the ratio of the second term in Eq. (9) to the third term for very small spacing, s, at = 0vanishes at = 0 and is approximately equal to 1 at = N.
Show also, however, that themaximum value of this ratio occurs near /N = 0.9/ln (2/Ns) and is approximately equal to1/2Ns. Finally, show that the average value of the ratio over the field is equal to[Nsln(2/Ns)]-1. Hint: See the preceding exercise. (Note that this distribution gives a smallererror due to the rate-of-change in the spacing than does the exponential distribution of thepreceding exercise and is particularly advantageous near = 0 where the spacing is thesmallest.)7. Show that with a hyperbolic tangent distribution function,the ratio of the second term in Eq. (9) to the third term for very small spacing, s, at = 0 isapproximately equal to 1/2Ns at = 0 and vanishes at = N.
Show also that the average ofthis ratio over the field is the same as for the hyperbolic sine distribution of the precedingexercise. This distribution is thus also superior to the exponential distribution.8. With the distribution function of the form of Eq. (1), show that the truncation error in Eq.(3) is a power series in inverse powers of N. (Hint: see Ref. [17]).9. Verify Eq. (17).10. Expand the differences f and f of Eq. (14) in Taylor series about the grid point xij.Substitute these expansions back in Eq.