Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views38 pages

Lecture 03 - Numerical Methods

The document discusses numerical methods for solving heat transfer problems, specifically focusing on finite difference methods for 2D steady-state heat diffusion. It outlines the discretization process, provides equations for temperature distribution, and includes examples of applying these methods with boundary conditions. Additionally, it introduces the Gauss-Seidel iteration method for solving the resulting equations and addresses transient heat transfer scenarios.

Uploaded by

medayan112211
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views38 pages

Lecture 03 - Numerical Methods

The document discusses numerical methods for solving heat transfer problems, specifically focusing on finite difference methods for 2D steady-state heat diffusion. It outlines the discretization process, provides equations for temperature distribution, and includes examples of applying these methods with boundary conditions. Additionally, it introduces the Gauss-Seidel iteration method for solving the resulting equations and addresses transient heat transfer scenarios.

Uploaded by

medayan112211
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Numerical methods for heat

transfer problems
Finite difference (volume) – 2D
steady state problems
Discretisation of 2D heat diffusion
Consider a two-dimensional body that is divided into equal increments in both the 𝑥
and 𝑦 directions

The nodes are arranged such that, the 𝑚 locations indicating the 𝑥 increment and the
𝑛 locations indicating the 𝑦 increment.

Finite differences are used to approximate differential increments in 𝑇 and space


coordinates; and the smaller we choose these finite increments, the more closely the
true temperature distribution will be approximated.
Discretisation of 2D heat diffusion
The temperature gradients may be written as follows:

𝜕𝑇 𝑇𝑚+1,𝑛 − 𝑇𝑚,𝑛 𝜕𝑇 𝑇𝑚,𝑛 − 𝑇𝑚−1,𝑛


ቤ ≈ ቤ ≈
𝜕𝑥 𝑚+1ൗ ∆𝑥 𝜕𝑥 𝑚−1ൗ ∆𝑥
2,𝑛 2,𝑛

𝜕𝑇 𝑇𝑚,𝑛+1 − 𝑇𝑚,𝑛 𝜕𝑇 𝑇𝑚,𝑛 − 𝑇𝑚,𝑛−1


ቤ ≈ ቤ ≈
𝜕𝑦 𝑚,𝑛+1ൗ ∆𝑦 𝜕𝑦 𝑚,𝑛−1ൗ ∆𝑦
2 2

𝜕𝑇 𝜕𝑇
ฬ − ฬ
𝜕2𝑇 𝜕𝑥 𝑚+1ൗ 𝜕𝑥 𝑚−1ൗ 𝑇𝑚+1,𝑛 + 𝑇𝑚−1,𝑛 − 2𝑇𝑚,𝑛
2,𝑛 2,𝑛
อ ≈ =
𝜕𝑥 2 ∆𝑥 ∆𝑥 2
𝑚,𝑛

𝜕𝑇 𝜕𝑇
ฬ − ฬ
𝜕2𝑇 𝜕𝑦 𝑚,𝑛+1ൗ 𝜕𝑦 𝑚,𝑛−1ൗ 𝑇𝑚,𝑛+1 + 𝑇𝑚,𝑛−1 − 2𝑇𝑚,𝑛
2 2
อ ≈ =
𝜕𝑦 2 ∆𝑦 ∆𝑦 2
𝑚,𝑛
Discretisation of 2D heat diffusion
Thus, the discretised finite-difference approximation for the 2D SS heat diffusion
equation becomes:
𝜕2𝑇 𝜕2𝑇
+ =0
𝜕𝑥 2 𝜕𝑦 2

𝑇𝑚+1,𝑛 + 𝑇𝑚−1,𝑛 − 2𝑇𝑚,𝑛 𝑇𝑚,𝑛+1 + 𝑇𝑚,𝑛−1 − 2𝑇𝑚,𝑛


+ =0
∆𝑥 2 ∆𝑦 2

In case of ∆𝑥 = ∆𝑦, the equation simplifies to:

𝑇𝑚+1,𝑛 + 𝑇𝑚−1,𝑛 + 𝑇𝑚,𝑛+1 + 𝑇𝑚,𝑛−1 − 4𝑇𝑚,𝑛 = 0

For the 2D SS diffusion equation with source term, we have:


