— Property tables are not suitable for sensitivity and optimsation analyeses of complex thermodynamic systems that require the thermdynamic properties to be repetitively determinated at a large number of points in the system. This paper shows how Microsoft Excel can be used to develop computerised tables that automates the evaluation of thermodynamic properties. The property tables were copied in Excel and Visual Basic f or Applications (VBA) was used to develop a number of user-defined functions that automate the interpolation of thermodynamic data. While maintaining the use of thermodynamic tables, which is an important educational process, the computerised tables can be a useful teaching aid that helps students to have better understanding of thermodynamics. The usefulness of the computerised tables is demonstrated by analysing the gas -turbine cycle with intercooling reheating and regeneration. Using the exact variable -specific heat method, the cycle was analysed for the effects of the inter -stage pressures on the plant's thermal efficiency and net specific -work. The paper shows that more accurate estimates of the optimum values of these pressures could be obtained than usually given by the widely adopted approximate constant -specific heat method. The Excel -based tables are particularly useful in developing countries like Sudan, where dedicated educational software is lacking. Keywords — Thermodynamics, Computerised tables , Modelling platform, E xcel, VBA . I. INTRODUCTION HERMODYNAMICS is a fundamental subject for all engineering disciplines that deal with energy conversion systems and th eir impacts on the environment. Understanding the laws and principles of thermodynamics helps engineers to design energy systems that utilise the limited energy resources efficiently while minimising their impact on the environment. To give engineering students deeper insight in the principles of thermodynamics and their practical application s, most textbooks now include problems that require the students to perform sensitivity and optimisation analyses. Such an approach is particularly useful in teaching thermodynamics; which is generally perceived by students as a difficult and boring subjec t [1-3]. However, in the case of thermodynamic, sensitivity and optimisation analyses require repetitive evaluation of the thermodynamic properties at different s tates of the system; which is difficult to perform using property tables. Therefore, thermodyn amic textbooks require the use of suitable modelling software such as Interactive Thermodynamics (IT) and Engineering Equation Solver (EES) Mohamed M. El -Awad is with the Mechanical Engineering Department, Faculty of Engineering, University of Khartoum, P.O. Box 321 Khartoum, Sudan (phone: +249- 911700885; e -mail: mmelawad09@ gmail.com ). Ali. M. Elseory, is the Deputy Dean, Faculty of Engineering, University of Khartoum, P.O. Box 321 Khartoum, Sudan (e -mail: aliseory@uofk.edu ). [4-6]. Since these proprietary applications are not available to educational institutions in many developing countri es like Sudan, students have less chance to enhance their understanding of the subject or make use of its principles to solve practical problems later. A modelling platform that is available to many engineering colleges worldwide is Microsoft Excel [7,8] . With its flexible statistical and charting tools, Excel ha s become the most ly used application for data analysis and presentation in engineering and non- engineering disciplines. However, the capability of Excel is not limited to these two functions as the software developers have equipped it with special tools that greatly enhance its computational capability and allow its user to to perform more demanding calculations, such as iterative solutions of non- linear equations and optimisation. The computational capabilities of Excel as a modelling platform can be extended further by taking advantage of Visual Basic for Applications ( VBA ), which is also packaged freely with every PC, to develop special user -defined functions (UDFs). Since Excel itself is not equipped with built -in function for calculating thermodynamic properties, it has to be linked with a dedicated property software, such as REFPROP [9] , in order to enable its users to perform thermodynamic analyses . REFPROP enables accurate determination of the thermodynamic properties for numerous fluids by providing appropriate property functions. However, apart from its proprietary rights, the software is more designed for advanced Excel users than for educational purposes where the use of thermodynamic tables is part of the learning process. Realising the potential of Excel as a teaching air, a number educational institutes d eveloped their own add- ins that enable students to use the spreadsheet for performing thermodynamic analyses. An example of such effort s is that of the research team at the University of Alabama [12,13] who developed a set of computational and organisational tools to be used in the thermodynamic and heat transfer courses. Using their VBA - developed custom functions, it is possible to evalu ate the properties from given values of two other intensive properties. For example, the function h_pT(p_1;T_1;"R22","SI") determines the enthalpy of R22 from known values of pressure (p_1) and temperature (T_1) in SI units. The library also includes R134a , water and ideal gases . However, like REFPROP, property functions are used instead of tables. Table interpolation is seen by many as an important educational process not for thermodynamics alone but for engineering analyses in general [1]. Therefore, thermodynamics tables should not be replaced by property software at least for teaching basic thermodynamics courses . The present paper presents an approach for developing Mohamed M. El-Awad , Ali M. Elseory Excel as a Teaching Aid for Thermodynamics T International Conference on Automotive, Mechanical and Materials Engineering (ICAMME'2012) Penang (Malaysia) May 19-20, 2012 94 f luid-independent interpolation functions with VBA that allow the thermodynamic tables to be integrated in Excel. Thus, the developed property functions use these interpolation functions rather mathematical formulae. Apart from preserving the use of thermodynamic tables for educational purposes, the approach minimises the number of custom functions that need to be developed while allowing reversed calculations using the same functions. The paper highlights the capabilities of Excel with these functions by analysing the gas -turbine cycle with intercooling, reheating and regeneration. Since this cycle requires the fluid properties to be evaluated at a large number of points, standard thermodynamic textbooks usually determine the optimum inter -stage pressures between the compressors and turbines by using the approximate method which leads to the relationship 2 1P P Pi= . Using Excel with the exact variable specific- heat method, the paper shows that more accurate determination of the optimum inter -stage pressures can be obtained. II. THE GAS TURBINE WITH INTERCOOLING , REHEAT AND REGENERATIO N The gas -turbine with intercooling, reheating and regeneration (IRR) shown i n Fig . 1 is a good example for demonstrating the concept of thermodynamic optimisation. Analysis of the IRR gas turbine cycle, which involves the evaluation of properties at ten different points, is a tedious task for hand calculation especially when the irreversibilities in the compressor and turbine stages and pressure losses are taken into consideration. Therefore, many standard textbooks adopt the "approximate" constant -specific- heat method in order to determine the temperatures and enthalpy differences across each process in the cycle [ 4,5]. Fig. 1 Schematic of a gas -turbine with intercooling, regeneration, and reheat [5] The cycle, which incorporates three modifications to the simple gas turbine cycle; viz. intercooling, reheating, and regeneration, is a very useful example for introducing the concept s of thermodynamic optimisation to the students. Although each of these modifications is meant to improve the gas turbine performance either by increasing the net work output of the gas turbine or its thermal efficiency, these measure can be counter -productive if implemented without proper considerations . For example, regeneration is applied so as to im prove the thermal efficiency of the turbine by making use of the exhaust -gas energy. However, regeneration can have an adverse effect if the pressure ratio is higher than a certain value that depends on the temperature ratio (T 3/T1) [5]. As explained in standard textbooks, intercooling and reheating which increase the turbine net work output can also reduce the thermal efficiency if applied separately [4]. The inter-stage pressures between the compressors and turbines have specific values that maximise the cycle's thermal efficiency or net work and cannot be chosen randomly. These values can only be determined exactly by performing a sensitivity and optimisation analysis. Although both the net work and thermal efficiency increase by increasing the number of intercooling and reheating stages in the plant, economical considerations put a limit to this number. The same thing can be said about increasing the generator's effectiveness by increasing its heat transfer area. Thus , the problem does not only demonstra tes the use of optimisation techniques in designing thermodynamic systems in particular, but the application of thermo -economic optimisation to engineering systems in general. III. E XACT ANALYSIS OF THE IRR GAS TURBINE CYCLE Unlike the approximate method, the "exact" method takes into consideration the variation of specific heats with temperature [4]. Using the numbering scheme shown in Fig. 1 to indicate the state of the working fluid entering and leaving each component of the plant, and starting with the know n state at the inlet of compressor I, the relative pressure after the first - stage compression ( Pr 2s) is determined from: 12 1 2Pr PrPP s= (1) Pr2s is then used to find T 2s, and subsequently h 2s, by interpolation from the ideal- gas p roperty tables. Taking into consideration the adiabatic efficiency of the compressor (cη), the actual enthalpy at point 2 ( h2) is then given by: c sh h h hη/ ) (1 2 1 2− + = (2) Enthalpy of air leaving the second- stage compr essor ( h 4) and enthalpies of the working fluid leaving the first and second stages of the turbine ( h 7 and h9) are obtained following a similar procedure. The enthalpy of the working fluid leaving the generator is obtained by applying energy balance across the regenerator which leads to: ) (4 9 4 5h h h h− + = ε (3) where, εis the regenerator effectiveness. The heat added, net work output of the turbine, and thermal efficiency of the cycle are then given by: International Conference on Automotive, Mechanical and Materials Engineering (ICAMME'2012) Penang (Malaysia) May 19-20, 2012 95 ) ( ) (7 8 5 6h h h h Qin − + − = (4) ) ( ) (3 4 1 2h h h h wc − + − = (5) ) ( ) (8 9 6 7h h h h wt − + − = (6) inc t innet Qw w Qw −= = η (7) The cycle analysis is straightforward in the sense that it does not require an iterative solution or the solution of linear or non- linear systems of equations. However, it is a tedious problem for hand- calculations because it requires the evaluation of thermodynamic properties at a large number of points. Therefore, finding the appropriate values of the cycle parameters that give the optimum performance is a challenging exercise for students even if the approximate method is used [4,5 ]. The following sections illustrate the usefulness of Excel as a computer -based modelling platform that allows the optimu m values of the inter -stage pressures to be deter mined with the exact method. IV. D EVELOPMENT AND VERIFICATION OF THE COMPUTERISED TABLES The ex act method of solution requires the values of two properties h and Pr at various states of the working fluid. The tabulated values of these two properties for air at selected temperatures within the range 200- 1600K were copied into Excel as shown in Fig. 2. To enable Excel to determine values of h and Pr at intermediate temperatures, VBA was used to develop custom property functions for data interpolation. The custom function for the evaluation of enthalpy is given the name "hfT" (i.e. h from T). The VBA code is listed below: Function hfT(gas$, T) With Worksheets(gas$) ifirst = 4 'Vertical location of the first cell on the sheet jfind = 3 'Horizontal location of the h column on the sheet jfrom = 2 'Horizontal location of the T column on the sheet hfT = linear(gas$, ifirst, jfind, jfrom, T) End With End Function To find the enthalpy of air at temperature T_1, the function is called as follows: h_1 =hft("air";T_1) The function "hfT" calls another function (named "L inear") that does the linear inte rpolation (listed in the Appendix) . Since the variation of h is almost linear (Fig. 2), a linear interpolation function was found reasonably accurate even with the large temperature increment, which is 100oC. However, Fig. 2 shows that Pr varies rapidly with temperature and the accuracy of its estimation is bound to be more sensitive to the temperature increment. Therefore, the interpolation function developed for Pr determines the value of Pr from three points instead of two points . The s olution also requires the determination of the temperature from a known value of Pr. Therefore, a fifth function was developed for this purpose with the name "TfPr". Like "PrfT", "TfPr" calls the q uadratic interpolation function. Note that the two interpolation functions "linear" and "quadratic" are general -purpose functions that can be used for any interpolation operation without modification. Also note that the three property functions "hfT", "TfPr" and "PrfT, which are only slightly different, can be used for different gases by passing the name of the gas to the function. Other required custom functions, such as "Tfh", "sfT", "Tfs", etc., can be developed by a straightforward modification of one of these three property functions . Fig. 2 Enthalpy and relative pressure data for air International Conference on Automotive, Mechanical and Materials Engineering (ICAMME'2012) Penang (Malaysia) May 19-20, 2012 96 Fig. 3 Sheet 1 (Main) for the gas-turbine problem Before attempting to analyse the effect of the inter -stage pressures on the system performance, the accuracy of the interpolation functions was checked by considering the numerical exampl e given by Moran and Shapiro [4]. In this example, the gas turbine operates at steady state with air entering the compressor a t 100 kPa, 300 K. The pressure ratio across the two -stage compressor, and the two- stage turbine, is 10. At the inlets to the turbine stages, the temperature is 1400 K. The temperature at the inlet to the second stage compressor is 300 K. Both the intercool er and reheater operated at 300 kPa. The isentropic efficiency of each compressor and turbine stage is 80% and the regenerator effectiveness is 80%. Fig. 3 shows the Excel sheet prepared for this example . Note that the sheet shows all the given data and a ll the calculation steps of the solution. To make the sheet easy to read, labelled cell