A brief look at visionOS - How to develop app on Apple's Vision Pro
Heat Conduction Simulation with FDM
1. Heat Conduction Simulation with FDM
Xueer Zhang
1. Problem and Objectives
Consider a thick walled square conduit of steam. The inside wall of the conduit is maintained
at temperature Tin = 200 o
C, while the outside surface is maintained at temperature Tout = 22 o
C.
The dimensions of the conduit are shown in the diagram in terms of the outer side length a = 0.56
m and inner side length b = 0.28 m. The material of the wall has a density of ρ= 8,000 kg/m3
,
specific heat of ν= 450 J/kg-0
C, and conductivity of k = 42 W/ m-0
C . The conduction along the
axial direction of the conduit can be neglected.
Figure 1 conductor geometrics
a) Use non dimensional variables for distances, time and temperature and derive the partial
differential equation governing the transient heat conduction in this problem for times
between the initial time t = 0, when the entire conduit walls were at temperature T = 22
oC, and the time ts when steady state temperature distribution was reached. Specify the
boundary conditions, initial conditions and any non-dimensional parameters of the problem.
b) Write a program which utilizes the method of finite differences to calculate and output the
space distribution of temperature in the walls for the case of steady state, i.e. t>ts. The
solution should be obtained first with a uniform grid which places two internal nodes between
the walls. Then the solution so obtained should be checked with the solution obtained by a
grid which places 5 equidistance points between the walls.
c) Modify your program so that it can describe the transient heat distribution for times prior to
the establishment of steady state.
2. Conduction Equation Derivation
To look into a spatial medium D’s characteristic of heat conduction, we use function u (t; x; y;
z) to represent the temperature of D at position (x; y; z) and time t.
According to Fourier experimental theorem in heat transfer, the heat passes through an
infinitely small area dS along the normal direction n in an infinitely small time period dt is in
b a
2. proportion to the gradient of temperature along n:
dQ = −k(x,y, z)
∂u
∂n
𝑑𝑆𝑑𝑡
Where k>0 is the conductivity of D at (x, y, z). A negative sign is added because heat always
flows from hotter side to cooler side, which means dQ and ∂u/∂n should have opposite signs.
Define a region Ω closed by surface Γ in the medium D. The heat fluxes in Γ from time t1 to t2:
Q = ∫ {∬ 𝑘(𝑥, 𝑦, 𝑧)
∂u
∂n
𝑑𝑆
Γ
} 𝑑𝑡
𝑡2
𝑡1
Where
∂u
∂n
is the gradient of u along unit exterior normal n on Γ.
The heat fluxing in changes the interior temperature of the medium from u (t1, x, y, z) to u (t2,
x, y, z). The heat assumed to be absorbed is:
∭ 𝜈(𝑥, 𝑦, 𝑧)𝜌(𝑥, 𝑦, 𝑧)[𝑢(t1, x, y, z) − u(t2, x, y, z)]𝑑𝑥𝑑𝑦𝑑𝑧
𝛺
Where ν is the specific heat of D, and ρ is the density. Then have
∫ {∬ 𝑘
∂u
∂n
𝑑𝑆
Γ
} 𝑑𝑡 =
𝑡2
𝑡1
∭ 𝜈𝜌[𝑢(t1, x, y, z) − u(t2, x, y, z)]𝑑𝑥𝑑𝑦𝑑𝑧
𝛺
Assume u has second order continuous partial derivative about x, y, z and first order
continuous partial derivative about t. Applying Green formula gives
∫ ∭ [
𝜕
𝜕𝑥
(𝑘
𝜕𝑢
𝜕𝑥
) +
𝜕
𝜕𝑦
(𝑘
𝜕𝑢
𝜕𝑦
) +
𝜕
𝜕𝑧
(𝑘
𝜕𝑢
𝜕𝑧
)]𝑑𝑥𝑑𝑦𝑑𝑧
𝛺
𝑑𝑡 = ∭ 𝜈𝜌 (∫
∂u
∂t
𝑑𝑡
𝑡2
𝑡1
) 𝑑𝑥𝑑𝑦𝑑𝑧
𝛺
𝑡2
𝑡1
Rearranging the integral, have
∫ ∭ [𝜈𝜌
∂u
∂t
−
𝜕
𝜕𝑥
(𝑘
𝜕𝑢
𝜕𝑥
) −
𝜕
𝜕𝑦
(𝑘
𝜕𝑢
𝜕𝑦
) −
𝜕
𝜕𝑧
(𝑘
𝜕𝑢
𝜕𝑧
)]𝑑𝑥𝑑𝑦𝑑𝑧
𝛺
𝑑𝑡 = 0
𝑡2
𝑡1
Since t1, t2 and region Ω are arbitrary, so
𝜈𝜌
∂u
∂t
=
𝜕
𝜕𝑥
(𝑘
𝜕𝑢
𝜕𝑥
) +
𝜕
𝜕𝑦
(𝑘
𝜕𝑢
𝜕𝑦
) +
𝜕
𝜕𝑧
(𝑘
𝜕𝑢
𝜕𝑧
)
Which is the heat conduction equation for inhomogeneous isotropic medium. If the medium
is homogeneous, k, ν andρare constants. Let k/ρν=c2
,then have
𝜕𝑢
𝜕𝑡
= 𝑐2
(
𝜕2
𝑢
𝜕𝑥2
+
𝜕2
𝑢
𝜕𝑦2
+
𝜕2
𝑢
𝜕𝑧2
)
Which is the transient heat conduction equation for isotropic medium. In this case, we are
dealing with a planar problem. The equation with dimensional variables can be written as:
∂u
∂t
= 𝑐2
(
𝜕2
𝑢
𝜕𝑥2
+
𝜕2
𝑢
𝜕𝑦2
)
3. 3. Non-dimensionalization
Substitution of non-dimensionalized u*=u/Tout, x*=x/a and y*=y/a into the conduction
equation gives
Tout
∂u∗
∂t
= 𝑐2
Tout
𝑎2
(
𝜕2
𝑢∗
𝜕𝑥∗2 +
𝜕2
𝑢∗
𝜕𝑦∗2)
For a simpler form of governing equation, let t* =t/ (a2
/c2
)= t(k/ a2
νρ), have
∂u∗
∂t∗
= (
𝜕2
𝑢∗
𝜕𝑥∗2 +
𝜕2
𝑢∗
𝜕𝑦∗2)
Boundary conditions are:
u*(x*=0) = u*(x*=1) = u*(y*=0) = u*(y*=1) = 1
u*(b*≤ x*≤(1+b*)/2 ∩ b*≤ y*≤(1+b*)/2) = Tin/Tout, where b*=b/a
Initial conditions are:
u*(b*≤ x*≤(1+b*)/2 ∩ b*≤ y*≤(1+b*)/2) = Tin/Tout
u*(other) = 1
4. Meshing
1) Grid size
If Np points are inserted between adjacent inner and outer walls, the grid size would be
h =
1 − b∗
2(Np + 1)
Accordingly, there would be n=1+4(Np+1) grid points on each dimension and totally N= n2
points for this special case (a=2b).
As indicated in figure 2, subscripts i and j are utilized to locate the grid points as an n*n matrix,
which will be explained later.
4. Figure 2 partial diagram of grid meshing
2) Step size
For convergence, which can be ensured by a diagonally dominant coefficient matrix, we
choose step size k small enough with respect to grid size h:
k =
ℎ2
4
5. Computing and Results
For higher precision and convergence, implicit method of finite differences is chosen:
𝑇𝑖,𝑗
𝑛+1
− 𝑇𝑖,𝑗
𝑛
∆𝑡
= 𝜅 (
𝑇𝑖,𝑗+1
𝑛+1
− 2𝑇𝑖,𝑗
𝑛+1
+ 𝑇𝑖,𝑗−1
𝑛+1
∆𝑥2
+
𝑇𝑖+1,𝑗
𝑛+1
− 2𝑇𝑖,𝑗
𝑛+1
+ 𝑇𝑖−1,𝑗
𝑛+1
∆𝑦2
) +
𝑄𝑖,𝑗
𝑛
𝜌𝑐 𝑝
Where Δt=k, Δx=Δy=h, conductivity κ is non-dimensionalized to 1 and interior heat source Q=0
for this case, so
𝑇𝑖,𝑗
𝑛+1
− 𝑇𝑖,𝑗
𝑛
𝑘
=
𝑇𝑖−1,𝑗
𝑛+1
+𝑇𝑖,𝑗−1
𝑛+1
− 4𝑇𝑖,𝑗
𝑛+1
+ 𝑇𝑖,𝑗+1
𝑛+1
+ 𝑇𝑖+1,𝑗
𝑛+1
ℎ2
1) Steady
Substituting 𝑇𝑖,𝑗
𝑛+1
= 𝑇𝑖,𝑗
𝑛
, have
𝑇𝑖−1,𝑗
𝑛+1
+𝑇𝑖,𝑗−1
𝑛+1
− 4𝑇𝑖,𝑗
𝑛+1
+ 𝑇𝑖,𝑗+1
𝑛+1
+ 𝑇𝑖+1,𝑗
𝑛+1
= 0
Along with boundary conditions. To solve this system of n2
equations, we can develop a
coefficient matrix A and rearrange 𝑇𝑖,𝑗
𝑛+1
as a column array “TT”, then applying the right-hand
side of this steady equation and all the boundary conditions to another column array “rhs”,
which satisfies.
[A] 𝑁×𝑁{𝑇𝑇} 𝑁×1 = {𝑟ℎ𝑠} 𝑁×1
5. To uniform, define matrix {TT} as follows
TT =
[
𝑇1,1
𝑇1,2
:
𝑇1,𝑛
𝑇2,1
𝑇2,2
:
𝑇𝑛,1
:
𝑇𝑛,𝑛−1
𝑇𝑛,𝑛 ]
To specify the relationship between TT and T, introduce J = n (i-1) +j which satisfies
𝑇𝑇J = 𝑇i,j
Take Np=1 as an example. There would be N=81 grid points, which are indicated as 81
intersections in figure 3. Colored lines and characters represent different kind of boundary
conditions.
TTJ=Ti,j
TT28 TT29 TT30 TT31
TT19 TT20 TT21 TT22 TT23 TT24 TT25 TT26 TT27
TT10=T2,1 TT11=T2,2 TT12 TT13 TT14 TT15 TT16 TT17 TT18
TT1=T1,1 TT2=T1,2 TT3=T1,3 TT4=T1,4 TT5=T1,5 TT6=T1,6 TT7=T1,7 TT8=T1,8 TT9=T1,9
Figure 3 numbering scheme for a gird with Np=1
Accordingly, matrix A and array rhs would be something like
7. Figure 4 non-dimensional temperature distribution
2) Transient
By substituting k=h2/4 into
𝑇𝑖,𝑗
𝑛+1
− 𝑇𝑖,𝑗
𝑛
𝑘
=
𝑇𝑖−1,𝑗
𝑛+1
+𝑇𝑖,𝑗−1
𝑛+1
− 4𝑇𝑖,𝑗
𝑛+1
+ 𝑇𝑖,𝑗+1
𝑛+1
+ 𝑇𝑖+1,𝑗
𝑛+1
ℎ2
Rearranging terms, have
−𝑇𝑖−1,𝑗
𝑛+1
−𝑇𝑖,𝑗−1
𝑛+1
+ 8𝑇𝑖,𝑗
𝑛+1
− 𝑇𝑖,𝑗+1
𝑛+1
− 𝑇𝑖+1,𝑗
𝑛+1
= 4𝑇𝑖,𝑗
𝑛
Based on foregoing analysis, this transient system can be solved by interaction. Determine the
coefficient matrix A and let {TT} n be the right-hand side array, then {TT} n+1 can be computed:
TT𝑛+1 = 𝐴TT𝑛
Results from MATLAB programming:
When Np=2, the get-steady time for error < 0.01 is ts =1353.3 s.
8. Figure 5 transient temperature contour (Np=2)
When Np=5, the get-steady time for error < 0.01 is ts =1213.3 s.
Figure 6 transient temperature contour (Np=5)