𝑇𝑚+1,𝑛 + 𝑇𝑚−1,𝑛 − 2𝑇𝑚,𝑛 𝑇𝑚,𝑛+1 + 𝑇𝑚,𝑛−1 − 2𝑇𝑚,𝑛 𝑞ሶ
+ + =0
∆𝑥 2 ∆𝑦 2 𝑘
2
𝑞ሶ ∆𝑥
And for ∆𝑥 = ∆𝑦: 𝑇𝑚+1,𝑛 + 𝑇𝑚−1,𝑛 + 𝑇𝑚,𝑛+1 + 𝑇𝑚,𝑛−1 + − 4𝑇𝑚,𝑛 = 0
𝑘
2D SS finite difference heat
conduction – example
Consider the following simple problem with defined BCs. For the four nodes (1-4),
separated by ∆𝑥 = ∆𝑦 = 1, we have:

𝑇𝑚+1,𝑛 + 𝑇𝑚−1,𝑛 + 𝑇𝑚,𝑛+1 + 𝑇𝑚,𝑛−1 − 4𝑇𝑚,𝑛 = 0

1: 𝑇2 + 100 + 500 + 𝑇3 − 4𝑇1 = 0

2: 100 + 𝑇1 + 500 + 𝑇4 − 4𝑇2 = 0

3: 𝑇4 + 100 + 𝑇1 + 100 − 4𝑇3 = 0

4: 100 + 𝑇3 + 𝑇2 + 100 − 4𝑇4 = 0

𝑇1 = 𝑇2 = 250℃
Solving 4 equations with 4 unknowns leads to:
𝑇3 = 𝑇4 = 150℃

From symmetry of the problem, we could see that 𝑇1 = 𝑇2 and 𝑇3 = 𝑇4 , and only solve
2 equations.
2D SS finite difference heat
conduction – example
Once the temperatures are determined, the heat flow may be calculated from:

∆𝑇 ∆𝑇
𝑞𝑥 = ෍ 𝑘∆𝑦 𝑞𝑦 = ෍ 𝑘∆𝑥
∆𝑥 ∆𝑦

Where the ∆𝑇 is taken at the boundaries with summation


over all nodes along the axis. In this example the heat flow
may be calculated at either the 500℃ face or the three
100℃ faces.

∆𝑥
For the 500℃ face: 𝑞 = −𝑘 ∆𝑦 250 − 500 + 250 − 500 = 𝟓𝟎𝟎𝒌
∆𝑦
For three 100℃ faces: 𝑞 = −𝑘 ∆𝑥 ሾ 250 − 100 + 150 − 100 + 150 − 100 +
∆𝑥
250 − 100 ሿ − 𝑘 ∆𝑦 150 − 100 + 150 − 100 = −𝟓𝟎𝟎𝒌

The results are in agreement, thus implying that sufficiently fine grid was used. If the
results differ, it is a good practice to take the arithmetic average in calculations.
2D SS finite difference heat
conduction – convective BCs
When the solid is exposed to some convection BC, the temperatures at the surface
must be computed differently from the method given above. Consider the boundary
shown below. The energy balance on node (𝑚, 𝑛) is:

𝑇𝑚,𝑛 − 𝑇𝑚−1,𝑛 ∆𝑥 𝑇𝑚,𝑛 − 𝑇𝑚,𝑛+1


−𝑘∆𝑦 −𝑘
∆𝑥 2 ∆𝑦
∆𝑥 𝑇𝑚,𝑛 − 𝑇𝑚,𝑛−1
−𝑘 = ℎ∆𝑦 𝑇𝑚,𝑛 − 𝑇∞
2 ∆𝑦

And for ∆𝑥 = ∆𝑦:


ℎ∆𝑥 ℎ∆𝑥 1
𝑇𝑚,𝑛 +2 − 𝑇 − 2𝑇𝑚−1,𝑛 + 𝑇𝑚,𝑛+1 + 𝑇𝑚,𝑛−1 = 0
𝑘 𝑘 ∞ 2

