development of excel add in modules for use in thermodynamics

19
AC 2008-1751: DEVELOPMENT OF EXCEL ADD-IN MODULES FOR USE IN THERMODYNAMICS CURRICULUM: STEAM AND IDEAL GAS PROPERTIES Jesse Huguet, University of Alabama Keith Woodbury, University of Alabama Robert Taylor, University of Alabama © American Society for Engineering Education, 2008 Page 13.431.1

Upload: nguyennhi

Post on 01-Jan-2017

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Development Of Excel Add In Modules For Use In Thermodynamics

AC 2008-1751: DEVELOPMENT OF EXCEL ADD-IN MODULES FOR USE INTHERMODYNAMICS CURRICULUM: STEAM AND IDEAL GAS PROPERTIES

Jesse Huguet, University of Alabama

Keith Woodbury, University of Alabama

Robert Taylor, University of Alabama

© American Society for Engineering Education, 2008

Page 13.431.1

Page 2: Development Of Excel Add In Modules For Use In Thermodynamics

DEVELOPMENT OF EXCEL ADD-IN MODULES FOR USE IN

THERMODYNAMICS CURRICULUM: STEAM AND IDEAL

GAS PROPERTIES

Abstract

For engineering graduates entering the job market, experience with appropriate computational

tools and techniques is increasingly necessary. Therefore, the University of Alabama’s

Mechanical Engineering Department is introducing students to computational problem solving

earlier in their college careers by developing Microsoft Excel-based modules to be used as

teaching tools in the sophomore and junior-level thermodynamics and heat transfer courses. The

MS Excel package was chosen as a software platform for this purpose because of its ubiquitous

nature and its ability to utilize Visual Basic for Applications (VBA) macros in a spreadsheet

format.

In the sophomore-level thermodynamics course, much of the class material focuses on the

properties of steam and ideal gases. Therefore, a suite of Microsoft Excel functions to compute

steam and ideal gas properties and assist in analyzing properties of states and processes has been

developed. A number of Excel packages that pertained to the computation of steam properties

were already available in the public domain. In a companion paper1, these packages were

compared and Magnus Holmgren’s Xsteam functions were chosen as a starting point for the

current project.

This paper details the modification of Holmgren’s Xsteam functions for classroom use and the

creation of ideal gas property functions. The Xsteam functions, as packaged by Holmgren are an

excellent collection for daily use in calculating steam properties, but lack key features needed to

solve sophomore-level thermodynamics problems. A broader range of functions has been

developed to cover common combinations of specified or known properties, and particularly, to

provide specific volume relationships. A graphing function is included to allow students to plot

states on various phase-diagrams to better understand the relationship between properties and

state. The development, testing, classroom implementation, and student response to these

functions is discussed.

Introduction

Ubiquitous Nature of Excel

An array of various computational tools has been developed to assist with thermodynamic class

work. Almost every textbook now comes with a disc of executables developed to assist with the

examples found inside. A survey of recent graduates of the University of Alabama revealed that

none utilized any of these textbook-bundled tools. They are written in various languages, run on

various platforms, and are, in some cases, useful only for certain specific examples or

procedures. For a computational tool to be useful in a thermodynamics classroom, it must be

versatile, universal, and accessible. It must be able to run on any PC with minimal setup, must

be useful in solving the wide range of problems posed by the course, and must be easily accessed

from any computer on campus and off.

Page 13.431.2

Page 3: Development Of Excel Add In Modules For Use In Thermodynamics

Microsoft Excel was chosen to be the platform for the development of such a tool due to its

programmability, spreadsheet functionality, visual analysis tools, and wide availability. The

Microsoft Visual Basic editor provides the programming tools needed to develop problem-

solving algorithms. Spreadsheets allow data to be stored and displayed in convenient order and

provide a means of applying programmed algorithms. Excel’s graphing capabilities allow data

to be displayed in different and sometimes more intuitive ways. Most importantly, the Microsoft

Office Package is a virtually universal PC application allowing the developed tools to be used in

classrooms, labs, and home offices and to move with students to the workplace.

There are two popular ways to package a set of functions in Excel for use by a broad audience.

In order to understand and compare them, one must understand how Excel handles User Defined

Functions. In the Visual Basic editor, coded routines are stored in Macros, which are applied to

one specific workbook. Once a function is coded into the Macro it can be called on any

spreadsheet within that specific workbook. One simple way to package functions for a class is to

make the workbook containing the macros available to them. This method requires that the

students use that workbook anytime they want to use the coded functions. While this is a simple

way to share functions, limiting their use to a single workbook is not preferable. Excel offers a

more widespread sharing capability through the use of Add-Ins. An Add-In is an Excel

