A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of...

15
A1-NUMERICAL SOLUTION OF CONVECTION- DIFFUSION EQUATIONS 1 Governing Equations [1, 2] The governing equations of the heat transfer by convection are a state equation (relation among pressure, temperature and density) and conservation equations of mass, linear momentum and energy. A constitutive relation are also required: Stokes’ law, Fourier law, Fick law,... Assuming: Bidimensional model Mono-component and mono-phase fluid Incompressible flow Newtonian fluid Boussinesq hypothesis (constant physical properties everywhere except in the body forces term) the governing equations written in Cartesian coordinates are: ∂u ∂x + ∂v ∂y =0 (1) ρ ∂u ∂t + ρu ∂u ∂x + ρv ∂u ∂y = - ∂p d ∂x + μ 2 u ∂x 2 + 2 u ∂y 2 (2) ρ ∂v ∂t + ρu ∂v ∂x + ρv ∂v ∂y = - ∂p d ∂y + μ 2 v ∂x 2 + 2 v ∂y 2 + ρgβ (T - T ) (3) ρ ∂T ∂t + ρu ∂T ∂x + ρv ∂T ∂y = λ c p 2 T ∂x 2 + 2 T ∂y 2 + Φ c p (4) where, 1 Computational Fluid Dynamics and Heat Transfer. Finite Volume Methods. ETSEIAT, CTTC (www.cttc.upc), UPC.

Transcript of A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of...

Page 1: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

A1-NUMERICAL SOLUTION OF CONVECTION-DIFFUSION EQUATIONS

1 Governing Equations [1, 2]

The governing equations of the heat transfer by convection are a state equation(relation among pressure, temperature and density) and conservation equationsof mass, linear momentum and energy. A constitutive relation are also required:Stokes’ law, Fourier law, Fick law,...

Assuming:

• Bidimensional model• Mono-component and mono-phase fluid• Incompressible flow• Newtonian fluid• Boussinesq hypothesis (constant physical properties everywhere except

in the body forces term)

the governing equations written in Cartesian coordinates are:

∂u

∂x+

∂v

∂y= 0 (1)

ρ∂u

∂t+ ρu

∂u

∂x+ ρv

∂u

∂y= −

∂pd

∂x+ µ

(

∂2u

∂x2+

∂2u

∂y2

)

(2)

ρ∂v

∂t+ ρu

∂v

∂x+ ρv

∂v

∂y= −

∂pd

∂y+ µ

(

∂2v

∂x2+

∂2v

∂y2

)

+ ρgβ(T − T∞) (3)

ρ∂T

∂t+ ρu

∂T

∂x+ ρv

∂T

∂y=

λ

cp

(

∂2T

∂x2+

∂2T

∂y2

)

cp

(4)

where,

1

Computational Fluid Dynamics and Heat Transfer. Finite Volume Methods. ETSEIAT, CTTC (www.cttc.upc), UPC.

Page 2: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

β Coefficient of volumetric thermal expansion.cp Specific heat.k Conductivity.g Gravitational acceleration.µ Viscosity.pd Dynamic pressure.ρ Density.t Time.T Temperture.u, v Velocity components.x, y Spatial coordinates.Φ Heat source.

They are partial coupled partial differential equations. The 4 unknowns are thepressure, temperature, and the two velocity componentsu andv. An appropriateboundary and initial conditions are required to close the problem.

Two strong coupling characterise this equation system:

• pressure-velocity. There is no specific pressure equation. For incompress-ible flows, the pressure is the field that makes the velocity accomplish themass conservation equation.

• temperature-velocity. This coupling is only present for natural convection,mixed convection or temperature dependent physical properties. In forcedconvection and constant physical properties, the velocity field does not de-pend on the temperature field.

All the equations written above (1-4) can be summarized in the convection-diffusionequation:

∂ρφ

∂t+ ∇ (ρ~vφ) = ∇ (Γ∇φ) + S (5)

or in Cartesian coordiantes, incompressible flow and constant physical properties:

ρ∂φ

∂t+ ρu

∂φ

∂x+ ρv

∂φ

∂y=

λ

cp

(

∂2φ

∂x2+

∂2φ

∂y2

)

+ S (6)

The accumulation ofφ, plus the net convective flow has to be the net diffusiveflow plus the generation ofφ per unit of volume. The diffusive term flows from

2

· ·

Page 3: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

greater to smaller value ofφ.

According to the convection diffusion equation, we can write a table with theappropiate parameters in order to reproduce the governing equations. See Table1.

Equation φ Γ S

Coninuity 1 0 0Momentum in x direction u µ −∂pd/∂xMomentum in y direction v µ −∂pd/∂y + ρgβ(T − T∞)Energy (constantcp) T λ/cp Φ/cp