Equation like the above one must be used for all nodes on convective boundary
(planar boundary), while the equation from slides 2-4 must be used for all internal
nodes.
2D SS finite difference heat
conduction – convective BCs
The equation for planar convective boundary will not apply for other situations, such as
an insulated wall or a corner exposed to convection. Consider such corner shown
below. The energy balance for the corner section is:
∆𝑦 𝑇𝑚,𝑛 − 𝑇𝑚−1,𝑛 ∆𝑥 𝑇𝑚,𝑛 − 𝑇𝑚,𝑛−1
−𝑘 −𝑘
2 ∆𝑥 2 ∆𝑦
∆𝑥 ∆𝑦
=ℎ 𝑇𝑚,𝑛 − 𝑇∞ + ℎ 𝑇 − 𝑇∞
2 2 𝑚,𝑛

And if ∆𝑥 = ∆𝑦:

ℎ∆𝑥 ℎ∆𝑥
2𝑇𝑚,𝑛 +1 −2 𝑇 − 𝑇𝑚−1,𝑛 + 𝑇𝑚,𝑛−1 = 0
𝑘 𝑘 ∞

Other boundary conditions may be treated in a similar fashion


2D SS finite difference heat
conduction – summary of BCs
In the following slides there is a summary of various nodal equations describing
respective physical situations.
2D SS finite difference heat
conduction – summary of BCs
2D SS finite difference heat
conduction – summary of BCs
2D SS finite difference heat
conduction – summary of BCs
2D SS finite difference heat
conduction – example
2D SS finite difference heat
conduction – example
2D SS finite difference heat
conduction – example
2D SS finite difference heat
conduction – example
2D SS finite difference heat
conduction – example
2D SS finite difference heat
conduction – example
Numerical formulation in terms
of resistance elements
Numerical methods – electrical
analogy
Up to this point we have shown how conduction problems can be solved by finite-
difference approximations. An equation formulated for each node is solved for 𝑇.
In formulating the equations, we could also use a resistance concept for the heat
transfer between nodes.
Designating our node of interest with the subscript 𝑖 and the adjoining nodes with
subscript 𝑗, we have the general-conduction-node situation. At SS the net heat input to
node 𝑖 must be zero:
𝑇𝑗 − 𝑇𝑖
𝑞𝑖 + ෍ =0
𝑅𝑖𝑗
𝑗

Where 𝑞𝑖 is the heat delivered to the node (e.g., radiation).


Rearranging terms in the above expression yields an
equation for 𝑇𝑖 , known as Gauss-Seidel iteration.
𝑇
𝑞𝑖 + σ𝑗 𝑗൘𝑅
𝑖𝑗
𝑇𝑖 =
σ𝑗 1ൗ𝑅
𝑖𝑗
Gauss-Seidel iteration – method
The Gauss-Seidel method is iterative, which implies repeat calculations of
temperatures using the equation below.
𝑇
𝑞𝑖 + σ𝑗 𝑗൘𝑅
𝑖𝑗
𝑇𝑖 =
σ𝑗 1ൗ𝑅
𝑖𝑗

The method should be used through the following procedure:

1. An initial set of values for the 𝑇𝑖 is assumed. This initial assumption can be obtained
through any convenient method. Note, that further away from the correct value of 𝑇𝑖
the guess was, the more iterations it would take to solve the problem, so “common
sense” guess is advised.
2. The new values of the nodal temperatures 𝑇𝑖 are calculated according to the above
equation, always using the most recent values of the 𝑇𝑗 .

3. The process is repeated until successive calculations differ by a sufficiently small


amount.
Numerical methods – electrical
analogy
Table below lists the resistance elements that correspond to the nodes in the table for
the finite difference method.
Gauss-Seidel iteration – example
Let us solve the same problem as before using the resistances method.
Gauss-Seidel iteration – example
Gauss-Seidel iteration – example
Transient numerical methods
backward and forward
differences
Discretisation of transient
diffusion
Many geometric shapes of practical interest do not match those that can be solved
analytically. Furthermore, many problems have BCs that vary with time. In such cases,
the problems are best handled by a numerical techniques.
When setting up the calculations we limit the analysis to 2D systems for simplicity.
Consider a two-dimensional body divided into increments:

The governing equation for transient heat transfer is