workbook that has been saved in Excel 2003 with the .xla file extension, or .xlam in Excel 2007.

When a workbook is saved as an Add-In, the coded macros are still intact. Add-Ins can be

applied or disabled from the Excel Add-In menu, and when one is applied all of the coded

routines and functions in the macros it contains are available to any spreadsheet in any

workbook. Also, once “added-in”, the functions remain available in the user’s customized Excel

environment in subsequent Excel sessions, until such time as it is explicitly removed. The Add-

In format increases the functions’ availability in the Excel environment and is thus optimal for

this project.

Selection of the Holmgren Functions and Xsteam’s Capabilities

Problems concerning water and the calculation of its states and properties are a large portion of

the sophomore level thermodynamics course. A great deal of time is spent analyzing tables of

property data pertaining to the states of water. In many problems, interpolation is required to

find data not listed explicitly. An array of functions that could be called in a spreadsheet to find

this data would simplify the process, provide more accurate answers, and reduce time spent on

repetitive tasks.

Upon searching the public domain, a number of Excel macros providing steam property

calculating functions were identified. Of these, Magnus Holmgren’s Xsteam compilation was

chosen as a starting point due to its wide range of property functions, and their logical naming

scheme. A companion paper by Chappell, et al.1, discusses this comparison and the selection of

Holmgren’s Xsteam. A list of the functions available in version 2.5 of Holmgren’s Xsteam is

provided in Table 1. Each function can be called in a spreadsheet to calculate the first property

in its name using the required input properties that follow the underscore. For example, the

function s_Tx(100, .25) will return the specific entropy of water at a temperature of 100°C with a

quality of 25%. Holmgren based his property-calculating functions on the equations of state

adopted in 1997 by the International Association for the Properties of Water and Steam.2

Page 13.431.3

Page 4: Development Of Excel Add In Modules For Use In Thermodynamics

"

Temperature, T Specific Internal Pressure, P

Tsat_p Energy, u psat_T

T_ph uV_p p_hs

T_ps uL_p p_hrho

T_hs uV_T Specific Enthalpy, h

Specific Entropy, s uL_T hV_p

sV_p u_pT hL_p

sL_p u_ph hV_T

sV_T u_ps hL_T

sL_T Specific Volume, v h_pT

s_pT vV_p h_ps

s_ph vL_p h_px

Density, rho vV_T h_Tx

rhoV_p vL_T h_prho

rhoL_p v_pT Thermal

rhoV_T v_ph Conductivity, tc

rhoL_T v_ps tcL_p

rho_pT Specific Isochoric tcV_p

rho_ph Heat Capacity, Cv tcL_T

rho_ps CvV_p tcV_T

Speed of Sound, w CvL_p tc_pT

wV_p CvV_T tc_ph

wL_p CvL_T tc_hs

wV_T Cv_pT Dynamic Viscosity, my

wL_T Cv_ph my_pT

w_pT Cv_ps my_ph

w_ph Specific Isobaric my_ps

w_ps Heat Capacity, Cp Vapour Fraction, x

Surface Tension, st CpV_p x_ph

st_T CpL_p x_ps

st_p CpV_T Vapour Volume

Prandtl Number, pr CpL_T Fraction, vx

pr_pT Cp_pT vx_ph

pr_ph Cp_ph vx_ps

Cp_ps

Table 1

Functions Included in X-Steam Version 2.5

V represents saturated vapor properties.

L represents saturated liquid properties

Page 13.431.4

Page 5: Development Of Excel Add In Modules For Use In Thermodynamics

Additional Requirements for Thermodynamics I

While the Xsteam package provides an excellent array of property calculating functions, they

lack some key features required for practical classroom use. The units for pressure are not

consistent with the units regularly used in the classroom or the tables in the course textbook,

Thermodynamics: An Engineering Approach 6th Edition by Cengel and Boles3. The function

list allows for a number of property combinations, but has no functions utilizing specific volume

as an argument. When selecting a function from Excel’s Insert Function icon, there are no

descriptions of the functions to assist the user in finding the correct one or knowing what the

arguments should be. The package also lacks a tool for graphical representations of properties

and states.

Water is not the only substance of importance in the sophomore level thermodynamics course.

Ideal gases and problems relating to their properties are also covered extensively. The tables

containing properties of ideal gases range across fifteen pages in the current thermodynamics

text. A complete package of functions to calculate temperature-dependent specific heats,

specific enthalpy, specific entropy, and specific internal energy would make finding the

properties of ideal gases far less time-consuming and have all the other benefits of the Xsteam

functions and the Excel platform.

Software Development

Pressure Units