Table 1: Parameters to replace in convection - diffusion equation inorder to reproduce the governing equations.

2 Finite-Volume Discretization [3, 4, 5, 6]

Integrating the convection-diffusion equation into a rectangular finite volume (seeFig. 1), the discretized equation can be written:

(ρφ)n+1P − (ρφ)n

P

∆t∆x∆y +

[

(ρuφ)n+1e − (ρuφ)n+1

w

]

∆y +[

(ρuφ)n+1n − (ρuφ)n+1

s

]

∆x

=

[

(

Γ∂φ

∂x

)n+1

e

(

Γ∂φ

∂x

)n+1

w

]

∆y +

[

(

Γ∂φ

∂y

)n+1

n

(

Γ∂φ

∂y

)n+1

s

]

∆x+

Sn+1P ∆x∆y

(7)

where the following hypothesis are done:

1. In the integration process, the convective and diffusiveflows have been con-sidered constant through each face of the control volume.

2. (spatial deviation)n=(spatial deviation)n+1

(spatial deviation)w=(spatial deviation)e(spatial deviation)s=(spatial deviation)n

3. The source term:∫ n+1

n

∫ e

w

∫ n

sSdydxdt = Sn+1

P ∆x∆y∆t

3

Page 4: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

Figure 1: Finite volume

3 Consistency, stability and convergence

A numerical approximation isconsistent when the discretized equations are so-lution of the differential equation when the spatial and temporal grid tend to zero.Thus, as the grid is refined, truncation errors must tend to zero.

A numerical approximation isstable if the solution obtained is the solution of thediscret equations. Possible roundoff errors, equations couplings, etc can produceinestabilities.

A convergent solution is a stable solution that tends to the solution of the differ-ential equations as the the meshes are finer. So,consistency andstability are twonecessary and sufficient conditions to getconvergence.

4 Analytical solution of the convection-diffusion equa-tion. Onedimensional,null source term and steadystate solution [3]

For this case the convection - diffusion equation is:

4

Page 5: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

∂ρφ

∂t+ ∇ (J) = S (8)

whereJ = ρvφ−Γ∇φ and is the total flow: convective and diffusive. RerwrittingJ for the specified conditions:

J = ρuφ − Γdφ

dx(9)

Assuming a nul source termS, equation (8) reduces to:

dJ

dx= 0 (10)

and integrating over the control volume of figure 2:

Je − Jw = 0 (11)

Figure 2: Finite control volume for onedimensional problem.

The resulting discrete equation can be easly solved imposing the following bound-ary conditions:

in x = 0 −→ φ = φ0

in x = L −→ φ = φL

The analytical solution is:

φ − φ0

φL − φ0=

exp(Px/L) − 1

exp(P ) − 1(12)

5

Page 6: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

Figure 3: Graphical representation of equation (12).

whereP is the Peclet number and is defined asP = ρuL/Γ. Graphical represen-tation of equation (12) can be seen in figure 3.

Taking into account this exact analytical profile available, the flows in the faces ofthe Control Volumes are:

Je = Fe(φP +φP − φE

exp(Pe) − 1) (13)

wherePe = (ρu)eδxe

Γe= Fe

De.

Substituing this flows in the discrete equation, we get an equations like:

aP φP = aEφE + aW φW (14)

The solution of this equation gives the exact solution of the differential convection-diffusion equation in the nodal points whatever the discretization mesh is.

5 General case. Bidimensional and Transient [3]

The convection-diffusion equation in this situation reads:

∂(ρφ)

∂t+

∂Jx

∂x+

∂Jy

∂y= S (15)

whereJx = ρuφ − Γ∂φ

∂xandJy = ρvφ − Γ∂φ

∂y.

6

Page 7: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

Integrating this equation over a control volume, assuming and implicit criteria forthe temporal integration and a constant flow at each face of the control volume:

(ρφ)P − (ρφ)0P

∆t∆x∆y + Je − Jw + Jn − Js = Sn+1

P ∆x∆y (16)

In order to assure convergence, is better to introduce the continuity equation in thediscretized equation:

∂ρ

∂t+

∂ρu

∂x+

∂ρv

∂y= 0 (17)

which is integrated over a control volume:

ρP − ρ0P

∆t∆x∆y + Fe − Fw + Fn − Fs = 0 (18)

whereF = ρvS; S is the surface vector of the control volume.

Then, we can substract Eq.19 and 18·φP , and obtain:

(φP − φ0P )ρ0

P

∆t∆x∆y + (Je − FeφP ) − (Jw − FwφP )

+ (Jn − FnφP ) − (Js − FsφP ) = Sn+1P ∆x∆y (19)