𝜕𝑇 𝜕 2 𝑇 𝜕 2 𝑇 𝑞ሶ
𝜌𝑐𝑝 =𝑘 + +
𝜕𝑡 𝜕𝑥 2 𝜕𝑦 2 𝑘

For SS case, we have:


𝜕2𝑇 1
≈ 𝑇𝑚+1,𝑛 + 𝑇𝑚−1,𝑛 − 2𝑇𝑚,𝑛
𝜕𝑥 2 ∆𝑥 2

𝜕2𝑇 1
≈ 𝑇𝑚,𝑛+1 + 𝑇𝑚,𝑛−1 − 2𝑇𝑚,𝑛
𝜕𝑦 2 ∆𝑦 2
Discretisation of transient
diffusion
𝜕𝑇 𝜕 2 𝑇 𝜕 2 𝑇 𝑞ሶ
𝜌𝑐𝑝 =𝑘 + +
𝜕𝑡 𝜕𝑥 2 𝜕𝑦 2 𝑘

The time derivative in the diffusion equation can be written as (recall lumped capacity)
𝑝+1 𝑝
𝜕𝑇 𝑇𝑚,𝑛 − 𝑇𝑚,𝑛

𝜕𝑡 ∆𝑡

Combining together:

𝑇𝑚+1,𝑛 𝑝 + 𝑇𝑚−1,𝑛 𝑝 − 2𝑇𝑚,𝑛 𝑝


∆𝑥 2
𝑝+1 𝑝
𝑇𝑚,𝑛+1 𝑝 + 𝑇𝑚,𝑛−1 𝑝 − 2𝑇𝑚,𝑛 𝑝 1 𝑇𝑚,𝑛 − 𝑇𝑚,𝑛
+ =
∆𝑦 2 𝛼 ∆𝑡
Discretisation of transient
diffusion
𝜕𝑇 𝜕 2 𝑇 𝜕 2 𝑇 𝑞ሶ
𝜌𝑐𝑝 =𝑘 + +
𝜕𝑡 𝜕𝑥 2 𝜕𝑦 2 𝑘

𝑝+1 𝑝 𝛼∆𝑡 𝑝 𝑝 𝑝 𝛼∆𝑡 𝑝 𝑝 𝑝


Or: 𝑇𝑚,𝑛 = 𝑇𝑚,𝑛 + 𝑇 + 𝑇 − 2𝑇𝑚,𝑛 + 𝑇 + 𝑇 − 2𝑇𝑚,𝑛
∆𝑥 2 𝑚+1,𝑛 𝑚−1,𝑛
∆𝑦 2 𝑚,𝑛+1 𝑚,𝑛−1

𝑝+1
If ∆𝑥 = ∆𝑦 we can write for 𝑇𝑚,𝑛

𝑝+1
𝑇𝑚,𝑛
𝑝 𝛼∆𝑡 𝑝 𝑝 𝑝
= 𝑇𝑚,𝑛 + 𝑇𝑚+1,𝑛 + 𝑇𝑚−1,𝑛 − 2𝑇𝑚,𝑛
∆𝑥 2
𝛼∆𝑡 𝑝 𝑝 𝑝
+ 2
𝑇𝑚,𝑛+1 + 𝑇𝑚,𝑛−1 − 2𝑇𝑚,𝑛
∆𝑥
Discretisation of transient
diffusion
𝜕𝑇 𝜕 2 𝑇 𝜕 2 𝑇 𝑞ሶ
𝜌𝑐𝑝 =𝑘 + +
𝜕𝑡 𝜕𝑥 2 𝜕𝑦 2 𝑘

∆𝑥 2
If the time and distance increments are chosen so that 𝛼∆𝑡
= 4, we obtain:

𝑝+1 1 𝑝 𝑝 𝑝 𝑝
𝑇𝑚,𝑛 = 𝑇𝑚+1,𝑛 + 𝑇𝑚−1,𝑛 + 𝑇𝑚,𝑛+1 + 𝑇𝑚,𝑛−1
4

That is, temperature at the central node at later time is