In the Xsteam package, the units for all pressure arguments and outputs is bar. While bar is the

standard SI unit for pressure, kPa is used in all of the tables in the Cengel and Boles3 text. As

there are 100 kPa in one bar, the conversion is not a complicated one, but due to the frequency of

the use of pressure in the functions and the large number of internal functions, a complete

conversion of every pressure value to kPa was not sensible. Instead, the conversions were made

only to the initial arguments of the public functions for which pressure was an argument and the

final outputs for functions that output pressure. For the functions for which pressure was an

argument, a line of code was added to the beginning of the function that divided the value of the

pressure supplied by the user in kPa by 100 to change it to bar. The remainder of the function

was left as written. Similarly, for the functions for which pressure was an output, a line of code

was added to the end of the function multiplying the final pressure value by 100 to change it

from bar to kPa. Using this method, a major overhaul of the whole suite of functions was not

necessary.

Additional Functions

In the sophomore thermodynamics course, specific volume is often one of the known properties

of a particular state of water, especially when dealing with constant volume, constant mass

processes. Therefore, a range of functions using specific volume as an argument is necessary for

a useful thermodynamics computational suite. With this in mind, the functions listed in Table 2

were added to the Xsteam package.

Page 13.431.5

Page 6: Development Of Excel Add In Modules For Use In Thermodynamics

Table 2

Additional Functions with Specific Volume Arguments

T_pv

p_Tv

h_pv

h_Tv

s_pv

s_Tv

u_pv

u_Tv

Developing some of these functions was simply a matter of using one or more existing functions.

For example, Xsteam already contained the functions T_ph and h_prho. Knowing that the

density, rho, was the inverse of the specific volume, v, and using these two pre-existing

functions, T_pv was easily established. Similarly, h_pv utilized the pre-existing h_prho, s_pv

was found with h_prho and s_ph , and u_pv required h_prho and u_ph.

Unfortunately, Xsteam did not contain a function with temperature and density similar to the

h_prho function which allowed such smooth development of the pressure-specific volume

functions. However, functions of pressure and temperature already existed for specific enthalpy,

specific entropy, and specific internal energy. Therefore, successfully developing a p_Tv

function would allow similarly simple algorithms for the rest of the functions. Since the T_pv

function was successfully implemented and tested, it could be used to find pressure by iteration

when temperature and specific volume were known. An interval halving process could be used

to check the value of T_pv over a range of pressures until it was approximately equal to the

temperature supplied as an argument. A simple interval-halving function was developed with a

single pressure range, and failed to produce results for nearly the entire range of temperatures

and specific volumes. It was quickly realized that the function T_pv could not provide results

for any arbitrary pressure-specific volume combination: the p,v pair must lie in the state space. If

an “illegal” state is supplied to T_pv, the function is programmed to return an error, which

results in a “#VALUE!” in the spreadsheet cell.

In order to work around this behavior, the error trapping ability of Visual Basic was employed.

By coding “ON ERROR RESUME NEXT” inside the new p_Tv function, the returned

“#VALUE!” error was suppressed, and corrective action could be taken by the program.

Through experience, it was learned that the error in this instance occurred because the guessed

maximum pressure in the interval halving scheme was too high. Thus, when an error return

occurred, the maximum pressure in the interval was reduced to 90% of its prior value, and the

T_pv function call was re-executed. This allowed the p_Tv function to successively shrink the

range of pressure, until a valid range was established. From that point on, the interval halving

routine could determine the correct pressure.

Help Descriptions

Excel provides multiple avenues for applying descriptions to user-defined functions such as the

Xsteam functions; however, the only completely reliable method is through the Macros menu.

Page 13.431.6

Page 7: Development Of Excel Add In Modules For Use In Thermodynamics

By entering the function name and selecting Options, a description for that macro can be

inserted. Descriptions were created for every function in Xsteam which define the property the

function calculates and the input arguments, along with their respective units. These descriptions

are vital for users who are unfamiliar with the range of functions provided by Xsteam. Using the

Input Function tool, they can navigate the full list of useful functions and see what each one

requires and provides.

Graphing Functions

Pressure-specific volume (P-v), temperature-specific volume (T-v), and temperature-specific

entropy (T-s) diagrams are used regularly in the thermodynamics course to plot states and

processes and to better understand the phase of a substance. These graphs include a saturation

curve that divides the graph into regions corresponding to three states of interest; compressed

liquid, saturated mixture, and superheated vapor. Individual states and phases are then plotted to

show their phases and their relationships to other states. In the classroom, these graphs are

drawn by hand with vaguely approximate curves and points. Developing an editable, electronic

version to replace these approximate, hand-sketched plots increases the reliability and visibility

