Sie sind auf Seite 1von 27

On the use of spreadsheets

in heat conduction analysis


ESMAIL M. A. MOKHEIMER*, Mechanical Engineering Department,
King Fahad University of Petroleum and Minerals, P.O. Box 279,
Dhahran 31261, Saudi Arabia esmailm@kfupm.edu.sa and
MOHAMED A. ANTAR, Assistant Professor, Mechanical Engineering
Department, King Fahd University of Petroleum and Minerals, P.O. Box
535, Dhahran 31261, Saudi Arabia antar@kfupm.edu.sa

Received 11th May 1998

Detailed methodology and different techniques for simply utilizing the widely available and
user friendly spreadsheet programs in heat conduction analysis are presented. Evaluation of
analytical and numerical solution of heat conduction problems via spreadsheets is investi-
gated. Detailed techniques of obtaining spreadsheet numerical solutions for one- and two-
dimensional steady and transient heat conduction problems are introduced. A new technique
of marching the transient numerical solution with time, in a single layer spreadsheet, for
one- and two-dimensional heat conduction is explained. Creating macros that automate the
spreadsheet processes, particularly calculations, is detailed. Utilization of the powerful
graphical facility that is built in the spreadsheets to graphically represent the obtained
solutions is outlined.

Key words: heat, conduction, spreadsheet, analytical, numerical, transient, steady.

NOTATION

a the length of a two-dimensional plate


b the width of a two-dimensional plate
Bi Biot number = hbk
Fo Fourier number = X 2
g uniform internal heat generation
G dimensionless heat generation, a 2 g ( k (Tw To ))
h convective heat transfer coefficient
i numerical index in X-direction
j numerical index in Y-direction
k thermal conductivity
K numerical index of time
L length of the one-dimensional fin
m dimensional constant, PhL2 Ak

* On leave from Ain Shams University, Egypt.

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


114 Esmail M. A. Mokheimer and Mohamed A. Antar

M counter gives the number of nodes in Y-direction


N counter gives the number of nodes in X-direction
P perimeter of the fin cross-section
q heat transfer rate
t time
T temperature
x Cartesian coordinate
X dimensionless Cartesian coordinate = xa
y the transverse Cartesian coordinate
Y the dimensionless transverse Cartesian coordinate = yb

Greek letters
thermal diffusivity
dimensionless temperature = (T To ) (Tw To )
dimensionless time = t a 2

Subscripts

i the node index in X-direction


j the node index in Y-direction
o ambient
w at the wall

Superscripts

K time index means at time


K + 1 time index means at time +

1. INTRODUCTION
Spreadsheet programs, these days, highly utilize the data manipulation capabilities of the
computer. Having great power and versatility, spreadsheet programs have been used for
business calculations since the onset of their public use. In addition, the revolutionary way of
utilizing this facility, in solving problems of engineering applications, is being accepted
worldwide.
The spreadsheet which consists of a 2-D grid is quite suitable to solve one- and two-
dimensional, steady and transient heat conduction problems. It is worth mentioning here that
three-dimensional heat conduction problems can also be tackled using spreadsheet
capabilities. Eid [1], in 1982, implemented the spreadsheet numerical solution for heat flow
in a plate as an example for the two-dimensional steady and transient heat conduction.
Baughn et al. [2] described a method for using the spreadsheets to solve one- and two-
dimensional transient heat conduction problems. Weston [3] introduced the use of spread-
sheet programs as an inexpensive tool for heat conduction simulation. In this paper, Weston
showed the use of spreadsheets in solving two and three-dimensional steady state conduction
problems as well as for one-dimensional transient problems. Kharab [4] used spreadsheet
programs to obtain the numerical solution of a two-dimensional transient heat conduction

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


On the use of spreadsheets in heat conduction analysis 115

problem. Mokheimer et. al. [5, 6] introduced the use of spreadsheets in solving 2-
dimensional heat conduction problems in their analysis of the heat transfer in composite fins.
A thorough review of the literature listed above, shows that most of the authors [1, 3, 4]
who introduced the use of spreadsheets in numerical solution of heat conduction problems,
gave many details about the conduction problem formulation, as well as different finite
difference techniques, used in developing the algebraic finite difference form of the
governing equations which are available in many heat transfer and numerical solution text
books. On the other hand, few details about the methodology and different techniques in
using the spreadsheet to carry out the numerical solution task were introduced. The only
paper that gives some details about the construction and the preparation of the spreadsheet as
a tool for solving heat conduction problems numerically, was that introduced by Weston [3].
However, this paper is not oriented for beginners who want to utilize the widely available
spreadsheets for numerical solutions of heat conduction and/or similar engineering problems.
The aim of the present paper is to focus on introducing detailed methodology and
different techniques to simply use the spreadsheets in solving heat conduction and/or other
similar engineering problems. The powerful graphical facility that is built into the
spreadsheets will be used to graphically represent the obtained solutions.
In this paper, the use of spreadsheets in evaluating both the analytical and numerical
solutions of heat conduction problems is presented. Detailed techniques of obtaining the
numerical solution for one- and two-dimensional steady and transient heat conduction
problems are introduced. A new technique of marching the transient numerical solution with
time for one- and two-dimensional problems is explained.

2. SPREADSHEET STRUCTURE