6 Numerical Schemes

It can be seen that in the discretizated convection-diffusion equation (7) convec-tive and diffusive terms are evaluated at the cell faces, whereas dependent variableφ is known at the cell center. The evaluation of the variable atthe cell face is car-ried out by numerical schemes.

Conductive flux is calculated as an arithmetic mean:(

∂φ

∂x

)

e

=φE − φP

δxe

or

(

∂φ

∂y

)

n

=φN − φP

δyn

(20)

The order of a numerical scheme is the number of neighbouring nodes that areused to evaluate dependent variable at the cell face.

7

Page 8: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

6.1 Low order numerical schemes [3]

These numerical schemes evaluate the variable using nearest nodes: east (E), west(W), north (N) and south (S). Their order is 1 or 2.

Most significant low order numerical schemes are:

• Central Difference Scheme (CDS): It is a second order scheme, variable atthe cell face is calculated as an arithmetic mean. That is:

φe =1

2(φP + φE) (21)

• Upwind Difference Scheme (UDS): It is a first order scheme andthe valueof φ at the cell face is equal to the value ofφ at the grid point on theupwindside of the face. That is:

φe = φP if Fe > 0 (22a)

φe = φE if Fe < 0 (22b)

• Hybrid Difference Scheme (HDS): Uses CDS for low velocitiesand UDSfor high velocities.

• Exponencial Difference Scheme (EDS): It is a second order scheme andthe evaluation of the dependent variable at the cell face comes from theexact solution of the convection-diffusion equation in one-dimensional, nullsource term and steady problem.

• Powerlaw Difference Scheme (PLDS): It is a second order scheme and vari-able at the cell face is calculated with an approximation of the EDS by apolynomial of fifth degree.

If numerical schemes are introduced in the integrated discretized convection-diffusionequation, it is obtained an algebraic equation for each control volume:

aP φP = aEφE + aSφS + aW φW + aNφN + b (23)

Coefficientsai can be evaluated with:

8

Page 9: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

aE = De · A (|Pee|) + max(−Fe, 0) (24a)

aW = Dw · A (|Pew|) + max(Fw, 0) (24b)

aN = Dn · A (|Pen|) + max(−Fn, 0) (24c)

aS = Ds · A (|Pes|) + max(Fs, 0) (24d)

aP = aE + aW + aN + aS + ρnP

∆x ∆y

∆t(24e)

b = ρnP

∆x ∆y

∆tφn

P + Sn+1P ∆x ∆y (24f)

where:

De =Γe ∆y

(δx)e

; Dw =Γw ∆y

(δx)w

; Dn =Γn ∆x

(δy)n

; Ds =Γs ∆x

(δy)s

(25)

Fe = (ρu)e∆y; Fw = (ρu)w∆y; Fn = (ρv)n∆x; Fs = (ρv)s∆x (26)

and the Peclet number evaluated at the face of the control volume (f ) is:

Pf =Ff

Df

(27)

Numerical scheme A(|P |)

UDS 1CDS 1 − 0.5(|P |)HDS max(0, (1 − 0.5|P |))

EDS |P |/(e|P | − 1)PLDS max(0, (1 − 0.5|P |)5)

Table 2: Value ofA(|P |) for different low numerical schemes.

9

Page 10: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

6.2 High order numerical schemes

In order to improve accuracy of low numerical schemes, it’s useful to use morethan two nodal values to calculate dependent variable at thecell face.

These high order numerical schemes are introduced into the general formulationby a deferred term (bde) as if it was a source term, and the coefficients of the equa-tion (23) are calculated using UDS numerical scheme.

By this way, algebraic equation is expressed as:

aP φP = aEφE + aSφS + aWφW + aNφN + b + bde (28)

and deffered term is calculated as:

bde = Fe(φUDSe − φHS

e ) − Fw(φUDSw − φHS

w )+

+ Fn(φUDSn − φHS

n ) − Fs(φUDSs − φHS

s ) (29)

φHSf is the variableφ evaluated at the cell facef with high order numerical

scheme.

6.2.1 Evaluation of φHSf according to different high order numerical schemes

[7, 8, 9]

It is useful to introduce some variables in order to make calculations independentof the flux direction (figure 4):

Φu

Φc

Φf

Φd

Figure 4: Sketch of original variables profile.

• φC : Value ofφ at the nearest grid point on the upwind side of the face.

• φU : Value ofφ at the grid point aboveφC .

• φD: Value ofφ at the nearest grid point on the downstream side of the face.

10

Page 11: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

Then dependent variable at the cell face is evaluated according to table 3.

Numerical scheme Order Comments φf

UDS 1 - φf = φC