of the data.

Three graphing sub-functions were created in Excel to draw P-v, T-v, and T-s diagrams. These

functions create two arrays of points from which the saturation curve is drawn. For the P-v

diagram, one array stores a range of pressure values while the other stores the values of vV_p

and vL_p. These two functions are the saturated vapor and saturated liquid specific volumes

calculated from the known pressure. The graphing function then creates an x-y scatter plot and

inputs the two arrays as the x and y values of a series. In order to clearly see the compressed

liquid portion of the diagram, the x-axis must be on a log scale. The graphing function

automatically makes this and a few other cosmetic formatting changes. The result of this

function is shown in Figure 1a. The T-v and T-s graphing functions perform the same

operations, but record an array of temperature instead of pressure and, in the case of the T-s

diagram, use sV_p and sL_p for the saturation curve. Figures 1b and 1c show the results of these

functions.

Once one of these graphs is created showing the saturation curve, users will want to plot points

on it corresponding to the states they are interested in. To allow this functionality, three sub

functions were created, one for each type of diagram. These functions pop up a set of message

boxes asking for the values of the two properties at the state the user wishes to plot and creates a

new series on the graph with these inputs as the x and y values. Figure 2 shows a P-v plot with a

point corresponding to 5000 kPa and 0.005 m3/kg.

Page 13.431.7

Page 8: Development Of Excel Add In Modules For Use In Thermodynamics

Figure 1a

Figure 1b

0

5000

10000

15000

20000

25000

0.001 0.01 0.1 1

Press

ure (

kP

a)

Specific Volume (m^3/kg)

05 01 0 01 5 02 0 02 5 03 0 03 5 04 0 00 2 4 6 8 1 0T

em

pera

ture (

C)

Specific Entropy (kJ/kgK)

Page 13.431.8

Page 9: Development Of Excel Add In Modules For Use In Thermodynamics

Figure 1c

Figures 1a,b,c. The P-v, T-s, and T-v diagrams created by running graphing

functions programmed into the Xsteam compilation. Running these functions

automatically produces the saturations curves and formatting seen in the figures.

In thermodynamics, constant pressure and temperature processes are often discussed and plotted

on various diagrams. A function was created for each of the three previously discussed diagrams

to draw a line of constant pressure on the temperature diagrams and constant temperature on the

pressure diagram. The sub function ‘pvtemperatureline’ plots a constant temperature line on a P-

v diagram by first displaying a message box requesting the temperature the user wishes to plot.

As with the saturation curve, it then creates two arrays: one fills with the pressure range values

and the other stores the value of v_pT for each of these pressure values and the temperature input

by the user. These arrays are added to the graph as a series and the data markers are removed to

show a curve. Figure 2 shows a constant temperature line corresponding to 300°C added to a P-

v diagram. The functions ‘tvpressureline’ and ‘tspressureline’ follow the same logic as

‘pvtemperatureline,’ to plot constant pressure lines on a T-v or T-s diagram simply changing the

y-axis property and value range and using v_pT and s_pT to fill in the x-axis array.

0

50

100

150

200

250

300

350

400

0.001 0.01 0.1 1 10 100

Tem

pera

ture (C

)

Specific Volume (m^3/kg)

Page 13.431.9

Page 10: Development Of Excel Add In Modules For Use In Thermodynamics

Figure 2. P-v diagram showing a point added with the ‘pvaddpoint’ function

corresponding to a state at 5000kpa and 0.005 m3/kg and a constant temperature

line added with the pvtemperatureline function corresponding to 300°C

Ideal Gas Functions

As with the steam, a large amount of property data is provided in tabular form in

thermodynamics texts for ideal gases. There are seven particular ideal gases that are of interest

here; air, carbon monoxide, carbon dioxide, hydrogen, water, nitrogen, and oxygen. Cengel and

Boles3 provide a useful starting place for the calculations of ideal gas properties by supplying, in

Appendix 1, Table A-2, a polynomial form of temperature-dependent isobaric specific heats. 潔椎拍 噺 欠 髪 決劇 髪 潔劇態 髪 穴劇戴

The coefficients for each gas were written into a macro and the third-order polynomial was

divided by the gas’ molecular mass to provide an equation for specific heat. The table in Cengel

and Boles3 reports an applicable temperature range of 273 K to 1800 K with max errors in the

range of 0.53% to 1.19%. A similar table in Sonntag, Borgnakke, and Van Wylen4 provides

different, simple polynomial equations for temperature-dependent specific heats, but reports a

much larger applicable temperature range, 300 K to 3500 K with max errors in the range of

0.30% to 0.60%. In order to increase the range of applicability of the functions, two if-