A spreadsheet is basically a 2-D grid, made up of individual cells. Labelling of each cell is
done as columns with A, B, C,, AA, AB, AC, DA, DB, DC, and rows with ascending
numbers 1, 2, 3, . The intersection of each column and row constitutes a cell. Each cell has
an address (e.g. a cell that has an address C3 is the cell resulted from the intersection of
Column C and row # 3). A combination of cells identified by the cell address of the upper
left and the bottom right cell, is called a range. The whole range of a spreadsheet is called a
worksheet. A spreadsheet consists of many worksheets. Each worksheet represents a layer (a
page). The worksheets constitute what is called a workbook.
Every individual cell can contain numbers, text or formulae (or logical statements). These
formulae are of basic algebraic type, including special mathematical functions that are skil-
fully built in the spreadsheet programs. Individual cells could be linked to each other through
the formula written in it. This can be done by referring to a particular cell by its address
while typing a formula in another cell. Referring to a particular cell while writing formula in
another cell makes it possible to link a specific block of cells (or range) to another block in
the same/different worksheet within the same workbook.
Among the many advantages of spreadsheets, are its calculation abilities that make one
use these programs instead of going into programming languages such as FORTRAN,
BASIC, etc. The speed of calculations using the spreadsheets is fast, in the sense that one
gets instantaneous feedback from the formula in a range, by just changing the values of the
parameters that are written in cells linked to that range. The updating of data, to see the
effect of given parameters, can be readily seen in a graph linked to the range selected. Data
entry and/or updating is extremely easy in these user friendly spreadsheets as compared to
programming in other high level languages. It is just a matter of going to the particular cell

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


116 Esmail M. A. Mokheimer and Mohamed A. Antar

and typing in the numbers. Moreover, to highly customize the spreadsheet solution proce-
dures, there is the facility to use built-in or to create Macros. Macros are mainly used to
automate a process (e.g. calculations) within the spreadsheet. In other words a macro is used
to repeat the process(es) many times and might in a manner equivalent to the Do-Loops in
FORTRAN programming language. Creating a macro is a very easy task as it will be shown
hereafter.

3. SPREADSHEET SET-UP FOR HEAT TRANSFER PROBLEMS


The structure of the spreadsheet and its built-in special mathematical functions make it
suitable to be used in solving heat conduction problems. Spreadsheet programs can be used
in evaluating simple and/or complicated analytical closed form solutions that are already
available for steady/transient, one/multi-dimension(s) heat conduction problems. Moreover,
spreadsheets are quite suitable to be used in providing the numerical solutions for steady and
transient heat conduction in one or multi dimension(s) problems that are formulated using
the finite difference techniques.
The proper way to simply and effectively tackle a heat conduction problem using the
spreadsheets is to divide the working area on the worksheet into zones or blocks. Usually,
the first zone is used for the basic data of the problem considered. Another zone may be used
for calculating some coefficients that appear in the main solution formula (e.g., the FDEs).
These coefficients may be a combination of the given data. It is always useful to have such a
zone to avoid writing lengthy equations at the cells of the calculation zone. The main zone is
that used for calculating the solution. The final spreadsheet set-up would vary according to
the problem considered, the technique used in the solution, in addition to the users own
view.

4. THE USE OF A SPREADSHEET IN EVALUATING ANALYTICAL CLOSED


FORM SOLUTIONS

The availability of many of the special mathematical functions in the spreadsheets, makes
the evaluation of the available closed form analytical solutions for steady/transient, one or
multi-dimension(s) heat conduction problems easy. Moreover, parametric studies can be
simply carried out on such solutions to investigate the effect of different parameters on the
solution. The effect of any of the physical parameters on the solution can be readily seen on
a linked graphical representation of the solution. To show this, the evaluation of a closed
form solution of a one-dimensional steady heat conduction problem will be presented. The
problem chosen, as a representative example here, is a one dimensional heat conduction in a
fin with an insulated tip shown in Fig. 1(a). The fin is of thermal conductivity k, length L,
constant cross-sectional area A, perimeter P, and specified base temperature Tw. The heat
transfer coefficient to ambient at To is h. Neglecting the temperature variation over the cross-
sectional area, for small Biot numbers, the governing equation in a dimensionless form [7]
is:

d 2
m 2 = 0 (1)
dX 2

subjected to the following boundary conditions:

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


On the use of spreadsheets in heat conduction analysis 117

Fig. 1(a). Physics of 1-D heat conduction in an insulated tip fin.

Fig. 1(b). Numerical grid of the 1-D fin.

Fig. 1(c). Schematic representation of the explicit and implicit numerical methods.

d
(0) = 1, =0 (2)
dX X =1

The solution is
Cosh( m(1 X ))
( x) = (3)
Cosh( m)

4.1 Spreadsheet set-up for 1-D steady analytical solution

The spreadsheet should consist of different zones as explained earlier. The first zone is
reserved for the data. This data zone consists of a number of cells and in each cell a
numerical value of a given parameter would be entered. So it is better to type the symbol (or
the name) of the parameter in one cell as a text mode, then in the adjacent cell type the
numerical value of it. In the present case the data zone should include the values of P, h, A,
L, k, Tw, and To, see Fig. 2(a). The second zone is used for the calculation of the coefficients
or constants that would appear in the solution, for example, m = PhL2 Ak .

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015
Fig. 2(a). Spreadsheet set-up and evaluation of the analytical and numerical steady heat conduction in a 1-D fin.
On the use of spreadsheets in heat conduction analysis 119

The third zone is the solution zone. In the present example, this zone consists of two
rows. The first row includes the independent variable X. The second row includes the
formula of the closed form solution. The number of the cells required is determined by the
user (i.e. how many points are required to express the solution at). Ten points will be used in
this example. The solution at each point will be expressed in a cell. So the first row
containing the values of the independent variable X that varies from 0 to 1 will have 10 cells.
Filling out the incremental values of X in X-row and the solution formula in the solution row
will be detailed below.
To fill the X-row, type zero at the first cell. In the adjacent cell type the value of the
increment of X (i.e. 0.1). Highlight these first two cells using the mouse. Keeping these two
cells highlighted, put the cursor at the lowest right corner of the second cell (at this position
the cursor would turn to have the shape of a cross) then drag the mous to the right, while
pushing down its left button, till the tenth cell of the X-row. Releasing the left button of the
mouse at the 10th cell, the value of X will be type automatically at each cell according to the
relation between the first two cells (i.e. each cell will have a numerical difference between its
preceding and following cell by the increment of X). Hence, the value that appears on the
tenth cell should be 1 in the present example. There is another method to do this by typing
zero at the first cell then typing a formula in the following cell that adds the increment of X
to that in its preceding cell and write the result at the current cell. To do so, the increment of
X should be calculated at a separate cell, a cell in the second (constants) zone. The increment
cell should calculate the increment of X by typing a suitable formula in it. The formula mode
is opened at any cell by typing = sign then writing any formula required with the proper
spreadsheet notations. In the increment cell the formula is = 1N where N is the number of
nodes that is to be added by the user directly as a numerical value instead of N in this
formula or by typing the cell address that includes the numerical value of N, see Fig. 2(a).
The numerical value of N may be added in the first data zone. Now, putting zero at the first
cell of the X-row, type the following formula in the second cell of this row

= B$17 + $C$11 (4)

Writing this formula at the second cell of the X-row (cell C17) will add the incremental value
of X picked from cell C11 and add it to the contents of the first cell B17. Copying this
formula and pasting it over the rest of the cells, the X-row will type automatically the
corresponding valurs of X at each cell (i.e. this formula will be changed accordingly while
pasting it at each cell). The $ sign preceding any character/number keeps it unchanged
during the pasting process. For example, at the third cell (cell D17) the first term of the
above formula will be changed to C$17 since there is no $ sign preceding the character while
the second term will be the same since there are two $ signs preceding both of the character
and the number addressing the cell. This means that the formula at D17 adds the incremental
value of X picked from cell C11 to the contents of cell C17 and the formula at E17 adds the
incremental value of X to the contents of D17 and so on. Now to type the formula in the
solution row cells, move the cursor to the required cell and start typing in it. In the present
example, the solution given by equation (3) can be written in spreadsheet format at any
general cell as ; = Cosh ($C$10 * (1-B$17))/Cosh($C$10). Writing the complete formula at
any general cell press the enter button. If there is any syntax error in typing the formula, an
error message will appear with the detailed error, so one can correct it. Having typed the
correct formula at any cell, copy and paste it over the rest of the cells of the solution row.
Copying and pasting the formula all over the entire range of the solution row, the solution
will be readily evaluated at each cell. It is worth repeating here that while pasting, the

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


120 Esmail M. A. Mokheimer and Mohamed A. Antar

formula will be changed at each cell accordingly in such a way that the value of X will be
always taken at any cell from its upper adjacent cell.
Getting the solution, one can graphically represent it easily using the graphical facility
that is built in the spreadsheet programs. To do this, just select the solution range including
the X-row and the solution row. The contents of the X-row is used as the X-axis labels while
the contents of the solution row will represent the solution. Selecting the plot range is
nothing but highlighting it. Highlighting the plot range, go to the top menu of the spreadsheet
and click upon the graphic icon. This will open the graphic interactive menu. Following the
instructions in this menu, one can choose the type of graph he/she wants and eventually end
up with the most proper form of the solution graphical representation.
A parametric study can be carried out to show the effect of any of the physical parameters
on the solution. To study the effect of any of the given parameters, just go to the first (data)
zone where the cell contains the value of this parameter. Being at the proper address contain-
ing the study parameter, you can type its new value. The change of any of these parameters
will be reflected in the solution since the cells in the solution range are linked to the data
zone cells through their proper addresses in the formula written in the solution range cells.
The benefit of using data from other defined allocated addresses is so that where we do have
equations in each cell of the solution range we do not need to go and change the constants in
each cell. The change in data is automatically picked up through the addresses of it that are
written properly in the formula in each cell in the solution range. This will result in a direct
change in the solution which will be reflected simultaneously on the accompanied graph. In
the present example, any change in any of the governing parameters (A, P, K, h, ) will
change the value of m and this will be reflected directly on the solution on both of its
numerical and graphical representation.

5. THE USE OF SPREADSHEETS IN NUMERICAL SOLUTIONS OF HEAT


CONDUCTION PROBLEMS

The basic structure of a spreadsheet as a grid makes it quite suitable to the numerical
solution of heat conduction problems that are, in particular, formulated using finite
difference techniques. In finite difference techniques the domain of solution (the body under
consideration) is divided into smaller sub-control volumes by what is called a numerical
grid. The centre of every sub-volume (or its corners, the intersections of the grid liness) is
represented by a node. At each node, the solution of the governing equation is evaluated
numerically. In the spreadsheet every sub-volume (node) can be represented by a cell. So a
range within the spreadsheet will be equivalent to the numerical grid (the discretized domain
of solution). In the following sections, examples of the numerical solutions for steady and
transient one- and two- dimensional heat conduction using spreadsheets will be presented.
The methodology of using the spreadsheet in solving one- and two-dimensional problems
can be extended easily to solve three-dimensional problems.

5.1 Numerical solution for steady state 1-D heat conduction problems
The steady heat conduction in a one-dimensional insulated tip fin, shown in Fig. 1(a), will be
considered as a representative example of conduction heat transfer in one dimension. The
domain of solution is discretized as shown in Fig. 1(b). The governing equation (1), can be
represented by finite difference at each node of the discretized domain as

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


On the use of spreadsheets in heat conduction analysis 121

i 1 2 i + i +1
m 2 i = 0
X 2
rearranging
i 1 + i +1
i = (5)
(2 + m 2 X 2 )

5.1.1 Spreadsheet set-up for the numerical solution of steady 1-D: heat conduction
problems
The spreadsheet set-up for the numerical solution of steady heat conduction through an
insulated tip fin would be identical to that of its analytical solution explained in section 4.1.
However, the equation written in the solution row cells will be equation (5). The spreadshet
format of this interior nodal equation (equation (5)) at any general cell (e.g. cell D22) in the
solution row is,

= (C$22+E$22)(2+$C$10^2*$C$11^2) (6)

The constant that appears in this formula will be picked from its pertinent cells, from the
data/constants zone through their addresses. Typing the correct spreadsheet format of the
FDE, equation (6), at any general cell, copy and paste it all over the solution range. Hence,
the formula will be changed accordingly. The boundary conditions should be imposed on the
exterior node according to its finite difference form and in the proper spreadsheet format. In
the present example, we have two boundary conditions, equation (2). The first boundary
conditions at X = 0 is the isothermal boundary condition with fixed value of the
dimensionless temperature as 1. So go to the left-most cell of the solution row and just type
1. The second boundary condition is at the insulated tip (i.e. at X = 1). The backward finite
difference representation is used to express these adiabatic conditions which have the finite
difference representations as: N+1 = N, where N is the number of increments to which the
domain of solution is discretized. The spreadsheet format of this equation is nothing but
equating the last cell to its preceding cell. Having typed the spreadsheet format of the FDE at
every cell in the solution range and adjusting the boundary conditions, the solution would be
readily evaluated at each cell. However, writing the FDEs for the governing equation for
each node within the discretized domain of solution would result in (N) algebraic equations
(for the present 1-D problem). These equations are to be solved simultaneously. The solution
of this set of equations can be obtained by any matrix solution algorithm. Many of these
algorithms are available in different high level programming languages. One of these
algorithms is the GuassSeidel iterative method. This particular method is a built-in function
in the spreadsheet programs. So, once all the proper FDEs formulae are type, copied, pasted
and cross-checked in all cells of the domain of solution as well as the boundary conditions,
select the Tools pull-down menu and Options in it. This will open a window in which you
can select the calculations tap. Thus a window will be opened in which one can activate the
iteration function by just clicking on it. By default the iteration option is off when the
spreadsheet is loaded. There are two important options given in this window to stop iterating;
one is the maximum iterations (the default which is 100) and the other one is the maximum
change between two successive iterations (the default is 0.001). Both options are the criteria
for stopping the iterations once the iteration option is clicked on. Whenever either of these
criteria is reached, the calculations stop. For heat transfer problems, the proper

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


122 Esmail M. A. Mokheimer and Mohamed A. Antar

criterion for stopping the iterations is the second one of maximum change between two
successive iterationss. So, it is recommended that the number of iterations should be as high
as it is allowed, in the spreadsheet software used, so that the other criterion should be
reached. When this happens, the domain of solution shows the steady-state solution.

5.2 Numerical solution for transient 1-D heat conduction problems

The one-dimensional insulated tip fin will again be considered as a representative example of
the transient conduction heat transfer in one dimension. The governing equation in this case
is written in a dimensionless form as:

d 2
m 2 = (7)
dX 2
This equation can be represented by finite difference at each node of the discretized domain
either by the explicit or the implicit method [8], see Fig. 1(c) as:

Explicit method

iK1 2 iK + iK+1 iK +1 iK
m
2 K
i =
X 2

Rearranging

K 2 iK + iK+1
iK +1 = i 1 m 2 iK + iK (8)
X 2

which is conditionally stable for


2
 2
X 2
m +4

Implicit method

iK1+1 2 iK +1 + iK+1+1 2 K +1 i
K +1
iK
m i =
X 2

Rearranging

X 2 K
iK1+1 + iK+1+1 + i
iK +1 = (9)
X 2
2 + m 2 X 2 +

which is unconditionally stable.

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


On the use of spreadsheets in heat conduction analysis 123

5.2.1 Spreadsheet set-up for the numerical solution of transient 1-D: heat conduction
problems

The structure of the worksheet area for the one-dimensional transient conduction problems is
similar to that of the one-dimensional steady conduction problems. In both cases, the
solution will be expressed in one row at each cell of which the finite difference form of the
governing equation will be expressed in the spreadsheet format including the boundary
conditions at the first and last cells of the solution range. However, for the transient problem
one more row is needed to feed the initial conditions of the problem considered. This initial
condition row is identical to the solution row except that at each cell of the initial condition
row the initial conditions are to be fed accordingly. The numerical solution can be obtained
through the spreadsheet by using either the explicit or the implicit method. The solution
procedure is as follows: first construct the initial conditions and the solution rows with equal
number of cells (each cell represents a node) up to the accuracy required. Type the initial
conditions of the problem considered at each cell of the initial conditions row accordingly.
At the first and last cells of the solution row put the proper boundary condition. Move the
cursor to any interior cell within the solution range and type the proper spreadsheet form of
the FDE (equation (8) or equation (9) for the explicit or the implicit method, respectively).
Copy and paste this formula over the range of solution within the solution row. Doing so, the
solution will be readily evaluated at the first time step. It is worth mentioning here that in the
case of using the implicit method equation (9) needs to be solved iteratively. So, the built-in
iterative function in the spreadsheet should be active in the case of using the implicit method,
while it is not needed if the explicit method is used. All the above steps can be recorded in a
macro to be repeated whenever it is needed. Getting the solution at the first time step, one
can march the solution with time for any number of time steps or till the steady state solution
is reached. Marching the solution with time can be done using the spreadsheet through two
different techniques. In the first technique (followed by the authors reported spreadsheet
work in the literature), the initial conditions and the solution rows should be adjacent to each
other and the solution row is just down the initial condition row. Doing so, each cell within
the solution row would be linked to its corresponding cell in the initial condition row (i.e. the
cell just above it) through the formula written in it. Getting the solution at the first time step,
one can highlight the whole solution line range and drag it down to any number of lines
downward in the worksheet area. This will copy and paste the formula at each cell in the
solution line to its corresponding cell at each line downward. The formula at each cell in
each line down will be adjusted accordingly, keeping the relation between the cells of every
line and that of the line just above intact (i.e. as that between the first-time step solution line
and the initial condition line). Thus the solution will be readily evaluated at each line
downward. Each line down to the initial condition line represents a new time step. The
solution can be marched with time with as many time steps as (as many lines down as)
required or until the steady state solution is reached. The steady state solution is reached
when the contents of the last two successive lines become almost identical and this is
determined by the user. This technique has the advantage of having the transient solution at
any time from the inituial to the steady state conditions. The time at any step is calculated by
multiplying the number of the line below the initial conditions line, by the time increment
that is to be initially determined by the user. The disadvantage of this technique is that it
requires a large space and consequently a large storage capacity.
On the other hand, the second technique (that has been introduced for the first time by
Mokheimer et al. [6]) does not require any more space than the first two lines (the intial
conditions and the solution lines). The idea behind this technique is to update the initial

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015
Fig. 2(b). Initial conditions and spreadsheet numerical solution at the first time step for heat conduction in a 1-D fin.
Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015
Fig. 2(c). Spreadsheet numerical solution for the transient heat conduction in a 1-D fin at large time (i.e. almost steady state).
126 Esmail M. A. Mokheimer and Mohamed A. Antar

conditions after getting the solution at the first time step. This is to be done by copying the
content of the solution range and paste it on the corresponding range in the initial conditions
line. The pasting process of the content of the solution line should be special pasting as
values. Special pasting as values will paste the contents of each cell in the solution range at
its corresponding cell in the initial condition line as values only without their pertinent
formulae. The special pasting is to be done as follows: first select the solution range to be
copied and pasted, go to the cell in the corresponding initial condition range and activate it
by clicking the left button of the mouse while the cursor is inside this cell. Being at the
proper activated cell, push the right button of the mouse at this cell. This will open a small
window in which you can select (by the mouse) the Paste Special option. Choosing the
Paste Special option will open a new small window in which you ccan choose the Values
option. Doing so, the contents of the initial condition line will be updated to that of the first
time step solution. Consequently, the content of the solution line, that is linked to the initial
conditions line, will be adjusted (changed) automatically to give the solution at the second
time step. Repeating the copying and special pasting process is nothing but marching the
solution with time. The copying and special pasting process can be repeated as many times
as required or till the steady state solution is reached. This repetition can be automated by
recording the copying and special pasting process in a macro under a given name. This
macro can be run as many times as required or till the steady state solution is reached. This
macro can be modified to repeat the copying and special pasting process many times once it
is being run. This macro can also be modified to stop running automatically whenever a
steady state convergence criterion is reached. To avoid repetition, the details of recording a
macro and macro modification will be presented in section 6.2.2 hereafter. Figs 2(b) and 2(c)
show the spreadsheet set-up for the transient solution of the one dimensional conduction
problem using the explicit and the implicit methods. Fig. 2(b) shows the initial conditions
and the first time step solution. The solution at 1000 time steps (almost the steady state
solution) is shown in Fig. 2(c).

6. NUMERICAL SOLUTION FOR TWO-DIMENSIONAL HEAT CONDUCTION

The problem chosen here represents heat conduction in a rectangular plate (0 x a,


0 y b) with internal uniform heat generation g, shown in Fig. 3(a). The governing
equation of transient conduction heat transfer in Cartesian coordinate [9] is

2 T 2 T g 1 T
+ + = (10)
x 2 y 2 k t
Subject to the following initial and boundary conditions

initial conditions:

T ( x, y, 0) = 0 (11)

boundary conditions:

x = 0, T (0, y, t ) = Tw , x=a T ( a, y, t ) = To

T T (12)
y = 0, = 0, y=b k = h(T ( x, b, t ) To )
y y=0
y y=b

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


On the use of spreadsheets in heat conduction analysis 127

Fig. 3(a). Physics of 2-D heat conduction in a plate.

The above equation along with its initial and boundary conditions, will be solved using the
spreadsheet after expressing it in a finite difference form. The spreadsheet solution for both
the steady state and the transient cases will be presented below.

6.1 Steady conduction in 2-D with internal uniform heat generation

There is no energy stored within the rectangular region described above upon reaching the
steady state conditions. So the right hand side of the governing equation, equation (10), will
be zero. The dimensionless form of the reduced governing equation for the steady conduc-
tion in 2-dimension with internal heat generation is,

2 a 2 2
+ +G = 0 (13)
X 2 b 2 Y 2
subject to the following dimensionless boundary conditions,
X = 0; = 1, X = 1; =0


Y = 0; = 0, Y = 1; + H = 0 (14)
Y Y =0 Y Y =1

The finite difference form of the governing equation and its boundary condition is,

i +1, j 2 i, j + i 1, j a 2 i, j +1 2 i, j + i, j 1
+ +G = 0
X 2 b2 Y 2
Taking X = Y and rearranging for an iterative solution, one can write

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


128 Esmail M. A. Mokheimer and Mohamed A. Antar


i, j =
1
a 2 i + 1, j + i 1, j +
a2
b 2 ( )
i, j +1 + i, j 1 + GX 2

(15)
2 1 + 2
b
The finite difference form of the boundary conditions is

X = 0; (1, j ) = 1, X = 1; (1, j ) = 0
Y = 0; (i,1) = (i, 2) (16)
Y = 1; (i, M + 1) = (i, M ) (1 + H * Y ) (17)

6.1.1 Spreadsheet set-up for steady 2-D conduction problems


The basic features of the spreadsheet set-up for one-dimensional problems would be slightly
modified to handle 2-D problems. The main zones, namely, the data, the constants and the
solution zones, are the same. The solution zone for the 2-D is no longer one line as that for 1-
D problems but a block of (M + 1) (N + 1) cells representing the number of nodes of the
discretized domain of solution, see Fig. 3(b). These (M + 1) (N + 1) cells are a result of the
interaction of (N + 1) columns representing the increments (nodes) in X-direction and (M + 1)
rows representing the increments (nodes) in Y-direction. For the present problem the number
of intervals in X-direction has been taken equal to that in Y-direction equal to 20. So the
number of nodes in X- and Y-directions are 21. Hence, the range of the solution zones is
21 21 cells that starts at cell B13 and ends at cell V33, see Fig. 4(a). It is to be noted here
that the end column and row depends on the number of nodes in the discretized domain of
solution and consequently the number of cells required that is to be determined by the user. It
is usually useful to have one more row at the top of the solution range and one more column
to the left most of it. The contents of this first row and column will be the incremental values
of X- and Y-dimensions, respectively. The contents of the first row and column will not be
used in the calculations. However, it will be used in producing the graphical representation
of the obtained 2-D temperature distribution as X and Y labels, respectively. The incremental
values of X- and Y-dimension will be fed to the first row and the first column properly as it is
indicated for the 1-D spreadsheet solution. The spreadsheet format of the general interior
nodal FDE, equation (15), at a general cell (E31) is

( (
= 1 2 * (1 + $B$4^ 2 $B$5^ 2) ))
* (D31 + F31 + $B$4^ 2 $B$5^ 2 * (E30 + E32) + $E$5* $E$4^ 2) (18)

Having typed the correct formula at any cell, copy and paste this cell all over the domain of
solution.
Being rectangular in shape, the 2-D domain of solution will have a whole row or column
that is affected by the boundary conditions as compared to a single cell in the case of 1-D
problems. Hence proper adjustment must be done to the right, left, top and bottom of the
domain of solution. In the present problem, the boundary conditions at X = 0 is isothermal
and can be forced in the first column, of the range of solution, by just typing 1 in the first cell
of this first column and then copying and pasting on the complete column in the range. For
the last row (that represents Y = 0), the forward finite difference is used to express the
adiabatic boundary condition. So, the last row is equated to the second last row (in other
words, the formula in a general cell of the last row should represent equation (16), e.g.,

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


On the use of spreadsheets in heat conduction analysis 129

Fig. 3(b). Numerical grid of the 2-D plate.

U33 = U32). This can again be done simply by typing this formula in the first cell of the last
row and then copy and paste it all over the row. The right-most column should accommodate
the boundary condition at X = 1 which is also isothermal with 0 dimensionless value. Adjust-
ing the contents of this last column is similar to that of the first column with the value of 0
entered instead of 1. At the top of the domain considered, there is convection boundary
condition which is expressed in dimensionless form by equation (17). This equation can be
typed in the proper spreadsheet format at any general cell of this top row of the range of
solution (e.g. this formula at cell D13 is: = D14(1+$E$4*$E$8)). Hence, copy and paste
this formula all over the rest of this row where it will be changed accordingly.

6.1.2 Spreadsheet solution for steady 2-D problems


Writing the FDEs for the governing equation for each node within the discretized domain of
solution results in (M + 1) (N + 1) algebraic equations. These equations need to be solved
simultaneously. The solution of this set of equations is obtained using the GuassSeidel
iterative method built in the spreadsheet programs. So, once all the proper FDEs formula are
typed and the boundary conditions are properly imposed, the iterative function should be
activated as explained before. Hence, the steady-state solution will be readily evaluated at
each cell (node) of the solution range.
Obtaining the final solution, one can use any of the numerous 2-D and 3-D graphical
options that are built-in in the spreadsheet programs. Contours, as well as XY-plots, can
readily be made and hence the trends are evident right there. A parametric study can be
carried out easily using spreadsheet programs as indicated earlier. The steady state spread-
sheet solution along with the important pertinent equations are presented in Fig. 4(a) for

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015
Fig. 4(a). Spreadsheet set-up and solution for steady 2-D heat conduction.
On the use of spreadsheets in heat conduction analysis 131

given conditions. The solution presented in Fig. 4(a) is for the steady conduction in a plate
without internal heat generation (G = 0) and with no convection heat transfer at its top (i.e.
the top of the plate is insulated). The left side of the plate is kept isothermally at = 1, the
right side is kept isothermally at = 0 and the bottom is also insulated. For such types of
boundary conditions we should expect linear temperature distribution with X at any value of
Y and uniform temperature with Y at any value of X and this is quite clear from the results of
this presented case in Fig. 4(a). Another steady state solution for different condition is
presented in Fig. 4(b). This figure gives the temperature distribution in a 3-D plot for the
heat conduction in a plate with internal heat generation of (105 kJm3). For the case pre-
sented in Fig. 4(b) the top of the plate is subjected to convective boundary conditions with
convection heat transfer coefficient of 100 Wm2 C. The effect of the heat generation on
the temperature distribution is quite clear in this figure compared to the distribution pre-
sented in Fig. 4(a) for the case of no heat generation. Fig. 4(c) gives the 3-D plot for the
temperature distribution in the plate considered with the same conditions as those for Fig.
4(b) with different convective heat transfer coefficient of 1000 Wm2 C. The effect of the
convective heat transfer coefficient on the temperature distribution presented in Fig. 4(c) is
quite clear compared to that presented in Fig. 4(b).

6.2 Transient conduction in 2-D with uniform internal heat generation


The dimensionless form of the governing equations for the transient conduction in two
dimensions with uniform internal heat generation can be written as

2 a 2 2
+ +G = (19)
X 2 b 2 Y 2
subject to the following dimensionless initial conditions

( X , Y , 0) = 0 (20)

The boundary conditions are the same as that for the steady state case. The finite difference
form of the governing equation and its initial boundary condition is:

Explicit method

iK+1, j 2 iK, j + iK1, j a 2 i, j +1 2 i, j + i, j 1


K K K
iK, j+1 iK, j
+ +G =
X 2
b 2
Y 2

Taking X = Y and rearrnging, one can write

K a2 K
iK, j+1 =
X 2
i + 1, j + i
K
1, j +
a2 K
b2
i (
, j + 1 + i
K
, j )1 + 2 1 + 2 i, j
b (21)

+ G + iK, j

Implicit method

iK+1+,1j 2 iK, j+1 + iK1+,1j K +1 K +1 K +1


a 2 i, j +1 2 i, j + i, j 1 iK, j+1 iK, j
+ +G =
X 2
b 2
Y 2

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015
Fig. 4(b). Temperature distribution in a 2-D plate with g = 105 kJm3 and h = 100 Wm2.
Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015
Fig. 4(c). Temperature distribution in a 2-D plate with g = 105 kJm3 and h = 1000 Wm2.
134 Esmail M. A. Mokheimer and Mohamed A. Antar

Taking X = Y and rearranging for an iterative solution, one can write


K +1 2
iK, j+1 =
a 2
1
X 2
K +1
(
a 2 K +1 K +1
)
X 2 K
i +1, j + i 1, j + 2 i, j +1 + i, j 1 + i, j + GX
b
2 + 2 2 +
b

(22)

The finite difference form of the initial conditions is

(i, j, 0) = 0
while the finite difference form of the boundary conditions will be the same as equation (16)
and (17).

6.2.1 Spreadsheet set-up for the transient 2-D conduction

For the transient case, in the present work, the working area of the spreadsheet will be
divided into four main zones (blocks). The first zone is for the data and the constants in the
finite difference equations. The second zone will be for the initial and/or the current time
step temperature distribution (i.e. at time ) including the boundary conditions. The third
zone will be for the solution (i.e. the temperature distribution at the next time step, i.e. time
+ ). The fourth zone will be for calculating the steady-state convergence-criterion. The
second zone (initial/current time temperature distribution zone) and the third zone (the
solution/next time temperature distribution zone) are simply two blocks one below the other,
each of them having (M + 1) (N + 1) cells. The increments in X and Y-directions are the same
and they are determined according to the number of nodes to which the domain of solution is
to be discretitized. A grid of 21 21 nodes is used in the present example, giving an
increment in X and Y-directions equal to 0.05.
The first zone to be constructed is the data and the constants zone. In this zone the data
will be fed as indicated before and as shown in Fig. 5(a). Different constants will be calcu-
lated at different cells by writing the proper spreadsheet formula for each constant at its
pertinent cell. Figure 5(a) shows that there are two blank cells in the constants part. The first
one of these two blank cells is for the required dimensionless time for the calculation that is
to be determined by the user. The second one is for the number of time steps required to
carry out the calculations for the specified dimensionless time. This number of steps will be
calculated using the formula shown at the pertinent cell. Moreover, this number will be
picked by the program letter as the counter of the FOR-NEXT loop. Constructing this zone,
we move to the second zone. The second zone is the initial conditions zone, (construction
explained in the previous section). In this zone, the initial temperature distribution and
boundary conditions will be fed at the proper places (cells), see Fig. 5(a). The third zone is to
be constructed as before and the FDEs are to be written properly in each cell as shown in
Fig. 5(b). The spreadsheet format of a general interior node, cell F54, equation is given as:

Explicit method
= $E$6 $E$4^ 2 * ( E31 + G31 + $B$4^ 2 $B$5^ 2 * (F30 + F32)

+ 2(1+ $B$4^ 2 $B$5^ 2) * F31 )


+ $E$8* $E$6 + F31 (23)

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015
Fig. 5(a). Spreadsheet set-up and initial conditions for transient 2-D heat conduction.
Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015
Fig. 5(b). Spreadsheet set-up for the solution zone for transient 2-D heat conduction.
On the use of spreadsheets in heat conduction analysis 137

Implicit method

= 1 (2 + 2 * $B$4^ 2 $B$5^ 2 + 2 + $E$4^ 2 $E$6)

* ( E54 + G54 + $B$4^ 2 $B$5^ 2 * ( F53 + F55)

+ $E$4^ 2 $E$6 *F31 + $E$4^ 2 * $E$5) (24)

It is worth mentioning here, that the solution zone is linked to the initial condition zone,
through the spreadsheet formula of the governing FDEs, written using either the explicit or
the implicit method as shown in Fig. 5(b). Fig. 5(b) shows also the spreadsheet formula of
the pertinent boundary conditions. Once all the proper FDEs are typed, copied, pasted and
cross-checked in all cells of the domain of the solution (third zone), the first time step-
temperature distribution will be automatically calculated (on condition that the built-in
iterative function is active in the case of using the implicit method). Now, we can construct
the fourth zone which is a block identical to that of the second and third zones. This zone can
be constructed by copying the block of the third (or the second zone) and paste it below that
of the third zone. In one cell of this block a formula is to be typed to give the absolute
difference between the contents of its two corresponding cells in the third (solution zone)
and the second (initial condition zone). Typing this formula, copy and paste it all over the
cells of the fourth zone. Doing so, the differences between every cell in the third zone and its
corresponding cell in the initial condition zone will be readily evaluated and shown in the
fourth zone. The maximum value of these differences (the contents of the fourth zone) can
be calculated using the Maximum function that is built into the spreadsheet programs. This
maximum could be stored in a particular cell that can be addressed and called by a macro. It
is useful to record all the above steps in a macro by the usual procedure of creating macros.

6.2.2 Recording and modifying macros to automate the spreadsheet: processes

Recording a macro is a very simple task within the spreadsheet programs that run under
windows. Before starting construction of any zone within the spreadsheet, go to the top
menu of the spreadsheet and click on the Tools-pull down menu and select Macros from it.
This will open a window in which you can select the option of recording a macro.
Consequently a window will be opened that allows you to give a suitable name for this
macro such as data for example. Hence, a small icon will appear in which the word stop is
written. Clicking upon this icon will stop recording. Being in the recording mode, you can
start constructing the spreadsheet as explained above. Now, every movement and everything
you are typing is being recorded in this macro and in the proper spreadsheet language that
you do not really need to know. Finishing all the steps you want, click upon the stop
recording icon. Thus, you have created a macro under a suitable name. This macro can be
run in any new spreadsheet, thus all the steps outlined above will be carried out auto-
matically.
Doing all the above steps, only one time step-temperature distribution will be calculated.
To have the second time step temperature distribution, the initial conditions should be
updated and replaced by the first time step as indicated in the transient one dimensional
problem. In the 2-D transient case, this can be done by copying the first time-step-
temperature distribution from the third zone and special paste its values properly on the
pertinent part of the initial conditions (the second) zone. Doing this, the second time, step-
temperature distribution will be automatically calculated at the solution zone that is linked to

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


138 Esmail M. A. Mokheimer and Mohamed A. Antar

temperature distribution will be automatically calculated at the solution zone that is linked to
the initial/current time zone. Consequently, the contents of the fourth zone and its pertinent
maximum value will be automatically changed accordingly. Recording the copying and
pasting processes in a macro enables us to repeat this process many times. The number of
repetitions can be calculated according to the dimensionless time fed by the user after
running the first (Data) macro according to the given formula. This can be done by a simple
modification of the copying pasting macro by adding a For-Next Loop to the program (in
Basic Language), the counter of which is to be picked by this macro from the pertinent cell
in the data/constants zone. This macro could also be modified to automatically stop running
when the steady solution is obtained. This modification is nothing but adding an IF-state-
ment to the macro before the Next statement that stops running the For-Next loop (i.e. stops
the copying and pasting processes) if the maximum of the fourth zone contents reaches a
prescribed value that is to be determined by the user. This prescribed value of the maximum
differences between the last two successive time steps is called the steady-state convergence
criterion (criterion in Fig. 5(a)).

6.2.3 Spreadsheet solution for transient 2-D problems

The accuracy of the obtained steady-state solution from the transient numerical solution,
depends on how tight the steady-state-convergence criterion is. In the case of using the
implicit method, the accuracy of the solution at each time step is to be improved by tighten-
ing the criterion of the iteration convergence in the calculations window. Figure 5(c) depicts
the transient temperature distribution with X at different times for the two-dimensional plate
without internal heat generation and no convection heat transfer at its top (i.e. the top of the
plate is insulated as well as its bottom), while the left and right sides of the plate are kept at a
high and a low temperature, respectively. This figure shows that the transient temperature
distribution varies with time and asymptotically approaches a linear distribution at large
times, which is the typical distribution for such type of boundary conditions.

7. CONCLUSIONS

The use of spreadsheets in heat conduction analysis has been investigated. Details of using
the spreadsheets in evaluating analytical solutions as well as providing the numerical
solution of one- and two-dimensional steady and transient heat conduction problems are
outlined. The graphical abilities of the spreadsheets have been used in representing the
obtained solutions. Case studies have been investigated using MS EXCEL and introduced to
show the simplicity of using spreadsheets in heat conduction modeling, compared to high-
level programming languages such as FORTRAN, Basic, etc. Moreover, parametric
studies on the effect of some of the physical parameters on the solution have been carried
out. These examples show how simple, fast and direct, one can get a feed back on the effect
of changing one of the physical parameters on the problem considered. A new technique in
marching the transient numerical solution with time via a single layer spreadsheet is detailed.
Automation of the processes within the spreadsheet via recording and modifying macros has
been explained. So this paper would be a helpful tool for engineers who want to start to use
the spreadsheet programs in solving heat conduction and/or similar engineering problems
with little/or no previous experience in using the spreadsheet programs. This paper could
also be a helpful article for heat transfer instructors who want to introduce the spreadsheet as
a tool for the analysis of heat conduction problems in undergraduate/graduate courses.

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015


On the use of spreadsheets in heat conduction analysis 139

Fig. 5(c). Transient temperature distribution with X for the 2-D plate with g = 0, h = 0.

ACKNOWLEDGEMENT

The authors acknowledge the support of the KFUPM to the present work.

REFERENCES

[1] Eid, J. E., A methodology and tutorial for thermal modeling with PC spreadsheets, Heat Transfer
Engineering, 8(2), 95110 (1987).
[2] Baughn, J. W., and Rossi, M., Two-dimensional transient heat conduction analysis using
spreadsheets, Heat Transfer Engineering, 13(2), 7179 (1992).
[3] Weston, K. C., Heat transfer simulation using productivity tools, Proc. Summer Computer
Simulation Conf. of the Society for Computer Simulation, pp. 260265, 1988.
[4] Kharab, A., Use of a spreadsheet program in a two-dimensional heat conduction problem,
Computer Methods in Applied Mechanics and Engineering, 122, 173181 (1995).
[5] Mokheimer, E. M. A., Antar, M. A., Farooqi, J., and Zubair, S. M., Analytical and numerical
solutions along with PC spreadsheet modeling for a composite fin, Warme und Stoffubertraguing,
Vol. 32, 229238 (1997).
[6] Mokheimer, E. M. A., Antar, M. A., Farooqi, J., and Zubair, S. M., Spreadsheet modeling for
transient heat conduction in composite fins, Submitted for publication.
[7] Arpaci, V. S. and Larsen, P. S., Convection Heat Transfer, Prentice-Hall, Englewood Cliffs, NJ,
1994.
[8] Lapidus, L. and Pinder, G. F., Numerical Solution of Partial Differential Equations in Science and
Engineering, John Wiley & Sons, New York, 1982.
[9] Ozisik, M. N., Heat Conduction, John Wiley & Sons, New York, 1980.

International Journal of Mechanical Engineering Education Vol 28 No 2

Downloaded from ijj.sagepub.com at SIMON FRASER LIBRARY on June 9, 2015

Das könnte Ihnen auch gefallen