You are on page 1of 2

Solving the heat equation

Charles Xie
The Advanced Educational Modeling Laboratory
The Concord Consortium, Concord, MA 01742

The heat conduction for heterogeneous media is modeled using the following partial differential
equation:

T
c + (vT ) = [kT ] + q (1)
t

where k is the thermal conductivity, c is the specific heat capacity, is the density, v is the
velocity field, and q is the internal heat generation. The heat equation has two parts: the diffusion
part characterized by the conductivity field function and the advection part characterized by the
velocity field function. The internal heat generation term can be thought of as an external force.

The partial differential equation is discretized in both space and time domain in order to find
approximate solutions. Sometimes, this numeric method is called the finite-difference time-
domain (FDTD) method. An implicit FDTD method can be used to achieve better numeric
stability:

Ti ,nj+,1k Ti ,nj ,k u in++11, j ,k Ti +n1+,1j ,k u in+11, j ,k Ti n1+,1j ,k


+ +
t 2x
i , j ,k ci , j ,k n+1 n+1 n +1 n +1 n +1 n +1 n +1 n +1
vi , j +1,k Ti , j +1,k vi , j 1,k Ti , j 1,k + wi , j ,k +1Ti , j ,k +1 wi , j ,k 1Ti , j ,k 1
2y 2z

1 Ti +n1+,1j ,k Ti ,nj+,1k Ti ,nj+,1k Ti n1+,1j ,k


= i +1 / 2, j ,k
k k i 1 / 2 , j , k
x x x
1 Ti ,nj++11,k Ti ,nj+,1k Ti ,nj+,1k Ti ,nj+11,k
+ k i , j +1 / 2,k k i , j 1 / 2,k
y y y
1 Ti ,nj+,1k +1 Ti ,nj+,1k Ti ,nj+,1k Ti ,nj+,1k 1 n
+ i , j ,k +1 / 2
k k i , j , k 1 / 2 + qi , j ,k ( 2)
z z z

where M>i0, N>j0, and L>k0, with M, N, and L representing the numbers of cubic voxels in x,
y, and z directions, and x, y, and z are the lengths of the cubic voxels in the three directions,
respectively. t is the time step. In theory, an implicit method is unconditionally stable, allowing
any time step to be taken, and the simulation will not blow up1. Note that in Eq. (2) we also
avoid directly calculating the spatial derivatives of the conductivity function, which would be

1
In practice, the advection part of the heat equation can cause numeric instability, especially when the
velocity is high.

1
very large at the interfaces between two distinct kinds of media and therefore would cause
numeric instability.

Let:

i , j , k ci , j , k
i , j ,k =
t
k i 1 / 2, j ,k k i 1, j ,k + k i , j ,k k i +1 / 2, j ,k k i , j ,k + k i +1, j ,k
Aix, j ,k = = , Bix, j ,k = =
(x ) 2
2(x )
2
(x ) 2
2(x )
2

k i , j 1 / 2,k k i , j 1,k + k i , j ,k k i , j +1 / 2,k k i , j ,k + k i , j +1,k


Aiy, j ,k = = , Biy, j ,k = =
(y ) 2
2(y )
2
(y )2 2(y )
2

k i , j ,k 1 / 2 k i , j ,k 1 + k i , j ,k k i , j ,k +1 / 2 k i , j ,k + k i , j ,k +1
Aiz, j ,k = = , Biz, j ,k = =
(z )2 2(z )
2
(z )2 2(z )
2

i , j ,k ci , j ,k uin+11, j ,k i , j ,k ci , j ,k u in++11, j ,k
Cix, j ,k = Aix, j ,k + , Dix, j ,k = Bix, j ,k
2x 2x
i , j ,k ci , j ,k vin, +j 11,k i , j ,k ci , j ,k vin, +j +11,k
Ciy, j ,k = Aiy, j ,k + , Diy, j ,k = Biy, j ,k
2y 2y
i , j ,k ci , j ,k win, +j 1,k 1 i , j ,k ci , j ,k win, +j 1,k +1
C z
=A z
+ ,D z
=B z
(3)
2z 2z
i , j ,k i , j ,k i , j ,k i , j ,k

Eq. (2) can be rewritten as:

Ti ,nj+,1k =
i , j ,k Ti ,nj ,k + qin, j ,k + Cix, j ,k Ti n1+,1j ,k + Dix, j ,k Ti +n1+,1j ,k + Ciy, j ,k Ti ,nj+11,k + Diy, j ,k Ti ,nj++11,k + Ciz, j ,k Ti ,nj+,1k 1 + Diz, j ,k Ti ,nj+,1k +1
i , j ,k + Aix, j ,k + Bix, j ,k + Aiy, j ,k + Biy, j ,k + Aiz, j ,k + Biz, j ,k
(4)
2
This is a very sparse matrix that can be solved efficiently using a relaxation method .

Two boundary conditions can be used. The first kind is the Dirichilet boundary condition, which
maintains the temperature at the boundary. The second kind is the Neumann boundary condition,
which maintains the flux at the boundary.

2
http://en.wikipedia.org/wiki/Relaxation_method

You might also like