statements were used to apply the Cengel and Boles3 equations to a temperature range of 200K to

1800K and the Sonntag et al.4 equations to the range of 1800 K to 3500 K. Though the

applicable temperature range was specified in the tables as 273 K, a true replication of the tables

required that temperatures as low as 200 K be considered. Functions implementing these

temperature ranges were written and tested. The values for the properties, specifically h, s, and

v, were compared to the table values and were found to be within the relative error required by

0

5000

10000

15000

20000

25000

0.001 0.01 0.1 1 10

Press

ure (

kP

a)

Specific Volume (m^3/kg)

Page 13.431.10

Page 11: Development Of Excel Add In Modules For Use In Thermodynamics

the project. Therefore, the use of the polynomials at the lower temperatures was justified. The

reason for not using the Sonntag et al.4 equations alone will be explained when specific enthalpy

is considered.

In addition to specific heat, specific enthalpy, specific entropy, and specific internal energy are

required to successfully duplicate the tables. From Cengel and Boles3 we know that specific

enthalpy is the integral of specific heat or in the case of the temperature dependent:

月 噺 豹潔椎拍警 穴劇 髪 月待 噺 欠岫劇 伐 劇待岻 髪 決に 盤劇態 伐 劇待態匪 髪 潔ぬ 盤劇戴 伐 劇待戴匪 髪 穴ね 盤劇替 伐 劇待替匪警 髪 月待

A similar equation was developed from the Sonntag et al.4 polynomial equations for specific heat

and both sets of equations were tested against values from the Cengel and Boles3 property tables.

It was found that at low temperatures, under 1800K, the relative errors for the Cengel and Boles3

polynomials was less than the relative errors for the Sonntag et al.4 equations. Therefore, to

improve the average relative errors of the functions, the Cengel and Boles3 equations were used

for temperatures in the range of 200K to 1800K and the Sonntag et al.4 equations for 1800K to

3500K. The only exception to this process was the equation set for air. As air is not included in

the Sonntag et al.4 table, its equations were taken completely from the Cengel and Boles

3 specific

heat equation.

Cengel and Boles3 also provides a similar equation for change in entropy: 嫌 伐 嫌待 噺 嫌ソ 伐 嫌待ソ 伐 迎 غ 鶏態鶏怠 噺 豹潔椎 穴劇劇 伐 迎 غ鶏態鶏怠

For the purpose of duplicating the tables, only the temperature dependent part of the equation is

of interest. The temperature dependent entropy is signified by the “°” symbol and is calculated

with the integral portion of the right hand side of the above equation. Considering the

polynomial equation for cp, the formula for the temperature dependent part of the specific

entropy can be written as:

嫌ソ 噺 豹潔椎拍警 穴劇劇 髪 嫌待ソ 噺 欠 غ岫劇 伐 劇待岻 髪 決岫劇 伐 劇待岻 髪 潔に 盤劇態 伐 劇待態匪 髪 穴ぬ 盤劇戴 伐 劇待戴匪警 髪 嫌待ソ As with specific enthalpy, a similar equation was derived for the temperature dependent part of

the specific entropy from the Sonntag et al.4 relations. If statements were used to apply these

equations to their appropriate temperature ranges.

A definition for specific internal energy is derived from the definition of enthalpy and the ideal

gas equation of state. 月 噺 憲 髪 鶏懸 鶏懸 噺 迎劇 憲 噺 月 伐 迎劇

Page 13.431.11

Page 12: Development Of Excel Add In Modules For Use In Thermodynamics

The equations for specific enthalpy and entropy include a reference state with the zero subscript.

In order to match the results with the tables in the text, the first non-zero data point in the tables

was used as the reference. Thus the air equations drew their reference at 200 K while the other

gases started at 220 K.

Once functions for specific isobaric heat capacity, specific enthalpy, specific entropy and

specific internal energy were written for each gas, the functions were tested. By evaluating each

function for each gas over a range of various temperatures and comparing the results to data

taken from the Cengel and Boles3 tables, the relative error could be calculated for the functions.

Table 5 shows the test chart for air. Of all the data points tested, the largest relative error came

from the specific internal energy function for oxygen at 0.618%. Consequently, that function

posted the largest average percent error at 0.286%. Every function matched the table with better

accuracy than our desired 0.5%.

Table Calculated Table Calculated Table Calculated

T Cp h h % diff u u % diff s0 s0 % diff

K kJ/kgK kJ/kg kJ/kg kJ/kg kJ/kg kJ/kgK kJ/kg

200 0.9900 199.97 199.9700 0.0000 142.56 142.5694 0.0000 1.29559 1.2956 0.0000

