Master degree n Mechancal Engneerng Numercal Heat and Mass Transfer 06-Fnte-Dfference Method (One-dmensonal, steady state heat conducton) Fausto Arpno f.arpno@uncas.t
Introducton Why we use models and how Many physcal systems of nterest are extremely complex, wth many nteractng elements governng ther behavor. The way the complete system behaves may be explored by experments. However, f t s a nonlnear system the effect of two changes made together s very dfferent from the sum of the changes made separately so that t may be mpossble to derve enough nformaton from emprcal parameter analyss. Alternatvely, buldng or runnng experments may be expensve or dangerous. Numercal models ncorporate the knowledge ganed by experments allowng the runnng of new tests by computer smulatons.
Introducton Man steps of numercal smulaton Physcs approxmaton ü Is the mathematcal model avalable and able to accurately descrbe the physcs of the system under nvestgaton? ü In buldng computatonal models the skll requred s to smulate as well as possble a physcal system n order to nvestgate ts behavor. ü The term as well as possble s subject to a whole range of condtons (on one hand the physcs of the system mght be qute well known but the system may be so large that t s not possble to smulate t perfectly; on the other hand, the physcs of the system s not so well known and we known just general behavor). Numercal approxmaton ü Pre-processng: conssts of the nput of a problem to CFD program by means of an user-frendly nterface and the subsequent transformaton of the nput nto a form sutable for the solver. ü Processng: conssts of the numercal resoluton of governng Partal Dfferental Equatons (fnte dfference, fnte element, fnte volume, spectral methods, etc. ü Post-processng: conssts of the results analyss (verfcaton, valdaton, ) 3
Mathematcal model The quanttes of nterest are descrbed by Partal Dfferental Equatons (PDEs) n the form: ( ) F x,θ,ϕ, ϕ L ϕ,g θ, ϕ x,..., ϕ x,...,g = 0 Smlar PDEs can be used for the resoluton of dfferent problems. The governng PDEs equatons represent the mathematcal statements of the conservaton law of physcs. z EQUATIONS EXAMPLES... ü Transport equaton ü Heat equaton ü Waves equaton ϕ θ + uϕ ( ) = 0 ϕ θ ϕ = G ϕ θ + ϕ = 0 Ω Ω. q x. q y x. q z+dz. q z y. q y+dy. ρc q x+ u. T θ 4
Numercal modelng Snce the exact soluton φ(x,y,z,ϑ) can be very dffcult to obtan, thought numercal models t s possble to obtan an approxmated soluton φ N (x,y,z,ϑ ), wth =1,,N, wth the use of a computer L(ϕ,g) = 0 Exact operator ϕ(x, ϑ) Numercal methods L N (ϕ N,g N ) = 0 Approxmated operator ϕ = 1,...N L N ( ϕ,g ) = L( ϕ,g ) + E T Roundoff error A numercal method s convergent f: A numercal method s consstent f: lm N lm L N N ϕ ϕ N = 0 ( ϕ,g ) = 0 A numercal method s stable small roundoff errors cause small (and convergent) soluton oscllatons. 5
Numercal modelng Lax s equvalence theorem Consstency + Stablty Convergence Convergence s usually very dffcult to establsh theoretcally and n practce we use the Lax s equvalence theorem whch states that for lnear problems a necessary and suffcent condton for convergence s that the method s both consstent and stable. In CFD methods such theorem s of lmted use snce the governng equatons are non-lnear. In such problems, consstency and stablty are necessary condtons of convergence, but not suffcent. 6
Numercal modelng The objectve s then the constructon of an equvalent, approxmated operator, usually as a system of lnear algebrac equatons :... θ +.. +.. = 0 How s t possble to acheve ths goal? a 11 ϕ 1 + a 1 ϕ... + a 1n ϕ n = 0 a n1 ϕ 1 + a n ϕ... + a nn ϕ n = 0 Fnte dfference: Fnte-dfference methods approxmate the solutons to dfferental equatons by approxmatng the dervatve expressons n the governng equaton; the method s easy to understand, but dffcult to mplement. Fnte element: Based on the weak formulaton and on the nterpolaton, the fnte element method s less ntutve, but powerful, sutable for multphyscs and smple to mplement. Fnte volume: The Fnte Volume method s a refned verson of the fnte dfference method and has became popular n CFD. 7
Fnte-dfference method for solvng heat conducton problems The numercal method of soluton s used n practcal applcatons to determne the temperature dstrbuton and heat flow n solds havng complcated geometres, boundary condtons, and temperature-dependent propertes. A commonly used numercal scheme (especally n the past) s the fnte-dfference method. In ths method, the partal dfferental equaton of heat conducton s approxmated by a set of algebrac equatons for temperature at a number of nodal ponts over the regon. Snce the method transforms the analyss of heat conducton problem to the soluton of a set of coupled algebrac equatons, t s also mportant to manage the methods of solvng smultaneous algebrac equatons. When a heat conducton problem s solved exactly by an analytcal method, the resultng soluton satsfes the governng dfferental equaton at every doman pont. When the problem s solved by a numercal method, such as fnte-dfference, the dfferental equaton s satsfed only n correspondence of dscrete number of ponts, called nodes. The fnte-dfference method can be developed by replacng the partal dervatves n the heat conducton equaton wth ther equvalent fnte-dfference forms or wrtng an energy balance for a dfferental volume element. 8
1D Fnte-dfference method: Mathematcal formulaton Consder the followng one-dmensonal, steady state heat conducton equaton wthout energy generaton dt = 0 The computatonal doman s dscretzed n space usng a unform grd (or mesh). The nodal temperature T s defned n each node of the computatonal grd. T 0-1 +1 L M x It s assumed that the temperature n the doman s contnuous, dervable wth contnuous and lmted dervatve. Ths assumpton s necessary to fnd the approxmate expresson of the temperatures dervatves, wth the ad of a Taylor seres expanson. 9
1D Fnte-dfference method: Mathematcal formulaton T 0-1 +1 L M x Wth reference to the above dscretzed doman, the temperature T +1 at the node +1 can be expressed as a functon of the temperature T at the node by usng a Taylor seres expanson. dt d T T = T + Δ x+ + o + 1 ( ) 3 (1) Neglectng the second order terms, t s possble to obtan an approxmated expresson for the dervatve at the node (forward approxmaton): dt T T ( x) + 1 = + o Δ CUT OFF ERROR 10
1D Fnte-dfference method: Mathematcal formulaton T 0-1 +1 L M x Wth reference to the above dscretzed doman, the temperature T -1 at the node -1 can be expressed as a functon of the temperature T at the node by usng a Taylor seres expanson. dt d T T = T Δ x+ + o 1 ( ) 3 () Neglectng the second order terms, t s possble to obtan an approxmated expresson for the dervatve at the node (backward approxmaton): dt T T ( x) 1 = + o Δ CUT OFF ERROR 11
1D Fnte-dfference method: Mathematcal formulaton T 0-1 +1 L M x Both the dervatve approxmatons (forward and backward) mply a leadng error of order. To reduce the cut off error t s necessary to reduce the elements dmenson (). It can be observed that subtractng eq. () from eq. (1) T T = T T + 1 1 dt d T + Δ x + dt + o ( ) 3 t s possble to obtan an expresson of the temperature dervatve wth a second order approxmaton level (central approxmaton). dt T+ 1 T 1 = + o ( ) CUT OFF ERROR 1
1D Fnte-dfference method: Mathematcal formulaton Graphc representaton of the dervatve forward approxmaton (frst order) T(x) T +1 dt d T T = T + Δ x+ + o + 1 ( ) 3 T dt α x x +1 dt T T x ( x) + 1 = + o Δ 13
1D Fnte-dfference method: Mathematcal formulaton Graphc representaton of the dervatve central approxmaton (second order) T(x) T +1 T T -1 dt T T ( x) + 1 1 = + o Δ α x -1 x x +1 x 14
1D Fnte-dfference method: Mathematcal formulaton In a smlar way, the second temperature dervatve can be approxmated by addng the members of the followng equatons: 3 3 dt d T d T T = T + Δ x+ + + o 6 + 1 3 1 3 dt T+ 1 T + T 1 The fnal equaton represents the approxmated expresson of the second dervatve (central second dervatve). In the case of nternal nodes, the above analyss leads: ( x) 3 ( ) 3 3 dt d T d T T = T Δ x+ + o 6 + = + o Δ ( ) 4 4 T T + T = 0 + 1 1 15
Fnte-Dfference from energy balance Consder, agan, a one-dmensonal, steady state heat conducton wthout energy generaton n a fnte regon 0 x L. We dvde the regon un a number of subregons (volumes). The center of the volumes corresponds to the nodes n the mathematcal fnte-dfference formulaton; each node presents a temperature value whch s representatve of the whole subregon temperature. To develop the fnte-dfference equaton, we consder a dfferental volume element about the node. The steady state energy balance equaton for ths volume element can be stated as:! Q 1 Q!! Q + 1-1 +1 Q netta = Q 1 Q +1 Q = 0 ka ka ( T T ) + ( T T) hp( T T ) = 1 1 0 + T+ 1 T + T+ 1 hp = Δ x T T = m Δ x T T ka ( ) ( ) 16
Fnte-Dfference: Boundary Condtons The boundary condtons for heat conducton problem may be a prescrbed temperature, prescrbed heat flux or convecton boundary condton. Prescrbed temperature The temperature T 0 and T M at nodes x=0 and x=l are known and ths provdes the two addtonal relatons needed to make the number of equatons equal the number of unknown nodal temperatures Prescrbed heat flux (adabatc end) Supposng that the heat flux s prescrbed at the boundary x=l, to develop the fnte-dfference form of ths boundary condton, we need to wrte the energy balance equaton for a dfferental volume Dx/ at node M. ka M M 1 = M ( T T ) hp ( T T ) T M T M 1 Q M 1 M = Q M = m ( T M T ) Q! M 1 M M-1 M / x Q! = 0 17
Example: steady state heat conducton n a fn wth adabatc tp T s T (surroundng flud temperature) h=h c +h =cost A (Adabatc fn tp) L A=cross secton area P=cross secton permeter d T = m T T T ( ) 0 Ts ka ( ) where m = hp dt = = 0 L 18