an arithmetic average of temperatures of 4
neighbouring nodes an earlier time.
𝛼∆𝑡
Fourier number, Fo = , is dimensionless and
∆𝑥 2
expresses a ratio of time, 𝑡, to characteristic timescale
2
for heat diffusion, 𝑡𝑑 = 𝐿 Τ𝛼.
Discretisation of transient
diffusion
𝜕𝑇 𝜕 2 𝑇 𝜕 2 𝑇 𝑞ሶ
𝜌𝑐𝑝 =𝑘 + +
𝜕𝑡 𝜕𝑥 2 𝜕𝑦 2 𝑘

𝑝+1 𝛼∆𝑡 𝑝 𝑝 2𝛼∆𝑡 𝑝


For 1D problem: 𝑇𝑚,𝑛 = 𝑇 + 𝑇 + 1 − 𝑇
∆𝑥 2 𝑚+1 𝑚−1
∆𝑥 2 𝑚

∆𝑥 2 𝑝+1 1 𝑝 𝑝
If we set = 2, we obtain 𝑇𝑚,𝑛 = 2 𝑇𝑚+1 + 𝑇𝑚−1 .
𝛼∆𝑡

• Choosing larger ∆𝑥 and ∆𝑡, makes the computation faster (e.g., compare the
∆𝑥 2
original equation with the one when = 2) but less accurate, and vice versa.
𝛼∆𝑡
∆𝑥 2
• Defining the parameter = 𝑀, we observe that the use of larger values of ∆𝑡 for
𝛼∆𝑡
𝑝
a selected value of ∆𝑥, so that 𝑀 < 2 which leads to a negative coefficient of 𝑇𝑚 .
This violates the 2nd law of thermodynamics. Therefore,
∆𝑥 2 ∆𝑥 2
𝑀= ≥ 2 for 1D systems 𝑀= ≥ 4 for 2D systems
𝛼∆𝑡 𝛼∆𝑡
Discretisation of transient
diffusion – BCs
At the boundary of the solid, a convection resistance to heat flow is usually involved. In
general, each convection BC must be handled separately, depending on geometry.
The case of the flat wall and 1D transient heat transfer will be considered as an
example.
𝜕𝑇
For the actual physical BC −𝑘 𝜕𝑥ቚ = ℎ𝐴 𝑇𝑤𝑎𝑙𝑙 − 𝑇∞ , the
𝑤𝑎𝑙𝑙
finite difference approximation is:
∆𝑦
−𝑘 𝑇 − 𝑇𝑚 = ℎ∆𝑦 𝑇𝑚+1 − 𝑇∞
∆𝑥 𝑚+1
From where we get:
ℎ∆𝑥
𝑇𝑚 + 𝑇∞ 𝑇 + Bi ∙ 𝑇
𝑘 𝑚 ∞
𝑇𝑚+1 = =
ℎ∆𝑥 1 + Bi
1+
𝑘
ℎ∆𝑥
Where Bi = .
𝑘
Discretisation of transient
diffusion – BCs
We make also a transient energy balance on the node (𝑚, 𝑛) by setting the sum of the
energy conducted and convected into the node equal to the increase in the internal
energy of the node.
∆𝑦 𝑝 𝑝 ∆𝑥 𝑝 𝑝
𝑘 𝑇𝑚−1,𝑛 − 𝑇𝑚,𝑛 + 𝑘 𝑇𝑚,𝑛+1 − 𝑇𝑚,𝑛
∆𝑥 2∆𝑦
∆𝑥 𝑝 𝑝 𝑝
+𝑘 𝑇𝑚,𝑛−1 − 𝑇𝑚,𝑛 + ℎ𝐴 𝑇∞ − 𝑇𝑚,𝑛
2∆𝑦
𝑝+1 𝑝
∆𝑥 𝑇𝑚,𝑛 − 𝑇𝑚,𝑛
= 𝜌𝑐 ∆𝑦
2 ∆𝑡
If ∆𝑥 = ∆𝑦:

𝑝+1 𝛼∆𝑡 ℎ∆𝑥 𝑝 𝑝 𝑝 ∆𝑥 2 ℎ∆𝑥 𝑝


𝑇𝑚,𝑛 = 2 𝑇∞ + 2𝑇𝑚−1,𝑛 + 𝑇𝑚,𝑛+1 + 𝑇𝑚,𝑛−1 + −2 − 4 𝑇𝑚,𝑛
∆𝑥 2 𝑘 𝛼∆𝑡 𝑘