300 1.0038 300.19 299.6384 0.1838 214.07 213.5375 0.2487 1.70203 1.6995 0.1473

400 1.0197 400.98 400.7937 0.0465 286.16 285.9926 0.0585 1.99194 1.9904 0.0764

500 1.0372 503.02 503.6248 0.1202 359.49 360.1235 0.1762 2.21952 2.2198 0.0129

600 1.0561 607.02 608.2802 0.2076 434.78 436.0785 0.2987 2.40902 2.4106 0.0641

700 1.0758 713.27 714.8673 0.2239 512.33 513.9654 0.3192 2.57277 2.5748 0.0801

800 1.0960 821.95 823.4531 0.1829 592.30 593.8508 0.2618 2.71787 2.7198 0.0709

900 1.1162 932.93 934.0635 0.1215 674.58 675.7610 0.1751 2.84856 2.8501 0.0524

1000 1.1361 1046 1046.6841 0.0616 758.94 759.6813 0.0977 2.96770 2.9687 0.0334

1100 1.1552 1161.1 1161.2595 0.0163 845.33 845.5565 0.0268 3.07732 3.0779 0.0182

1200 1.1732 1277.8 1277.6938 0.0075 933.33 933.2905 0.0042 3.17888 3.1792 0.0094

1300 1.1896 1396 1395.8501 0.0086 1022.8 1022.7465 0.0072 3.27345 3.2737 0.0090

1400 1.2040 1515.4 1515.5511 0.0087 1113.5 1113.7472 0.0204 3.36200 3.3624 0.0133

1500 1.2161 1636 1636.5785 0.0372 1205.4 1206.0743 0.0551 3.44516 3.4459 0.0227

1600 1.2253 1757.6 1758.6734 0.0628 1298.30 1299.4690 0.0900 3.52364 3.5247 0.0312

1700 1.2314 1880.1 1881.5362 0.0764 1392.7 1393.6316 0.0669 3.5979 3.5992 0.0367

1800 1.2338 2003.3 2004.8267 0.0762 1487.2 1488.2217 0.0687 3.6684 3.6697 0.0352

2000 1.2262 2252.1 2251.1255 0.0433 1678.7 1677.1200 0.0941 3.7994 3.7994 0.0013

2200 1.1993 2503.2 2494.0327 0.3662 1872.4 1862.6267 0.5220 3.9191 3.9152 0.0988

2250 1.1892 2566.4 2553.7531 0.4928 1921.3 1907.9969 0.6924 3.9474 3.9421 0.1350

AVG 0.103 0.144 0.045

Table 4

Test Values for the Air Ideal Gas Functions

Implementation

As stated in the introduction, one of the key requirements of a classroom software package is that

it be accessible. Three key factors contribute to the accessibility of this style of computational

Page 13.431.12

Page 13: Development Of Excel Add In Modules For Use In Thermodynamics

course package: in-class training, individual experience, and external availability. In order for

the software to be considered useful in the classroom, it must be discussed there. Simply

providing the software and expecting the students to utilize it on their own is not practical.

While such in-class training is imperative for introducing the student to the software, this

introduction is not sufficient for thorough familiarization. The best way to promote the usage of

such a tool is to force the students to utilize it on an individual basis. As class time is limited,

this individual use is most practically gained through assigned homework problems. It follows

then that the software must be made available outside the classroom.

For a student, understanding how the property functions are useful requires an understanding of

how the tables in the text are used. Therefore, the theory of the tables and their use was

introduced in classroom lectures. Once this theory was taught, the Excel functions were

introduced through in-class examples. The advantage of using Excel is not only its

programmability, but also the organization and data manipulation provided by its spreadsheet

platform. Students were taught how to utilize these spreadsheet tools to make their work

organized and explicit. Students were expected to define the problem, provide a schematic, and

state their variables and answers using a four column system. The spreadsheet from an in-class

example problem utilizing these formatting guidelines is shown in Figure 3. The first column

states the variable name, the second contains the value of the variable, the third displays its units,

and the fourth either cites the source of the variable’s value or displays the equation used to

calculate it.

These formatting tips were not only introduced in the in-class examples, but following them was

also required in the assigned homework. Requiring the use of Excel and the property functions

in the homework met three important goals. First, the students gained the experience with the

Xsteam and ideal gas functions necessary to understand their use. Secondly, they learned how to

organize an Excel spreadsheet so that it was more than random numbers on a page. Finally, they

gained that introduction into computational problem solving that was the purpose of this project.

To address the availability issue, textbook-bundled software packages provide a hard copy that

can be installed or accessed on any computer, but this requires the students to have the storage

disc available when they wish to use it. The unparalleled availability of the internet makes