UDS of 2nd order 2 Lineal extrapolation betweenφC andφU φf = (3φC−φU )2

QUICK 3 Quadratic interpolation amongφC , φU andφD φf = (φC+φD)2

−φD−2φC+φU

8

Table 3:φf evaluated with different high order numerical schemes.

One of the problems of accurate numerical schemes is the instability. This prob-lem is solved if they arebounded, it means thatφf is beween nearest nodal gridpoints values.

If dependent variable is normalized as:

φf =φf − φU

φD − φU

(30)

Then figure 4 becomes figure 5:

Figure 5: Sketch of normalized variables profile.

And φf depends on value of normalized nodal grid point variableφC : φf =

f(φC).

A bounded numerical scheme must be in the dark zone of the normalized variablediagram, NVD, (see figure 6). According to figure 5, the meaning of this can beseen in figures 7 i 8.

11

Page 12: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

Figure 6: Normalized variable diagram(NVD): graphic ofφf as a function ofφC ,it shows if numerical scheme is bounded

Figure 7: Bounded numerical scheme.Figure 8: Not bounded numericalscheme.

A second order scheme passes through(0.5, 0.75) coordinate of figure 6. If theslop of the numerical scheme in figure 5 is0.75 and passes through(0.5, 0.75) co-ordinate, it is a third order numerical scheme. All this is plotted in the normalizedvariable diagram of figure 9.

12

Page 13: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

Figure 9: Normalized variable diagram plots for several linear schemes.

In figure 9 it can be seen that second and third order numericalschemes will haveproblems of instability. "Esquemes a la carta (??)", like SMART, try to solve theseproblems.

Using equation (30), the normalized dependent variable at the cell face is evalu-ated using table 4.

Numerical scheme Order φf

UDS 1 φf = φC

UDS2 2 φf =3

2φC

QUICK 3 φf =3

8+

3

4φC

SMART 2 − 4 φf = 3φC if 0 < φC < 1

6

φf =3

8+

3

4φC if 1

6< φC < 5

6

φf = 1 if 5

6< φC < 1

φf = φC otherwise

Table 4:φf evaluated with different high order numerical schemes.

If cell face is not at the middle between two nodal points, it is necessary to intro-duce geometric variables. Thus, distances are normalized in a similar form toφ:

13

Page 14: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

x =x − xU

xD − xU

(31)

Then problem only depends on three variables:

φf = f(φU , φC, φD, xU , xC , xf , xD) ⇒ φf = f(φC , xC , xf)

According to (31), table 4 is transformed to table 5.

Numerical scheme Order φf

UDS2 2 φf =xf

xCφC

QUICK 3 φf = xf +xf(xf−1)xC(xC−1)

�φC − xC �

SMART 2 - 4 φf =xf (1−3xc+2xf )

xc(1−xc)φC if 0 < φC ≤

xC

3

φf =xf(xf−xC)

1−xC+

xf(xf−1)xC(xC−1)

φC if xC

3< φC ≤

(1+xf−xC)xC

xf

φf = 1 if(1+xf−xC )xC

xf< φC ≤ 1

φf = φC otherwise

Table 5:φf evaluated with different high order numerical schemes and using nor-malized distances.

References

[1] E.R.G. Eckert and R.M. Drake Jr.Analysis of Heat and Mass Transfer.McGraw-Hill, 1972.

[2] W.M. Rohsenow, J.P. Hartnett, and E.N. Ganic.Handbook of Heat TransferFundamentals. McGraw-Hill, 1985.

[3] S.V. Patankar.Numerical heat transfer and fluid flow. Hemisphere PublishingCorporation, 1980.

[4] R. Clovis and Maliska.Transferencia de Calor e Mecanica dos Fluidos Com-putacional. 1995.

[5] W.J. Minkowycz et al.Handbook of numerical heat transfer. Willey, 1988.

[6] C.T. Shaw.Using Computational Fluid Dynamics. Prentice Hall, 1992.

14

Page 15: A1-NUMERICAL SOLUTION OF CONVECTION DIFFUSION … · 2016. 9. 27. · greater to smaller value of φ. According to the convection diffusion equation, we can write a table with the

[7] S. Thakur and W. Shyy. Some Implementational Issues of ConvectionSchemes for Finite-Volume Formulations.Numerical Heat Transfer, Part B,24:31–55, 1993.

[8] M.S. Darwish. A New High-Resolution Scheme Based on the NormalizedVariable Formulation.Numerical Heat Transfer, Part B, 24:353–371, 1993.

[9] M.S. Darwish and F.H. Moukalled. Normalized Variable and Space Formu-lation Methodology for High-Resolution Schemes.Numerical Heat Transfer,Part B, 26:79–96, 1994.

15