𝑝+1 𝛼∆𝑡 ℎ∆𝑥 𝑝 ∆𝑥 2 ℎ∆𝑥 𝑝


And for 1D: 𝑇𝑚 = 2 𝑇∞ + 2𝑇𝑚−1 + −2 − 2 𝑇𝑚
∆𝑥 2 𝑘 𝛼∆𝑡 𝑘
Discretisation of transient
diffusion – BCs
𝑝 𝑝
The coefficients of 𝑇𝑚,𝑛 and 𝑇𝑚 are not as simple as for internal nodes, so that

∆𝑥 2 ℎ∆𝑥 ∆𝑥 2 ℎ∆𝑥
=2 + 2 for 2D and =2 + 1 for 1D should be chosen to simplify
𝛼∆𝑡 𝑘 𝛼∆𝑡 𝑘
the equations and therefore, speed up the computation.

∆𝑥 2 ℎ∆𝑥
To ensure the convergence of the numerical solution, ≥2 + 2 for 2D and
𝛼∆𝑡 𝑘
∆𝑥 2 ℎ∆𝑥
≥2 + 1 for 1D.
𝛼∆𝑡 𝑘

All previous analysis was conducted using the so-called forward differences when 𝑇
values at later time (𝑝 + 1) are obtained from the values at 𝑝.
𝑝+1
In all such cases, 𝑇𝑚,𝑛 was explicitly expressed through nodal 𝑇 at 𝑝, hence the
method is termed explicit.
Discretisation of transient
diffusion – backward difference
The difference equation may also be formulated by computing the space derivatives in
terms of the temperatures at the 𝑝 + 1.
The transient 2D diffusion equation will take form:

𝑝+1 𝑝
𝑇𝑚+1,𝑛 𝑝+1 + 𝑇𝑚−1,𝑛 𝑝+1 − 2𝑇𝑚,𝑛 𝑝+1 𝑇𝑚,𝑛+1 𝑝+1 + 𝑇𝑚,𝑛−1 𝑝+1 − 2𝑇𝑚,𝑛 𝑝+1 1 𝑇𝑚,𝑛 − 𝑇𝑚,𝑛
+ =
∆𝑥 2 ∆𝑦 2 𝛼 ∆𝑡

𝑝
And explicitly expressing 𝑇𝑚,𝑛

𝑝 −𝛼∆𝑡 𝑝+1 𝑝+1 𝑝+1 𝑝+1 4𝛼∆𝑡 𝑝+1


𝑇𝑚,𝑛 = 𝑇 + 𝑇𝑚−1,𝑛 + 𝑇𝑚,𝑛+1 + 𝑇𝑚,𝑛−1 + 1 + 𝑇
∆𝑥 2 𝑚+1,𝑛 ∆𝑥 2 𝑚,𝑛
The expression above provides an implicit dependence of 𝑇 at 𝑝 + 1 on that at 𝑝,
hence this representation is termed implicit.
∆𝑥 2
The implicit formulation has no limits for . Table 4-2 (Holman textbook) provides a
𝛼∆𝑡
comprehensive list of BCs.
Thermal resistance and
capacitance formulation for
transient problems
Resistance-capacitance systems
The rate of change of internal energy expressed in terms of specific heat and 𝑇 is
approximated by
𝑝 𝑝 𝑝+1 𝑝
𝑇𝑗 − 𝑇𝑖 𝑇𝑖 − 𝑇𝑖
𝑞𝑖 + ෍ = 𝐶𝑖
𝑅𝑖𝑗 ∆𝑡
𝑗

Where 𝐶𝑖 = 𝜌𝑖 𝑐𝑖 ∆𝑉𝑖 = 𝜌𝑖 𝑐𝑖 ∆𝑥𝑖 ∆𝑦𝑖 ∆𝑧𝑖 . From the above we obtain

𝑝 𝑝
𝑝+1 ∆𝑡 𝑇𝑗 − 𝑇𝑖 𝑝
𝑇𝑖 = 𝑞𝑖 + ෍ + 𝑇𝑖
𝐶𝑖 𝑅𝑖𝑗
𝑗

You might also like