online posting a far more accessible means of storage. Posting the functions on a website as

Excel Add-Ins allowed them to be downloaded and applied to Excel on any computer. A

website5 was designed for the project and hosted on a University server. Each Add-In was

posted on a page for the course it was written for and a description of its contents was given. A

tutorials page was developed to post PowerPoint files in which the use of each Add-In and other

general Excel tips were explained.

Student Response

Descriptive data was gathered in order to gage the opinion of students being taught the Excel-

driven thermodynamics curriculum through two avenues; online surveys and focus group

discussion. Survey questions were designed through discussions with the project’s educational

consultant to sample student opinions regarding their experiences. Two web-based surveys were

distributed to the thirty students in the class. One was given approximately 80% into the course,

the “Midterm” survey, which received nineteen student responses. A sample of these questions

Page 13.431.13

Page 14: Development Of Excel Add In Modules For Use In Thermodynamics

and the d

of expert

good, wit

steps nec

strongly

effectiven

felt that i

problem

Figure

distribution o

tise in using

th only one r

cessary to so

agreed that s

ness in the te

it was difficu

in thermody

3. Example

practi

of their answ

Microsoft E

respondent s

lve a thermo

student achie

eaching of a

ult to explain

ynamics, a qu

problem wo

ices and use

wers are show

Excel for gen

selecting min

odynamics p

evement in t

appropriate e

n how to use

uestion desig

orked in clas

of the XSte

wn in Figure

neral purpose

nimal. Most

problem. Th

thermodynam

engineering c

e an engineer

gned to mea

ss showing g

am function

e 4. When as

es, the vast m

t students al

he vast majo

mics is direc

computation

ring comput

asure the leve

good formatt

ns.

ked about th

majority repo

so felt that th

rity of stude

ctly related to

nal tools. Wh

tational tool

el of comfor

ting

heir current l

orted adequa

hey knew th

ents agreed o

o their teach

hen asked if

in solving a

rt students ha

level

ate to

he

or

her’s

f they

ad

Page 13.431.14

Page 15: Development Of Excel Add In Modules For Use In Thermodynamics

Figure 4. Selected results from the Midterm survey.

with the tool, most were unsure, but a few more agreed rather than disagreed. The vast majority

agreed or strongly agreed that Microsoft Excel is useful in solving engineering problems. When

asked whether using Excel to solve engineering problems required more effort than benefit

gained, about a third (31.6%) of students strongly agreed or agreed, but the majority (52.7%)

disagreed or strongly disagreed with that sentiment.

Page 13.431.15

Page 16: Development Of Excel Add In Modules For Use In Thermodynamics

A second survey was conducted 110% into the course, the students being invited via e-mail to

participate in the web survey after the final exam. This “final” survey received a lower response

rate (14/30) than the Midterm survey. A selection of questions from the survey, along with the

distribution of responses, is seen in Figure 5. In this survey, all students rated their expertise

with excel as very good or adequate. 92.9% agreed or strongly agreed that Excel could be a

useful computational engineering tool, and, not seen in Figure 5, 85.7% agreed or strongly

agreed that it could be used as an effective organizational tool. The vast majority (78.6%) agreed

or strongly agreed that they knew the steps necessary to solve a thermodynamics problem. When

asked if they felt the use of Excel inhibited their ability to learn material in the Thermodynamics

I course, two out of three (64.3%) disagreed, and only one respondent (7.1%) agreed.

Interestingly, the majority (57.1%) agreed that use of Excel expanded the range of

thermodynamics problems they can solve, although 28.6% disagreed. Not shown in Figure 5,

92.8% of students agreed or strongly agreed that using Excel as an organizational workbook for a

collection of engineering problems was a good idea, and 85.7% agreed or strongly agreed that

they learned a lot about Excel in Thermodynamics I. 82.8% of students agreed that Excel was

useful in solving engineering problems. When asked whether using Excel to solve engineering

problems required more effort than benefit gained, the majority (60%) disagreed or strongly

disagreed, although a significant minority (28.5%) agreed.

A focus group was recruited to gather more in-depth and personalized responses than those

resulting from the online surveys. Four students were chosen to join the group by a graduate

student who had no previous classroom exposure to them. The students were chosen to represent

a range of grades earned in the course. That graduate student also moderated the discussion,

beginning with a question about the students’ level of expertise coming into the class. The

students had a range of responses from one student with no experience at all to one who had used

Excel extensively at his job. The other two students were comfortable with simple tasks in

Excel, but not extensive use. The consensus was that their classroom experience increased their

expertise with specific mention given to the organization skills taught in formatting

requirements. Even the student who had used Excel frequently at work expressed wishes that he

