In this section we will develop the finite difference formulation of heat conduction in a plane wall using the energy balance approach and discuss how to solve the resulting equations. The energy balance method is based on subdividing the medium into a sufficient number of volume elements and then applying an energy balance on each element. This is done by first selecting the nodal points (or nodes) at which the temperatures are to be determined and then forming elements (or control volumes) over the nodes by drawing lines through the midpoints between the nodes. This way, the interior nodes remain at the middle of the elements, and the properties at the nodes such as the temperature and rate of heat generation represent the average properties of the element. Sometimes it is convenient to think of temperature as varying linearly between the nodes, especially when expressing heat conduction between the elements using Fourier's law.
To demonstrate the approach, again consider steady one dimensional heat transfer in a plane wall of thickness L with heat generation and constant conductivity k. The wall is now subdivided into M equal regions of thickness D_{x}= L/M in the xdirection, and the divisions between the regions are selected as the nodes. Therefore, we have M+1 nodes labeled 0,1,2,….,m1,m,m+1,……M, as shown in Figure 5.5. The x coordinate of any node m is simply x_{m}= mD_{x}, and the temperature at that point is T(x,m )=T_{m}. Elements are formed by drawing vertical lines through the midpoints between the nodes. Note that all interior elements represented by interior nodes are full size elements (they have a thickness of D_{x}), whereas the two elements at the boundaries are half sized.
Figure. 5.5 The nodal points and volume elements for the finite difference formulation of one dimensional conduction in a plane wall
To obtain a general difference equation for the interior nodes, consider the element represented by node m and the two neighboring nodes m1 and m+1 . Assuming the heat conduction to be into the element on all surfaces, an energy balance on the element can be expressed as
or
; 
(5.12) 
Since the energy content of a medium (or any part of it) does not change under steady conditions and thus . The rate of heat generation within the element can be expressed as
; 
(5.13) 
Where is the rate of heat generation per unit volume in W/m^{3}evaluated at node m and treated as a constant for the entire element, and A is heat transfer area, which is simply the inner (or outer) surface area of the wall.
Recall that when temperature varies linearly , the steady rate of heat conduction across a plane wall of thickness L can be expressed as

(5.14) 
where is the temperature change across the wall and the direction of heat transfer is from the high temperature side to the low temperature. In the case of a plane wall with heat generation, the variation of temperature is not linear and thus the relation above is not applicable. However, the variation of temperature between the nodes can be approximated as being linear in the determination of heat conduction across a thin layer of thickness D_{x} between two nodes (Figure. 5.6). obviously, smaller the distance D_{x} between the two nodes, the more accurate is this approximation. Noting that the direction of heat transfer on both surfaces of the element is assumed to be toward the node m , the rate of heat conduction at the left and right surfaces can be expressed as
and 
(5.15) 
Substituting Equations 5.15 and 5.13 into Equation 5.12 gives

(5.16) 
which simplifies to

(5.17) 
which is identical to the difference equation 5.10 obtained earlier. Again, this equation is applicable to each of the M1 interior nodes, and its application gives M1 equations for the determination of temperatures at M+1 nodes. The two additional equations needed to solve for the M+1 unknown nodal temperatures are obtained by applying the energy balance on the two elements at the boundaries (unless, of course, the boundary temperatures are specified).
Figure. 5.6 In finite difference formulation, the temperature is assumed to vary linearly between the nodes
You are probably thinking that if heat is conducted into the element from both sides, as assumed in the formulation, the temperature of the medium will have to rise and thus heat conduction cannot be steady. Perhaps a more realistic approach would be to assume the heat conduction to be into the element on the left side and out of the element on the right side. If you repeat the formulation using this assumption, you will again obtain the same result since the heat conduction term on the right side in this case will involve T_{m}– T_{m+1} instead of T_{m+1}–T_{m}, which is subtracted instead of being added. Therefore, the assumed direction of heat conduction at the surfaces of the volume elements has no effect on the formulation, as shown in Figure 5.7. However, it is convenient to assume heat conduction to be into the element at all surfaces and not worry about the sign of the conduction terms. Then all temperature differences in conduction relations are expressed as the temperature of the neighboring node minus the temperature of the node under consideration, and all conduction terms are added.

• Assuming heat transfer to be out of the volume element at the right surface
Figure. 5.7 The assumed direction of heat transfer at surfaces of a volume element has no effect on the finite difference formulation