c19-2 (779617)
Текст из файла
19.2 Diffusive Initial Value Problems847Roache, P.J. 1976, Computational Fluid Dynamics (Albuquerque: Hermosa). [7]Woodward, P., and Colella, P. 1984, Journal of Computational Physics, vol. 54, pp. 115–173. [8]Rizzi, A., and Engquist, B. 1987, Journal of Computational Physics, vol. 72, pp. 1–69.
[9]Recall the model parabolic equation, the diffusion equation in one spacedimension,∂∂u∂u=D(19.2.1)∂t∂x∂xwhere D is the diffusion coefficient. Actually, this equation is a flux-conservativeequation of the form considered in the previous section, withF = −D∂u∂x(19.2.2)the flux in the x-direction. We will assume D ≥ 0, otherwise equation (19.2.1) hasphysically unstable solutions: A small disturbance evolves to become more and moreconcentrated instead of dispersing.
(Don’t make the mistake of trying to find a stabledifferencing scheme for a problem whose underlying PDEs are themselves unstable!)Even though (19.2.1) is of the form already considered, it is useful to considerit as a model in its own right. The particular form of flux (19.2.2), and its directgeneralizations, occur quite frequently in practice. Moreover, we have already seenthat numerical viscosity and artificial viscosity can introduce diffusive pieces likethe right-hand side of (19.2.1) in many other situations.Consider first the case when D is a constant. Then the equation∂u∂2u=D 2∂t∂x(19.2.3)can be differenced in the obvious way: n− unjun+1uj+1 − 2unj + unj−1j=D∆t(∆x)2(19.2.4)This is the FTCS scheme again, except that it is a second derivative that has beendifferenced on the right-hand side.
But this makes a world of difference! TheFTCS scheme was unstable for the hyperbolic equation; however, a quick calculationshows that the amplification factor for equation (19.2.4) isk∆x4D∆t2(19.2.5)sinξ =1−(∆x)22The requirement |ξ| ≤ 1 leads to the stability criterion2D∆t≤1(∆x)2(19.2.6)Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).19.2 Diffusive Initial Value Problems848Chapter 19.Partial Differential EquationsThe physical interpretation of the restriction (19.2.6) is that the maximumallowed timestep is, up to a numerical factor, the diffusion time across a cell ofwidth ∆x.More generally, the diffusion time τ across a spatial scale of size λ is of orderλ2D(19.2.7)Usually we are interested in modeling accurately the evolution of features withspatial scales λ ∆x.
If we are limited to timesteps satisfying (19.2.6), we willneed to evolve through of order λ2 /(∆x)2 steps before things start to happen on thescale of interest. This number of steps is usually prohibitive. We must thereforefind a stable way of taking timesteps comparable to, or perhaps — for accuracy —somewhat smaller than, the time scale of (19.2.7).This goal poses an immediate “philosophical” question. Obviously the largetimesteps that we propose to take are going to be woefully inaccurate for the smallscales that we have decided not to be interested in. We want those scales to dosomething stable, “innocuous,” and perhaps not too physically unreasonable. Wewant to build this innocuous behavior into our differencing scheme.
What shouldit be?There are two different answers, each of which has its pros and cons. Thefirst answer is to seek a differencing scheme that drives small-scale features to theirequilibrium forms, e.g., satisfying equation (19.2.3) with the left-hand side set tozero. This answer generally makes the best physical sense; but, as we will see, it leadsto a differencing scheme (“fully implicit”) that is only first-order accurate in time forthe scales that we are interested in.
The second answer is to let small-scale featuresmaintain their initial amplitudes, so that the evolution of the larger-scale featuresof interest takes place superposed with a kind of “frozen in” (though fluctuating)background of small-scale stuff. This answer gives a differencing scheme (“CrankNicholson”) that is second-order accurate in time. Toward the end of an evolutioncalculation, however, one might want to switch over to some steps of the other kind,to drive the small-scale stuff into equilibrium. Let us now see where these distinctdifferencing schemes come from:Consider the following differencing of (19.2.3)," n+1#un+1uj+1 − 2un+1− unj+ un+1jjj−1=D(19.2.8)∆t(∆x)2This is exactly like the FTCS scheme (19.2.4), except that the spatial derivatives onthe right-hand side are evaluated at timestep n + 1.
Schemes with this character arecalled fully implicit or backward time, by contrast with FTCS (which is called fullyexplicit). To solve equation (19.2.8) one has to solve a set of simultaneous linear. Fortunately, this is a simple problem becauseequations at each timestep for the un+1jthe system is tridiagonal: Just group the terms in equation (19.2.8) appropriately:n+1n−αun+1− αun+1j−1 + (1 + 2α)ujj+1 = uj ,j = 1, 2...J − 1(19.2.9)whereα≡D∆t(∆x)2(19.2.10)Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.
Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).τ∼84919.2 Diffusive Initial Value Problems∂2u=0∂x2(19.2.11)What about stability? The amplification factor for equation (19.2.8) is1ξ=21 + 4α sink∆x2(19.2.12)Clearly |ξ| < 1 for any stepsize ∆t.
The scheme is unconditionally stable. The detailsof the small-scale evolution from the initial conditions are obviously inaccurate forlarge ∆t. But, as advertised, the correct equilibrium solution is obtained. This isthe characteristic feature of implicit methods.Here, on the other hand, is how one gets to the second of our above philosophicalanswers, combining the stability of an implicit method with the accuracy of a methodthat is second-order in both space and time. Simply form the average of the explicitand implicit FTCS schemes:un+1− unjDj=∆t2"n+1nnn(un+1+ un+1j+1 − 2ujj−1 ) + (uj+1 − 2uj + uj−1 )(∆x)2#(19.2.13)Here both the left- and right-hand sides are centered at timestep n + 12 , so the methodis second-order accurate in time as claimed.
The amplification factor isk∆x1 − 2α sin2ξ=k∆x1 + 2α sin222(19.2.14)so the method is stable for any size ∆t. This scheme is called the Crank-Nicholsonscheme, and is our recommended method for any simple diffusion problem (perhapssupplemented by a few fully implicit steps at the end). (See Figure 19.2.1.)Now turn to some generalizations of the simple diffusion equation (19.2.3).Suppose first that the diffusion coefficient D is not constant, say D = D(x). We canadopt either of two strategies.
First, we can make an analytic change of variableZy=dxD(x)(19.2.15)Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited.
To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).Supplemented by Dirichlet or Neumann boundary conditions at j = 0 and j = J,equation (19.2.9) is clearly a tridiagonal system, which can easily be solved at eachtimestep by the method of §2.4.What is the behavior of (19.2.8) for very large timesteps? The answer is seenmost clearly in (19.2.9), in the limit α → ∞ (∆t → ∞).
Dividing by α, we see thatthe difference equations are just the finite-difference form of the equilibrium equation850Chapter 19.Partial Differential Equationst or n(a)Fully Implicit(b)x or j(c)Crank-NicholsonFigure 19.2.1. Three differencing schemes for diffusive problems (shown as in Figure 19.1.2). (a)Forward Time Center Space is first-order accurate, but stable only for sufficiently small timesteps.(b) Fully Implicit is stable for arbitrarily large timesteps, but is still only first-order accurate.
(c)Crank-Nicholson is second-order accurate, and is usually stable for large timesteps.Then∂∂u∂u=D(x)∂t∂x∂x(19.2.16)1 ∂2u∂u=∂tD(y) ∂y2(19.2.17)becomesand we evaluate D at the appropriate yj . Heuristically, the stability criterion (19.2.6)in an explicit scheme becomes"#(∆y)2(19.2.18)∆t ≤ minj2Dj−1Note that constant spacing ∆y in y does not imply constant spacing in x.An alternative method that does not require analytically tractable forms forD is simply to difference equation (19.2.16) as it stands, centering everythingappropriately. Thus the FTCS method becomes− unjun+1Dj+1/2 (unj+1 − unj ) − Dj−1/2 (unj − unj−1 )j=∆t(∆x)2(19.2.19)whereDj+1/2 ≡ D(xj+1/2 )(19.2.20)Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.
Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).FTCS19.2 Diffusive Initial Value Problems851and the heuristic stability criterion is(∆x)2∆t ≤ minj2Dj+1/2(19.2.21)Dj+1/2 =1D(unj+1 ) + D(unj )2(19.2.22)Implicit schemes are not as easy.
Характеристики
Тип файла PDF
PDF-формат наиболее широко используется для просмотра любого типа файлов на любом устройстве. В него можно сохранить документ, таблицы, презентацию, текст, чертежи, вычисления, графики и всё остальное, что можно показать на экране любого устройства. Именно его лучше всего использовать для печати.
Например, если Вам нужно распечатать чертёж из автокада, Вы сохраните чертёж на флешку, но будет ли автокад в пункте печати? А если будет, то нужная версия с нужными библиотеками? Именно для этого и нужен формат PDF - в нём точно будет показано верно вне зависимости от того, в какой программе создали PDF-файл и есть ли нужная программа для его просмотра.















