Finite Difference Heat Modelling in Excel
Finite Difference Heat Modelling in Excel
Using Excel to Implement the Finite Difference Method for 2-D Heat Transfer in a Mechanical Engineering Technology Course
Mr. Robert Edwards, Pennsylvania State University, Erie
Bob Edwards is a Lecturer of Engineering at Penn State Erie, The Behrend College, teaching in the
Mechanical Engineering Technology department. He has a Bachelors in Mechanical Engineering from
Rochester Institute of Technology and a Masters in Engineering from Gannon University. His primary
area of interest is in the thermal sciences. He teaches thermodynamics, heat transfer and a thermal sciences course for Electrical Engineering Technology students. He has also taught a wide array of other
courses including statics, dynamics, economics and basic electrical engineering for Mechanical Engineering Technology students.
Mr. Michael Lobaugh, Pennsylvania State University, Erie
Michael Lobaugh, Michael Lobaugh is a Lecturer in Engineering at Pennsylvania State University, Erie.
He received his B.S. in M.E. at the University of Illinois in 1986 and his M.S. in Engineering Management
at the University of Massachusetts in 1997. Prior to joining the faculty at Penn State, he worked at Lord
Corporation and Babcock & Wilcox in various engineering and management roles. He has experience
teaching Computer-graphics, Quality Control, Mfg Processes, Production Design, Lean Mfg, Electrical
circuits, and Mechatronics.
c
American
Society for Engineering Education, 2014
Using Excel to Implement the Finite Difference Method for 2-D Heat
Transfer in a Mechanical Engineering Technology Course
Abstract:
Multi-dimensional heat transfer problems can be approached in a number of ways.
Sometimes an analytical approach using the Laplace equation to describe the problem can
be used. This involves finding the solution of differential equations, which may be
reasonable for Mechanical Engineering Technology (MET) students. However, these
students are not always particularly proficient in using this approach. Also, the analysis
can get quite complex depending on boundary conditions, often involving advanced
mathematics using Bessel functions, Fourier series and other special functions. Graphical
methods might be used, but their usefulness extends primarily to discussions about the
relationships between isotherms and heat flow paths. Shape factors and other
approximations can also be useful in certain instances. None of these seem to provide an
especially good approach for MET students.
A more practical approach for these students is the use of numerical methods. The finite
difference method seems to provide a good approach for MET students. Using this
method a student can model fairly complex two-dimensional problems with a variety of
boundary conditions using a simple spreadsheet.
This paper presents information on how this method is used at Penn State Erie, The
Behrend College in a first course in heat transfer for MET students. The method is used
to aid in presenting the theory, as well as for a laboratory exercise. The basic equations
for a variety of node types are included, as well as equation modifications that are used to
account for several thermal loading and boundary conditions. The lectures are reinforced
with homework practice problems before the more involved lab exercise. Finally, the lab
exercise is included. The exercise is designed to give the students practice using the
method.
Introduction:
The first course in heat transfer for Mechanical Engineering Technology (MET) students
at Penn State Erie, The Behrend College focuses primarily on one-dimensional heat
transfer with applications. Conduction, convection and radiation are introduced early.
Conduction and convection are covered in some detail, including the calculation of
convection coefficients using a variety of Nusselt correlations. Only the basics of
radiation are included in the course. A section on transient heat transfer is also part of the
course, including the lumped mass method, closed solutions for simple shapes and semiinfinite solids.
Very little is done with multi-dimensional conduction. Traditionally it was touched on
during the treatment of fins and heatsinks. A laboratory exercise was developed to
provide a little more coverage of the topic. The exercise requires the students to
determine the temperature distribution across a plate with a variety of inputs and
boundary conditions. This is done using finite difference formulations with a
spreadsheet. Very little time is devoted to this during lectures, so the students are not
being asked to develop the formulas that are used on the spreadsheet. Instead, one or two
lectures are devoted to a simple treatment of the topic. The basic formula for an interior
node is developed, and the others formulas that are needed are simply given to the
students.
Theory:
The finite difference method is a numerical approach to solving differential equations.
The fundamental equation for two-dimensional heat conduction is the two-dimensional
form of the Fourier equation (Equation 1)1,2
2T 2T
0
x 2 y 2
Equation 1
TI1,J TI,J
T
x I1/2,J
x
T T
T
I,J I-1,J
x I1/2,J
x
T T
T
I,J1 I,J
x I,J1/2
y
T T
T
I,J I,J-1
x I,J-1/2
y
Using these gradients in the LaPlace equation the resulting relation between the
temperatures can be determined:
T
x 2 I1/2,J
2
T
T
x
x
x 2
T
T
y 2 I,J1/2
y
y
y2
2T
2T
0
x 2 I,J y 2 I,J
TI1,J TI-1,J 2TI,J TI,J1 TI,J-1 2TI,J
0
x 2
y2
If the node spacing is equal in the x and y directions (X = Y), then:
Equation 2
Some technology students may not have the math background to really understand this
true finite difference method. Another path to the same result is to look at an energy
balance3. Consider the diagram below (Fig 2).
The boxed area around TI,J represents a control volume of uniform thickness, . Assume
that heat is transferred into the control volume from each of the surrounding nodes (Fig
3).
For steady state, the first law energy balance for the control volume is: (Equation 3)
Equation 3
But:
Writing similar equations for each of the conduction terms, assuming the same node
spacing in the x and y directions, substituting into equation 3 and cancelling out k and
yields equation 4:
Equation 4
equations for the node types, and then they are modified to account for a variety of inputs
and boundary conditions. In all cases a uniform, square mesh is used.
Figure 4 shows the various types of nodes that are possible (interior, edge, exterior corner
and interior corner). Table 1 shows the basic equation for each of the 4 types.
Temperature T is the node temperature and the subscripted temperatures are the
surrounding nodes.
Equation 4
Equation 5
Equation 6
Equation 7
Table 1
These equations can be modified to account for a point heat source attached to the node
or for internal heat generation in the control volume associated with the node. The
following terms are added to the numerator of each of the equations in Table 1 is
appropriate.
Point Heat Source:
Where:
Equation 8
Equation 9
Where:
For nodes along the boundary that have internal heat generation the control volume is
smaller than for an internal node, so the factor above needs to be modified to account for
that. The factor is corrected by the ratio of the control volume size relative to the control
volume size of an interior node. For example, the control volume for an edge node is half
the size of one for an interior node, so the internal heat generation factor is multiplied by
0.5.
Both the point heat source and the internal heat generation factors can apply to any of the
four node types. If both conditions are present then both factors are added to the
numerator of the basic equation. The following boundary conditions only apply to three
of them. Internal nodes do not see the boundary, so these conditions would never be
added to them.
The most common boundary conditions that might be experienced are convection and
heat flux.
Convection:
Equation 10
Where:
Example:
Heat Flux:
Equation 11
Equation 12
Where:
Example:
Equation 13
Other circumstances can exist on the boundaries. Any special cases are addressed as
needed.
Application of this Method:
Once the equations have been presented to the students it is time to implement them for a
two-dimensional heat transfer problem. The general procedure is to first break the part
into a mesh. All of the meshes used are square. The intersection of the mesh lines are
the nodes, which are the points at which temperatures are calculated. The appropriate
equation is written for each of the nodes. All of the nodes are interrelated through the
equations, so the result of writing the equations is a set of simultaneous equations equal
to the number of nodes. There will be an the same number of unknowns as equations to
calculate. For a simple case it is possible to set up a matrix to solve the equations,
however, as the number of nodes increases so does the size and complexity of the matrix.
The exercise addressed by this paper uses a spreadsheet to numerically solve the
equations.
Each node is represented by a cell on a spreadsheet, and the equations for the nodes are
entered into the corresponding cells on the spreadsheet. In order to avoid a circular
reference error the spreadsheet should be set to enable iterative calculations. The default
using EXCEL for maximum iterations is 100 which means that each time a change is
made to a formula the spreadsheet will run 100 iterations. You can change this if you
want to, but it is not necessary. The F9 key will reiterate the sheet 100 times each time it
is hit. If the calculated values are formatted to two decimal places then the F9 key can be
held down until the numbers in the cells stop changing indicating that the sheet has
essentially converged. Note that if the cells are left to default to an unlimited number of
decimal places then it is unlikely that the sheet will ever fully converge.
The students are asked to create spreadsheets for five different two-dimensional problems
during lab. They have a very difficult time accomplishing this without practice, so two
example problems, with solutions, are provided for them to try before lab.
Example 1: This is a simple example which only involves formulas for interior nodes.
Notice that the temperature is given for some of the surrounding nodes. These values are
simply entered directly into the spreadsheet. Figure 5 shows the mesh for this example.
Fig 5
The problem is to solve for the temperatures at A, B, C and D.
First, an area on the spreadsheet is selected to represent the mesh (Figure 6).
Fig 6
Next, the given fixed temperatures are entered into the appropriate cells (Figure 7).
Fig 7
The basic formula for one of the internal nodes is entered as shown (Figure 8).
Fig 8
Finally, the remaining equations are entered yielding the results shown in Figure 9.
Fig 9
The second homework problem is shown in Figure 10.
Fig 10
This problem contains one node which is a special case. Notice that the node on the
lower left hand corner (A5 on the spreadsheet) has convection on one surface, but the
other surface is insulated. Since convection is only present on half of the control volume,
then the Biot number is multiplied by 0.5 in both the numerator and denominator of the
modified equation for that exterior corner node.
References:
1
2
3
Appendix:
Lab Problem #1:
The first problem is a simple exercise similar to the first homework problem. It not only
helps to get the students started during the lab period, but also helps to identify which
students actually did the homework. Usually there are a couple of students in a lab
section who did not feel that it was necessary to work on the practice problems, and they
clearly stand out when they try this exercise. The grid is shown in figure 11.
Fig 11
The problem is to determine the temperature at nodes 1, 2, 3 and 4. The four surrounding
surfaces are at fixed temperatures: top: 3000C, bottom: 1000C, left: 5000C and right:
1500C. The solution is given in figure 12.
Fig 12
Fig 13
The temperature at the wall (left end) is 1250C. All of the other boundary nodes are
subjected to convection. The surrounding air is at 200C and the convection coefficient on
all surfaces is 30 W/(m2-0C). The conductivity of the fin material is 6 W/(m-K) and the
node spacing is 4 cm. The temperature at each of the labeled nodes is to be determined.
Figure 14 gives the solution for this problem. The Biot # in cell A5 is calculated from the
given information.
Fig 14
Fig 15
The following conditions apply to this problem:
Nodes 1, 4, 9 and 14: Fixed temperature at 850C
Nodes 2, 3, and 15-18: Subjected to 100C ambient air with a convection coefficient of
18 W/(m2-0C)
Node spacing = 5 cm
Conductivity = 11 W/(m-K)
Figure 16 shows the solution. Note that the Biot # in cell B11 is a calculated value.
Fig 16
Fig 17
The following conditions apply to this problem:
Nodes 1, 4, 9, 14, 19 and 24: Fixed temperature at 1200C
Nodes 2, 3 and 6: Subjected to 100C ambient air with a conv coef of 25 W/(m2-0C)
Nodes 25-28: Subjected to 500C ambient air with a conv coef of 40 W/(m2-0C)
Node spacing = 5 cm
Conductivity = 5 W/(m-K)
Figure 18 gives the solution for this problem. Note again that the Biot numbers in cells
B11 and B15 are calculated values.
Fig 18
Fig 19
The dashed rectangles and circles represent components that are mounted to the board.
The bottom edge is attached to a cold plate at 400C. The assumption is that all the nodes
along the bottom are fixed at that temperature. All of the other edges are considered to be
insulated. Table 2 shows the power that is dissipated from each component.
Nodes
13, 14 and 24, 25
16 and 17 and 18
28, 29 and 50, 51
46, 47, 48
20 and 42 and 53
54
The board has a conductivity of 165 W/(m-K) and a thickness of 0.8 mm. The node
spacing is 1.5 cm.
Figure 20 shows the solution for this problem. The highlighted areas show where the
components are mounted.
Fig 20