Session 50 Developing Exel Maros for Solving Heat Diffusion Problems N. N. Sarker and M. A. Ketkar Department of Engineering Tehnology Prairie View A&M University Prairie View, TX 77446 Abstrat This paper desribes the use of Mirosoft Exel Spreadsheet and Maro in solving diffusion problems. A one dimensional heat diffusion equation was transformed into a finite differene solution for a vertial grain storage bin. Crank-Niholson method was added in the time dimension for a stable solution. The Exel spreadsheet has numerous tools that an solve differential equation transformed into finite differene form for both steady and unsteady boundary onditions. Its iterative sheme is easy in solving a problem with steady boundary ondition. This paper desribes a method to solve heat diffusion problem with unsteady boundary onditions using Exel based maros. Results obtained from the solution agreed well with the measured produt temperature distribution for a period of two and half years. Introdution Commerial software or ustom programs are usually used in studying omplex problems. A ommerial program may have limitations to ertain onditions of a problem. A ustom program requires adequate programming skills of the researhers. Mirosoft Exel spreadsheet together with its maro apabilities, on the other hand, is a handy tool that an easily be programmed to suit the needs of solving diversified problems. Ketkar and Reddy used Mirosoft Exel for numerial solution of an unsteady state heat equation. In this study a heat diffusion problem was solved using the Exel spreadsheet. The time varying boundary ondition of the problem did not follow any pattern. This dynamially hanging behavior of the boundary ondition was taken are of by interfaing some Exel maros with values in the spreadsheet. Bala et al wrote an elaborate omputer program in BASIC language to simulate temperatures of wheat stored for two and a half years in a onrete bin of 778.7-m3 apaity with a diameter of 5.5m and a height of 33.5m loated in Cheney, Kansas. This paper used their data but solved the same problem using Mirosoft Exel maros interfaed with Exel spreadsheet. Finite Differene Model for Heat Flow The following partial differential equation desribes transient heat transfer in the radial diretion. where T T T t r r r Proeedings of the 004 Amerian Soiety for Engineering Eduation Annual Conferenes & Exposition Copyright 004, Amerian Soiety for Engineering Eduation () Page 9.40.
T = temperature, o C t = storage time, hour r = radial distane from the enter of bin, m = thermal diffusivities of grain, bin wall materials, and air, m /hour Analytial solution of this equation is diffiult due to the fat that the diffusivity of grain, bin wall materials and ambient air are different and the boundary ondition also varied irregularly. A finite differene method was developed using the following assumptions: The heat flow pattern was assumed to be symmetri around the vertial axis of the bin There was no heat flow in the vertial diretion The physial and thermal properties of grain was uniform throughout the bin There was no heat generation within the grain mass. The finite differene method determines temperatures at disrete grid (node) points in the bin. Temperature at eah grid or node is based on previous temperature at the node and urrent and previous temperature at it neighboring nodes. The method, embedding the Crank-Niholson s 3 impliit tehnique, yielded equations (), (3), (4) and (5). Considering n number of nodes and designating the entral node as node number 0 and hene the bin outside wall node number to be (n-), the equation for the entral node is: where t t t t T 0, T, T 0, T, r r r () r = diffusivity of grain, m /h r = nodal distane, m T 0, = Temperature at node 0 at time, o K t = time differene in between two alulations, h Equation at any node exluding nodes at the enter and within the bin materials is t r t r i i T T i, i, t T r t T r i, i, t r t r i i T T i, i, (3) For the node ust outside the bin wall (node, n-), the equation is t r t r 3 T (n ) 3 T (n ) n, n, t r t r T n, t r t r 3 Tn, Tn, 3 T (n ) (n ) Proeedings of the 004 Amerian Soiety for Engineering Eduation Annual Conferenes & Exposition Copyright 004, Amerian Soiety for Engineering Eduation n, (4) Page 9.40.
where = diffusivity for the materials in between the node (n-) and node n = = diffusivity of grain 3 = diffusivity for materials in between the node (n-) and node n Equation for node n, ust outside the bin wall, is: t r t r ( ( )T )T n, n, t r t r t r h k rh k rh k 33 (T n a, T a, ) 33 rh n k 33 rh n k T T n, n, (5) where = diffusivity of air = diffusivity of materials in between node (n-) and node n 33 = diffusivity of materials in between node (n-) and a node in air away from node n Finite Differene Nodes In this study the radial dimension of the bin was disretized into 9 equal setions with 0 nodes. These nodes, as mentioned in equations (), (3), (4) and (5), are shown in Figure. Figure. Disrete nodes along radial diretion of the bin Aording to the priniple of the finite differene method, the temperature at the next step time (at time +) at node i will be estimated based on the urrent temperatures at nodes (i-), i, and at (i+). Tri-diagonal Matrix Equation Equations (), (3), (4) and (5) form a tri-diagonal matrix equation with onstant matrix, time varying fore vetor and unknown nodal temperatures. For 0 nodes, the finite differene method yields 0 equations find 0 unknown temperatures at time t + t. The known nodal temperatures and outside air temperature at time t are used to find temperatures at time t + t. Proeedings of the 004 Amerian Soiety for Engineering Eduation Annual Conferenes & Exposition Copyright 004, Amerian Soiety for Engineering Eduation Page 9.40.3
This matrix equation an be produed in the following format: AT = H where A = tri-diagonal onstant matrix as funtion of the thermal diffusion properties of grain, bin wall materials and outside air, T = vetor of unknown nodal temperatures at time, t + t (i.e. time, +) H = known vetor as funtion of the thermal diffusion of grain, bin wall materials and outside air temperatures and known nodal temperatures at time, t (i.e. time ) Use of Mirosoft Exel Spreadsheet Individual elements of matrix A and vetor H are alulated from the grain, bin materials, nodal positions and distanes and air temperatures. These properties are entered in the spreadsheet. As shown in Figure, the elements in the matrix are represented by a, b, and. The elements of vetor H are represented by h. Eah value of h is alulated from the values of e, f, and g. The three oeffiients at time are shown in three olumns right before the olumn for vetor H. The spreadsheet multiplies these oeffiients with orresponding known temperatures at nodes, inluding the air temperatures for the surfae equation, to determine the individual entries of vetor H. Equation () for the node at the enter of the bin has two oeffiients eah at time and time +. Therefore, the first row of matrix A has two entries b and. Likewise vetor H has two entries f and g. As for examples, the following oeffiients are extrated from equation (). t b, r t, r t f, r g t r For eah of the intermediate nodes as seen in Equation (3), there are three entries, a k, b k and k for matrix A and three entries, e k, f k, and g k for vetor H. The Equation (5) for node n has two oeffiients at time +. Therefore, the last row of matrix A has two entries. However, the vetor H has three entries beause the third one omes from the oeffiients of ambient air temperatures at time and at time +. Based on appropriate equations, the spreadsheet alulates all elements (represented by a, b,, e, f, g and h) from the basi parameters of grain, bin materials, and nodal values. The last line inludes the air parameters, air temperature and surfae ondutivity. Proeedings of the 004 Amerian Soiety for Engineering Eduation Annual Conferenes & Exposition Copyright 004, Amerian Soiety for Engineering Eduation Page 9.40.4
Figure. The onstant tri-diagonal matrix and the known vetor H derived from the thermal diffusion properties of gain, bin wall materials and air Visual Basi Maros of Mirosoft Exel To determine grain temperatures as a funtion of the outside temperature, an iterative sheme is required. The Exel spreadsheet an perform suh iterations for stati boundary ondition. However, this sheme ould not be used beause of the dynami nature of the outside air temperature whih varied irregularly over the period of storage duration. This irregular boundary ondition was aommodated using the maro apability of the Mirosoft Exel. Maro was used to interpolate missing air temperatures and as well as to solve the tri-diagonal matrix and to populate spreadsheet ells with nodal grain temperatures at eah time step. The tridiagonal matrix was solved using the Thomas method as desribed by Sastry 4. The air temperatures outside the bin were measured at an interval of 5 days (360 hours) for a period of two and a half years. Any temperature in between two measured temperatures was determined using straight-line interpolation method using Exel maro. Unknown grain temperatures at time + were alulated based on known grain temperatures at time and known air temperatures at times and +. Maro was written suh that grain temperatures an be predited at any time interval (t) of,, 4, 36, 7 or 360 hours. However, the predited temperatures were written bak to the spreadsheet ells at an interval of 360 hours for all time intervals. As an example, with t = h, 360 intermediate iterations are made to write only one set of nodal grain temperatures on the spreadsheet ells. Figure 3 shows the flowhart for the development of the maro as desribed above. Proeedings of the 004 Amerian Soiety for Engineering Eduation Annual Conferenes & Exposition Copyright 004, Amerian Soiety for Engineering Eduation Page 9.40.5
Simulate 360 h Interval Printing Over? Yes Stop No Print at 360 h Time Interval Yes Intermediate Solutions Over? No Update Matrix Elements Solve for Nodal Temperatures Figure 3. Flowhart for maro development Results and Disussion Figure 4 shows a partial view of simulated temperatures at 0 nodal points. Grain was assumed to store at a uniform temperature of 6.67 o C. As the button labeled, Simulate is pressed, the simulation starts and the designated ells are populated with the simulated temperatures of the grain at nodal points for the duration of storage. The spreadsheet was designed to simulate grain temperatures with reasonable auray for all time steps of,, 4, 36, 7 and 360 hours for the duration of storage of two and a half years (780 days). Figure 5 shows good agreement between the measured and the simulated grain temperatures at a distane of.39 m from bin enter using 360 h as the time step. Outside air temperature is superimposed to ompare it with the grain temperature. This Figure also shows how the grain temperature always lags behind the air temperature. Proeedings of the 004 Amerian Soiety for Engineering Eduation Annual Conferenes & Exposition Copyright 004, Amerian Soiety for Engineering Eduation Page 9.40.6
Figure 4. Simulated grain temperature at nodal points. The button, Simulate, starts simulation. Figure 5 Grain temperature response to the outside air temperature variations at.39m from the enter of the bin wall. The use of t = 360 hours as time step requires a total of only 53 preditions for the total period of storage. The use of t = hour as time step requires 360 intermediate preditions for every 5 days resulting in a total of 8,70 preditions for the same period of storage. This extra fineness (t = hour) does not produe any appreiable improvement in the simulation result exept the exat air temperature at the surfae of the bin. In other words, the time step of t = 360 hours is good enough to obtain the desired predition result. The variation between the predited and Proeedings of the 004 Amerian Soiety for Engineering Eduation Annual Conferenes & Exposition Copyright 004, Amerian Soiety for Engineering Eduation Page 9.40.7
measured temperatures may be attributed to other fators, suh as, assumptions used in this study, possible errors in measurement of temperatures, unounted external temperature variations between two suessive measurement at an interval of 5 days, et. Conlusions Mirosoft Exel spreadsheet is a very handy tool in quik alulations of parameters. Maro apability is an added tool to ustomize its use in aordane with diversified requirements. A ommand button an be added to a spreadsheet from the Tools menu. A single lik on it opens a Visual Basi IDE with subroutine template. Students an easily use the spreadsheet and maro ombination as may be required. The smaller values of time step, t, allow finer temperature predition. Likewise, smaller values of nodal step, r, have the potential to improve the similar auray. However, any hange in r, auses a orresponding hange in the number of equations to solve. Thus it requires a total redesign of the spreadsheet. An alternative to implement this modifiation is to write subroutines in the maro. This redues the size of the spreadsheet at the ost of inreasing the programming effort. Thus the more flexibility is added to the Exel solution, the more the spreadsheet loses its share in alulation by beoming ust a sheet for keeping reords of alulation. Referenes. Ketkar, M. A. and G. B. Reddy. 003. Mirosoft Exel-based numerial solution of linear, homogeneous D transient partial differential equations. Pro. of Amerian Soiety of Engineering Eduation Annual Conferene & Exposition. Nashville, Tennessee. June -4, 004.. Bala, B. K., N.N. Sarker, M. A. Basunia and M. M. Alam. 990. J. Stored Prod. Res. Vol. 6, No., pp. - 6. 3. Crank J. and Niholson, P. 947. A pratial method for numerial evaluation of solutions of partial differential equations of the heat ondution types. Pro. Camb. Phil. So. Biol. Si. 43. pp. 50-67. 4. Sastry, S. S. 984. Introdutory Methods of Numerial Analysis. Prentie Hall, India. Biographial Information NRIPENDRA N. SARKER is urrently Leturer in the Department of Engineering Tehnology of the Prairie View A&M University, TX. He also worked at universities in Bangladesh, Japan and UT at San Antonio and at software industries. He reeived his Master s and PhD degrees from the Texas A&M University at College Station, TX. His researh interests inlude simulation, algorithm development, and omputer networking. MOHAN A. KETKAR is an Assistant Professor of Eletrial Engineering Tehnology at the Prairie View A&M University, TX. He reeived his masters and dotorate in Eletrial Engineering from University of Wisonsin- Madison. He has served on the faulty at the University of Houston and the Lake Superior State University, MI. His researh areas inlude ommuniation eletronis, instrumentation, RF iruits and numerial methods. Proeedings of the 004 Amerian Soiety for Engineering Eduation Annual Conferenes & Exposition Copyright 004, Amerian Soiety for Engineering Eduation Page 9.40.8