had known some of the practices taught in the class when he was preparing his reports. The

moderator asked about their experiences with the property calculating functions specifically.

The students agreed that becoming familiar with them was arduous, but after that familiarization

was complete, the functions made property calculation far more efficient. They also made it

abundantly clear that removing the need to interpolate was appealing. When questioned about

the Add-In format and its usability, they agreed that being able to use the functions on any

spreadsheet is ideal. They did not like the idea of having one macro-enabled workbook housing

the functions. The moderator turned the discussion to the in-class examples, and received two

unanimously voiced complaints. First, students expressed a desire for more full length examples.

Then they discussed some of the difficulty in following and reproducing a computational

example on their own console. These stemmed mostly from their inexperience in comparison to

the professor. If the professor moved too fast for them to follow, or if they made an error in their

Page 13.431.16

Page 17: Development Of Excel Add In Modules For Use In Thermodynamics

Figure 5. Selected results from the Final survey.

Page 13.431.17

Page 18: Development Of Excel Add In Modules For Use In Thermodynamics

typing on a specific equation, they could get caught up in trying to fix their spreadsheets to

match the example and miss out on the next steps. They insisted that posted in-class examples

on the course website were invaluable resources and helped assuage these issues.

Utilizing this data for hypothesis generation is not a straightforward process. The lack of data

from a control group and from the class at the beginning of the course prohibits quantifying the

program’s success or failure. However, there are some generalities that can be expressed.

Responses from the final survey and focus group imply that the introduction to computational

problem solving, the main intention of the project, was successful. Though the majority of

respondents do not think the use of Excel is “more trouble than it’s worth”, there are some that

disagree. Finally the vast majority of students approved of Excel as a tool for solving and

presenting the results of engineering problems.

Conclusion

Toward the goal of familiarizing students with computational problem solving earlier in their

college career, a suite of Excel functions pertinent to use in a sophomore thermodynamics course

has been developed. The functions written for steam and ideal gas properties can successfully

duplicate the textbook property tables with better than 0.5% relative error. They provide a wide

range of useful property calculation and graphing tools to better understand property-state

relationships.

Students were introduced to these functions in the classroom through example problems and

were required to use them on their own in assigned homework problems. Using these functions

and the Excel spreadsheet platform students were able to produce well formatted solutions to

thermodynamics problems. Making the functions available to them through website posting

allowed easy accessibility from any computer with an internet connection.

Student opinions concerning the introduction to Excel, the use of it with in-class examples, and

their experiences with it in the homework were recorded.

Future Work

More work is required to develop a completely comprehensive set of computational tools for the

thermodynamics courses. As the project continues, similar property functions will be written for

HFC-134A. Further development of the graphical analysis tools will eventually result in a more

user-friendly menu of functions including the plotting of commonly encountered processes and

cycles. Development of more sophisticated polling methods and data collection will make the

process of rating the success and feasibility of this project more reliable.

Acknowledgement

This material is based upon work supported by the National Science Foundation under

Grant No. DUE-0633330. The authors gratefully acknowledge support from this NSF

award.

Page 13.431.18

Page 19: Development Of Excel Add In Modules For Use In Thermodynamics

Disclaimer

Any opinions, findings, and conclusions or recommendations expressed in this material arethose

of the author(s) and do not necessarily reflect the views of the National ScienceFoundation.

References

1. Chappell, Joseph and Keith Woodbury. Introducing Excel Based Steam Table Calculations into

Thermodynamics Curriculum, Proceedings of the 2008 ASEE Annual Conference & Exposition. June 2008,

Pittsburgh, PA.

2. Wagner, W, J. R. Cooper, A. Dittmann, J. Kijima, H.-J. Kretzschmar, A.Kruse, R. Mares, K. Oguchi, H. Sato, I.

Stocker, O. Sifner, Y. Takaishi, I. Tanishita, J. Trubenbach, Th. Willkommen. The IAPWS Industrial

Formulation 1997 for the Thermodynamic Properties of Water and Steam, Transactions of the ASME, Vol. 122,

p. 150-182. ASME, January 2000.

3. Cengel, Yunus A. and Michael A. Boles. Thermodynamics: An Engineering Approach, 6th Edition. New York,

NY: McGraw-Hill Companies, Inc , 2008.

4. Sonntag, Richard E., Claus Borgnakke, and Gordon J. Van Wylen. Fundamentals of Thermodynamics, 5th

Edition. New York, NY: John Wiley & Sons, Inc, 1998.

5. Excel in M. E. Project Website. 2007. University of Alabama, 17 January 2008 <http://www.me.ua.edu/excel>

Page 13.431.19