KUNDU Fluid Mechanics 2 Episode 10 ppsx

45 138 0
KUNDU Fluid Mechanics 2 Episode 10 ppsx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

During the past four decades direrent types of numerical methods have been developed Lo simulatc fluid flows involving a widc range of applications. These methods include finite diffcrence, finite elemenl, finitc volume, and spectral methods. Some of them will be discussed in this chapter. The CFD predictions are never completely exact. Becausc many sources ofcm~r arc involved in the predictions, onc has to be veiy careful in interpreting the results produced by CFD techniques. The most common sourccs of error are: Discretiwtiun error. This is intrinsic to all numerical methods. This error is incurred whenever a condnous system is approximated by a discrete one where a finite number of localions in space (grids) or instants of time may have been used to resolve the flow field. Different n~imerical schcmes may have diKercnt orders or inagnitudc of the discretization error. Evcn with the same method, the discretization error will be different depcnding upon the distribulion of the grids uscd in a simulation. hi most applications. one needs to propcrly select a numerical method and choose a grid to control this error lo an acceptable level. lnput chtu ermr. This is due to the fact that both flow geomctry and fluid properties may be kuown only in an approxiinated way. lriittrrl and boundary condition ei-rui It is common that the initial and bound- ary conditions of a flow field may represent thc rcal situation too crudely. For example, flow information is needed at locations whcrc fluid enters and leaves the flow geometiy. Flow properties generally an: not known exactly and are thus only approximate. Mudelinng errar. More coniplicatcd flows may involve physical phenomcna that are not perfectly described by currcnt scientific theories. Models uscd to solve these problems cerlainly contain eimm, for example, turbulcncc modeling. atmospheric modeling, problems in multiphase flows, elc. As a rcsearch and design tool, CFD normally complements experimcntal and theoretical fluid dynamics. Howcvcr, CFD has a number of distinct advantages: It can be produced iiiexpensively and quickly. While the price of most items is increasing, computing costs are falling. According to Moore's law ba,ed on thc uhscrvation of the data for the last 40 years, CPU power will double cvcry 18 months into the foreseeable €urnre. It gcncratcs coinplctc informatioii4FD produces detailed and cornprehen- sive information of all relevant variables throughout the domain of interest. This information can also be easily accessed. It allows easy change of the paranieters-0 permits input parameters to be varied easily over wide ranges, thereby facilitating design opthnizarion. Tt has the ability to simulate realistic conditions-CFD can simulate flows directly under practical conditions, unlike experiments, where a small-scale or a large-scale model may be needed. It has the ability to simulate ideal conditions C.FD provides the convenience of switching off certain terms in the governing cquations, which allows onc to focus attention on a few essential parameters and eliminalc all irrelevant featurcs . 0 It permits exploration or unnatural eventPFD allows events to be studied that every atleinpt is madc to prcvent, for example, conflagrations, explosions, or nuclcar power plant failures. 2. IfTriitk IXfim?rtCt! ihthtJd The key to various nuinerical methods is to convert the partial diffcrent equations that govern a physical phenomenon into a system of algebraic cquations. Different techniques are available for this conversion. The finite difference method is onc of the most commonly used. Approximation to Derivatives Consider the one-dimensional transport cquation, (1 1.1) This is the classic convection-dilhsion problem for T(x, t), where II is a convective velocity and D is a diffision cocfficient. For simplicity, let us assumc that u and D are two constants. This cquation is written in nondiinensional form. The boundary conditions for this problem arc aT JX T(0. t) = g and -(I,, r) = 4: (1 1.2) where g and q are the two constants. The initial condition is T(x, 0) = Ti(x) for 0 < x < L, (11.3) when. To(x) is a given function that satisfies the boundary conditions (1 1.2). Let us first discretize transport equation (1 1.1) on a uniForm grid with a grid spacing Ax, as shown in Figure 11 .l. Equation (1 1.1) is evaluated at spatial location x = .T; and time t = t,,. Dcfine T(x;, t,,) as die exact value of T ai location x' = xi and time r = t,,, and let bc its approximation. Using thc Taylor series cxpansion, ta+i . - tn . t,- I - I - . - - . . - Ax Ax - - I -0 Xi-, Xi Xi+l xn= L - Figure 11.1 Unifonn grid in spdcc md time. we have where 0 (Ax') means terms of the order of Ax'. Therefore, the first spatial derivativc may be approximated as T;l - q!l + O(As) (forward difference) [E]:= Ax ly - T:l + O(A.r) (backward difference) - - AX - q.1,. - - + O(AX~) (central difference), (11.6) 2Ax and the second-order dcrivative may be approximated as - 2111' + T!:, + O(As2). AX2 (1 1.7) The orders of accuracy of the approximalions (truncation errors) are also indicated in the expressions of Eqs. (1 1.6) and (1 1.7). Mom accurate approximations generally rcquire more values of thc variable on the neighboring grid points. Similar cxpressions can be derived for nonuniform grids. In the same fashion, thc time derivative can be discrctized as (11.8) where At = tfl+l - rl, = tfl - i,, 1 is the constant timc step. Discretization and its Accuracy A discretization of the transport equation (1 1.1) is oblaincd by evaluating the equation at fixed spalid and tcmpod grid points and using the approximations for thc individ- iial derivative terms listed in the prcccding. When the first expression in Eq. (1 1.8) is used, together with Eq. (1 1.7) and the central difference in Eq. (I I .6), Eq. (1 1 .I) may be discretized by q"+l - y + * q;] - y-l - Til - 2y + TL1 + 0 (At, Ax'), (1 1.9) - At 2Ax Ax2 or whcrc At At 2Ax ' Ax2. a=U- B=D- (1.1.11) Once the values of are known, starting with the initial condition (1 1.3), the expres- sion (1 1.10) simply updatcs thc variablc for thc ncxt timc stcp r = ?,,-I. This scheme is how as an explicit algorithm. The discretization (1 1.10) is fist-order accurate in lime and second-order accurate in space. As another example, when the backward difference expression in (1 1.8) is used, we will have or q1 +cx(q;l - TY1) - /3(q;l - 227 + TY]) 2 Ti"-'. (1 1-13) At each time step r = tn, here a syskm or algebraic cquations needs to be solved to advancc thc solution. This schcmc is known as an implicit algorithm. Obviously, for the same accuracy, the explicit schemc ( I 1.10) is much simpler than the implicit one (1 1.13). Howcvcr, thc cxplicit schcmc has limitations. Convergence, Consistency, and Stability The result €om he solution of the cxplicit scheme (11.10) or the implicit scheme (I 1.13) represents an approxiinale numerical solution to the original partial differen- tial equation ( 1 1.1). One certainly hopes that hc approximate solution will be close to thc cxact one. Thus we introduce the concepts or camreigence, cunsisteizcy, and stability of the numerical solution. The approximate solution is said to hc conveqpt if it approaches the exact solution, as the grid spacings Ax and At tcnd to zero. We may dehe the solution error ;is the difference between thc approximate solutioii and the exact solution, e: = T/' - T(xi, r,,). ( 1 1.14) Thus the approximate solution convcrgcs when cy 4 0 as Ax. At + 0. For a convergent solution, some mcasurc of the solution error can be estimated as 11ey11 < KAxaAth, (11.15) 2. littiti! IN&~~Nww dfdwl 383 where the meaSure may bc the root mean square (m) of thc solution error on all the =gid points; K is a constaiit independent of the grid spacing Ax and the tiine step At: the indices u and h rcpresent the convergence rates at which the sollition error approaches zero. One may reverse the discretization process and examhe the hit of thc dis- cretizcd equations (11.10) and (1 1.131, as the grid spacing tends to zero. The dis- crctized equation is said to be consi.rrenf if it recovers the original partial differential equation (1 1.1) in thc limit of zero grid spacing. Lct us consider the explicit scheme (1 1. IO). Substitution of the Taylor scries expansions (1 1.4) and ( 1 1.5) into scheme ( 1 1. IO) produces (1 1.16) where is the truncation crror. Obviously, as thc grid spacing Ax, At + 0, this truncation error is of the order of O(Ar, Ax') and tends to zero. Therefore, explicit schcme (1 1. IO) or cxpression (1 1.16) recovers the original partial diffcrential equation (1 1.1 j or it is consistent. It is said to be first-order accurate in time and second-order accuratc in space, according to the order of magnitude of the truncation error. In addition to the truncation error introduced in thc discretization proccss, other soiirces of error may be prcscnt in the approximate solution. Spontaneous disturbances (such as the round-off error) may be introduced during either the evaluation or the tiurnerical solution process. A numerical approximation is said to be sruble il lhcsc disturbances decay and do not affcct the solution. The stability of explicit schernc ( 1 1.10) may be examincd using the voiiNeumann rncthod. Let us consider the error at a grid point e? = T!' - p. (11.18) where T/' is the exact solution of the discretized system (1 1.10) and is the approxi- mate numerical solution of the seam systcrn. This error could be introduccd due to the round-off crror at each step of the computation. We need to monitor its decay/growth with tinic. Tt can be shown that the evolution of this crror satisfies the same homoge- neous algcbraic systcrn (I I. IO) or (I 1.19) /lfl - 5;. - (Q + m;!. ] + (1 - 2m; + (B - ax:+,. The error djslributed along the grid lhc can always be decomposed in Fourier space as ( 1 1.20) where i = a, k is the wavenumbcr in Fouricr spacc and g" rcpmscnts the fiinction (o at time t = tlr . As the system is lincar, we can examinc onc cornponcnt of Eq. (1 1.20) at a time, 6: = gn (k)e'"k"i. (11.21) The component at the next time level has a similar form $;+I = gn+l (k),&"kxi (1 1.22) Substituting thc prcccding two equations (1 1.21 ) and (1 1.22) into mor equation (1 1.19), we obtain ] (11.23) a+l idx; - R~~[(a + p)eidq I + (1 - 2p)eizkxi + (p - a)eixk.ri+l ge - or (1 1.24) This ratio g"+'/g'' is called the amplification factor. The condition for stability is that the magnitude a1 the error should decay with time, or (1 1.25) for aq7 value of the wavenumber k. For his explicit schcmc, the condition for stability equation (1 1.25) can be expressed as ( 1.1.26) whcrc 8 = knAx. The stability condition (11.26) also can be exprcsscd as (Noye, 1983), (1 1.27) For the pure difhsion problem (u = O), the stability condition (1 1.27) for this 0 Q 4cu2 Q 28 < 1. explicit scheme requires hat 1 1 Ax2 2 OQPQ- or At< 20 (1 1.28) which limits the she of the tiinc stcp. For the pure conveciion problcm (D = 0), condition (1 1.27) will never be satisfied, which indicates that the schcmc is always unstable and it incans that any error introduced during thc computation will explodc with tiinc. Thus, this explicit scheme is useless for pure convection problem. To improve thc stability of the explicit scheme lor the convection problem, one may use an upwind schcmc to approximate the convective term, qn+n+r = qJ - h(11" - q:,): (11.29) where the slability condition requires that At Ax It- Q 1. (11.30) Condition (1 1.30) is known as the Courant-Friedrichs-kwy (CFL) condition. This condition indicates that a fluid particle should not travel more than one spatial grid in one time step. It can easily be shown that implicit scheme (1 1.13) is also consistent and unconditionally slablc. It is normally diflicult to show the convergence of an approximate solution the- oretically. However, the Lux Equivalence theorem (Richtmyer and Morton, 1967) states that: jhr un appmximntion to a well-posed linear initial vtrlue prwbleni, which .sn1isjies #he consistency condition, stability is a necessui y and sir@cieiit condition for the convergence of the solution. For convection-diffusion problems, the exact solution may change significantly in a narrow boundary layer. If the computational grid is not sufficiently fine to resolve the rapid variation of the solution in the boundary layer, the numerical solution may present unphysical oscillations adjacent to or in the boundary layer. To piwent thc oscillalory solution, a condition ou the cell Peclet number (or Reynolds number) is normally required (see Section 4), (1 l.31 j 3. kiinite Elernmt Method Thc finite eleinenl method was developed initially as an engineering procedure for stress and displacemcnt calculations in structural analysis. This method was subse- qucntly placed on a sound mathematical foundation with a variational inkrpretation or the potcntial energy of the system. For most fluid dynamics problems, finite cle- ment applications have used the Galerkin finite element formulation on which we will rocus in this section. Weak or Variational Form of Partial Differential Equations Le1 us consider again the one-dimcnsional transport problem (I 1.1). The form of Eq. (1 1.1) with boundary condition (1 1.2) and initial conditions (1 1.3) is called the strong (or classical) foim of the problem. We first define a colleclion of trial solutions, which consists of all fuiictions that havc square-integrable ht derivativcs (Hi functions, Le., I;'.(T.x)2 dx < cc if T E H' ;I and satisfy the Dirichlet type of boundary condition (where the value or thc variable is specified) at x = 0. This is expressed as the trial functional space, 9 = {TI T E HI. T(O) = g}. (1 1.32) The variational space of the trial solution is dcfincd as which requires a corresponding homogeneous boundary condition. We next multiply the transport equation (1 1.1) by a function in the variational space (w E V), and integrate the product over the domain where the problem is defined, Integrating the right-hand side of Fiq. (1 1.34) by parts, we have (11.35) where theboundaryconditionsaT/ax(L) = q and w(0) = 0areapplied.Theintegd equation (1 1.35) is called the weak form of this problem. Therefore, the wcak form can be stated as: Find T E S such that for all u: E V, (11.36) It can be formally shown that the solution of the weak problem is identical to that of the slrong problem, or that thc strong and weak forms of the problem are equivalent. Obviously, if T is a solution of strong problem (1 1.1) and (1 1 .2), it must also be a solution of weak problem (1 1.36) using the procedure for derivation or the weak formulation. Howevcr, Ici us assume that T is a solution of weak problem (1 1.36). By reversing the order in deriving the weak formulation, we have aT a2r> [a,: ] I" ($ + 11% - D- wdx + D -(L) - q w(L) = 0. (11.37) ax2 Satisfying Eq. (1 1.37) for all possible functions of w E V requires that i3T aT a2T i)T at ax a.rz as - + u- - D- = 0 for x E (0, L) and -(L) - q = 0, (11.38) which means that solution T will also be a solution of the strong problem. It should be noted that the Dirichlet type of boundary condition (where the value ofthc variable is specified) is built into the trial functional space S, and is thus called an essential boundary condition. However, the Neuinann type of boundary condition (whcrc the dcrivative of the variable is imposed) is implicd by the weak formulation as indicdtcd in Eq. (1 1.38) and is referred to as a natural boundary condition. Galerkin's Approximation and Finite Element Interpolations As we have shown, the strong and wcak forms of the problem are equivalent and there is no approximdtioii involved between hesc two formulations. Finite elemnent methods start with the weak formulation of the problem. Le1 us construct finile-diincnsional approximations of S and V, which are denoted by Sh and Vh, respectively. The super- script refers to a discretization with a characteristic grid size h. The weak formulation (1 1.36) can bc rewritten using these new spaces as: Find Th E S" such that for all X!h E v". = Dqwh(L). (11.39) Normally, S" and V" will be subsets of S and VI respectively. This incans that if il function I$ E Sh then I$ E S, and if anothcr .function $ E V" then E V. 'merefore. Eq. (1 1.39) dcfines an approximate solution Th to the exact weak form of problem (1 1.36). It should be notcd that, up to the boundary condition T(0) = (o, the function spaces S" and V" arc composed of identical collections of functions. Wc may take out this boundary condition by defining a ncw function (11.40) v~(x. t) = T (x, t) - gh(x). wherc (oh is a specific filnction that satisfics the boundary condition ~"(0) = g. Thus, the functions 1:" and u!'' belong to the sane space V". Equation (1 1.39) can be rewritten in terms of the new runciion uk: Find Th = vh + gh, whcrc E'' E Vh, such that for all iiih E Vh, h (1 1.41) The operator (I(-, -) is dcfincd as The forniulation (1 I .4 I) is callcd a Galerkin fonnulation. because the solution and the varialional functions arc in the same space. Again, the Galerkin ~orlnulation of the problem is an approximation to thc wcak formulation (1 1.36). Other classes of approximation metbods, called Petrov-Galerkin mcthods, are those in which the solution function may be contained in n collection of functions olhcr than V". Next we need 10 cxplicitly construct the finite-dimensional variational space V". Let us assume that the dimension or the space is it and that thc basis (sbape or iiiterpolation) functions for the space are N.~(x). A = 1.2. IZ. (11.13) Each shape function has to satisfy the boundary condition at x' = 0, Ni,(0)=O. A=1,2 n. (11.444) which is required by the space Vh. The form of the shape functions will be discussed later. Any function wh E Vh can be expressed as a linear combination of these sbape €mc tions, (1 1.45) where the coefficients c-4 are independent of x and uniqucly dcfinc this function. We may introducc onc additional function No to specify the function gh in Eq. (11.40) related to the essential bouiihy condition. This shape function has tbe property A=l No(0) = 1. (11.46) Thcrcfore, the function gh can be expressed as gh(X) = giVo(-~) and g’(0) = g. (1 1.47) With these definitions, the approximate solution can be written as n vh(x, t) = E~A(~)NA(X) (11.48) A=l and where dn’s are functions of timc only for time-dependcnt problems. Matrix Equations and a Comparison with the Finite Difference Method With the construction of the finite-dimcnsional space Vh, thc Galcrkin formulation of problem (I 1.41) leads to a coupled system of ordinary differential equations. Substi- tution of the expressions for the variational function (1 1.45) and for the approximate solution (1 1.48) into the Galerkiii formulation (1 1.41) yields where d~ = (d/dt)(dB). Rearranging the terms, Eq. (11.50) rcduces to &GA = 0, A=l wheiv (1 1.50) (1 1.5 1) (11.52) [...]... cxplicitly (1 1 .101 ) In thc sccond stcp thc prcssure gradient operator is added (implicitly) and, at the same time, the incompressible condition is edorced ( I 1.1 02) and v - 0 ( 11 .103 ) This step is also called a projection step to satisfy the incornprcssibilitycondition 398 ComputationalFluid m i k -b1,1 12 *Iv2,1 12 0 ' r v3,1 12 Figure 11.4 Staggered grid and a typical cell around ~ 2 2 Normally,... step in the MAC scheme, the intermediate velocity rr+l /2 and n + l / 2 componentsuli+l 12, j ui,i+l/2in the interior of the domain are first evaluated using Eqs (11 .104 ) and (1 1 .105 ), respectively Next, the discrctc pressure Poisson equation (11 .109 )is solved Finally, the velocity componentsat the new time step are obtaiued from Eqs (11 .106 ) and (11 .107 ) In the MAC scheme, the most costly step is the solution... cylinder for ilRow of Rcynolds numhcr Re = 10 11 Tbc values ofthe incoming stretunlines, starting fmm thc bottom arc: +/(Ud)= 0.01,0.05.0 .2, 0.4,0.6 0.8 1.0, 1 .2, 1.4.1.6.1.8 .2. 0 ,2. 2, and 2. 4, rcspcctively F l p 11.11 Iwvorticity lines [ r the tlow of Reynolds number Rc = 10 The wlucs of the vorticity, o from Ilic iniiennozt linc, are o d / U = 1.0,0.5,0.3,0 :2, and 0.1, rcspectively -Present Calculation... it solves a discrete Poissonequation (1 1.1 23 ) for the pressure correction.This pressure con-ectionis then used to modify the prcssure using Eq (11.119),andtoupdatcthevelocityatthenewcimcstepusin~Eqs 1. 120 )-(11. 122 ) (I The solution to the pressure correction equation (11. 123 ) was found to updatc the velocity field efEectively using Eqs (11. 121 ) and (1 1. 122 ) However, it iisually overcorrectsthe pressure... boundary, u'$~ is known In evaluating the discrete conthuity equation (11 .108 ) at the pressure node (1 ,2) , the velocity U Y ~ should not be expressedin terms of u'$!r !~ using Eq (11 .106 ) Therefore PO,?will not appear in Eq ( 1 1 .105 ), and 110 boundary condition lor the pressure is needed It should also be noted that Eqs (11 .104 ) and (11 .105 ) only update the velocity components for h e intcrior grid points,... The first is an implicit step for the nonlinear convection-difiisionproblem (1 1. 125 ) The second step is Tor the pressurc and the incompressibilitycondition, ( 11. 126 ) and v un+l = 0 (1 1. 127 ) In this iorinulalion the pressure is separated into L c form of h pii+l - pn + Spy"+l (I I 128 j Equations (1 1. 126 ) and (11. 127 ) can be combined lo form the Poisson equation Tor the pressure correction Spii+',... values of Th at the nodcs x = TA (A = 1 ,2, i t ) or d , = T h ( l ~= TA ~ ) (1 1. 62) In ordcr to comparc thc discretized equations generated f o thc finite element rm rnelhod with those from finite difference methods, we substitute Eq (11.59) into Eq (1 1S3) and cvaluate the integrals For an interior node x.4 (A = 1 .2, 11 - 1 ), we have D - -(TA - 1 122 - ~ T + TA+~) 0, A = (11.63) where h is... new velocity U"+l = u* + , ' u (11. 120 ) satisfies the continuity equation (11.1 16) In SIMPLE, approximate fornx of thc discretized momentum equations (11.114) and (1 1.115) are used for the equations for the velocity correction uc (1 1. 121 ) (11. 122 ) In the approximation, the contributions from the neighboring nodes are neglected Substitution of the new velocity (1 1. 120 ) into the continuity equation... Glowinski (1991) may be used The 8-scheme splits each time step symmetrically into thrcc subsleps, which are described here 0 Slep 1: uti+B - uii H At - ~ v 2 u i i - I o + v P" '-lr Re (1 1. 129 ) (1 1.130) e Stcp 2: ( I 1.131) v U"+1 = 0 (1 1.133) /a = 0 .29 289 ,cr+p = 1,and p = O/(l-O) It was shown that when ti = 1 - 1 the scheme is second-order accuratc The first and third steps of the (-)-scheme are identical... smallest of them of the size 0.02d near the cylinder surface The size of the control volume in the I dh-cction progressively increascs with a constant factor of 1 lo Thc nondimensionalradius o thc outer boundary is located a1 R = f , 23 .8 The total number of grid points used in the mesh is 322 4 + + I +! 1 I! , .A The first term on the left-hand side of Eq (11.1 52) can be €urtherdiscretized as As . incornprcssibility condition. 398 Computational Fluid mi- k 0 r -b 1,1 12 *Iv2,1 12 ' v3,1 12 Figure 11.4 Staggered grid and a typical cell around ~2. 2. Normally, the MAC scheme is presented. (1 1 .21 ) and (1 1 .22 ) into mor equation (1 1.19), we obtain ] (11 .23 ) a+l idx; - R~~[(a + p)eidq I + (1 - 2p)eizkxi + (p - a)eixk.ri+l ge - or (1 1 .24 ) This. condition (11 .26 ) also can be exprcsscd as (Noye, 1983), (1 1 .27 ) For the pure difhsion problem (u = O), the stability condition (1 1 .27 ) for this 0 Q 4cu2 Q 28 < 1. explicit

Ngày đăng: 13/08/2014, 16:21

Tài liệu cùng người dùng

Tài liệu liên quan