B. STEAM TABLES



B. How to Use the MAPLE Steam Tables

1. Introduction

Real materials often do not behave in accordance with the ideal gas law. Hence, we must resort to using more elaborate state equations or thermodynamic tables. To this end, we have prepared packages in Maple™ which calculate the thermodynamic properties of various materials. These packages use correlations to represent the thermodynamic properties typically available in tables such as the ones at the end of your book. All the packages are designed in a similar way. In this tutorial, we focus on the properties of water.

You will learn:

i) How to install Steam Tables and its help system as Maple packages on your computer;

ii) How to obtain the thermodynamic properties of water; and

iii) How to use these thermodynamic functions within Maple™ to solve some simple problems.

Formulas used in this package (except the saturation temperature for water, which is based on an equation found in Steam and Gas Tables with Computer Equations by T. F. Irvine and P. E. Liley, Academic Press, 1984) are based on equations found in: ASME Steam Tables: Thermodynamic and Transport Properties of Steam: Comprising Tables And Charts for Steam and Water, Calculated Using the 1967 IFC Formulation for Industrial Use in Conformity with the 1963 International Skeleton Tables, prepared by C. A. Meyer, R. B., McClintock, G. J. Silvestri and R. C. Spencer, Jr., 6th Edition, ASME 1993.

The packages use SI units exclusively. It is crucial that you insert the data (typically temperature and pressure) using the appropriate units (more specifically, pressures must be expressed in MPa and temperatures must be expressed in degrees K) in the appropriate order. You must insert the numerical values of the properties together with their units. In any event, it is always a good practice to keep track of the units that you are using.

Note: When you need to use the thermodynamic functions within plotting routines, you should enclose the property function name with single quotes (') so that Maple™ knows that you wish to delay the evaluation of the function. You will also need to remove the units since the plotting routine will not be able to manipulate them. These points will be clarified later.

2. How to Install The Steam Tables AND THE HELP SYSTEM

To download the steam tables to your computer, go to the course web site, . Click on Thermodynamics with Maple. By clicking on the file names, download to your hard disk the files: SteamTables.ms, SteamTablesHelp.ms, SpecificVolumeWaterHelp.ms, EntropyWaterHelp.ms, Working-w-SteamTables.mws, and MakeHelp.mws. SteamTablesHelp.ms contains the various functions for the evaluation of thermodynamic properties. MakeHelp.ms describes how to install the optional help system for SteamTables. Working-w-SteamTables.mws is a Maple worksheet that you may want to use as a template whenever you need to use the SteamTables. The other files contain the various help windows that go with the steam tables. The help files are not essential for using the steam tables.

After downloading the necessary files, you will need to compile them. From Maple, open the file " SteamTables.ms." Go to the end of the file. The last statement of the file is:

> save `E:\\class work\\THERMODYNAMICS\\ThermoSoft\\Compiled\\SteamTables.m`;

Change this statement to the path and the name of the folder where you would like to store the compiled version of the file, i.e.,

>save `C:\\A folder name of your choice \\ SteamTables.m `;

Witness that file names containing characters special to Maple (such as backslash) must be preceded by a backslash when entering the string in Maple. Execute all the statements in the file including the last "save" statement. To do this, simply go to the edit menu and select “execute worksheet.” The net result will be the creation of the compiled version of the file entitled SteamTables.m in the selected folder.

The creation of the help system is a bit more convoluted. To make the task easier, you can use the worksheet, MakeHelp.ms, which you may have downloaded. The worksheet's content is shown in the box below. You need to make appropriate changes in the various paths.

HOW TO IMPLEMENT THE HELP SYSTEM FOR THERMODYNAMIC PROPERTIES

This worksheet will guide you through the steps needed to establish the help library for SteamTables. This process needs to be done only once. The help system is optional. The steam tables can be used without installing the help system.

First, read into the worksheet the library program:

> readlib(makehelp);

proc(nm::name, file::name, lib::name) ... end

Next, you will need to decide in which directory you wish to install the help system. For example, I installed my help system in

E:\class work\THERMODYNAMICS\ThermoSoft\Compiled.

You will need to change the name of the folder as appropriate.

Note that file names containing characters special to Maple (such as backslash) must be preceded by a backslash when entering the string in Maple.

> libname:=libname,`E:\class work\THERMODYNAMICS\ThermoSoft\Compiled`:

Next, we construct the help system for each of the functions.

> makehelp(`SteamTables`,`E:\\class work\\THERMODYNAMICS\\ThermoSoft\\SourceCode\\SteamTablesHelp.mws`,`E:\\class work\\THERMODYNAMICS\\ThermoSoft\\Compiled`):

> makehelp(`SpecificVolumeWater`,`E:\\class work\\THERMODYNAMICS\\ThermoSoft\\SourceCode\\SpecificVolumeWaterHelp.mws`,`E:\\class work\\THERMODYNAMICS\\ThermoSoft\\Compiled`):

> makehelp(`EnthalpyWater`,`E:\\class work\\THERMODYNAMICS\\ThermoSoft\\SourceCode\\EnthalpyWaterHelp.mws`,`E:\\class work\\THERMODYNAMICS\\ThermoSoft\\Compiled`):

> makehelp(`EntropyWater`,`E:\\class work\\THERMODYNAMICS\\ThermoSoft\\ SourceCode\\EntropyWaterHelp.mws`,`E:\\class work\\THERMODYNAMICS\\ThermoSoft\\Compiled`):

Maple will install the new file, maple.hdb, in the folder, E:\class work\THERMODYNAMICS\ThermoSoft\Compiled.

To get help for a particular function, you may use the standard Maple Help command (?). Type a (?) followed by the function name. Note that this command need not be terminated with a semicolon (;).

For example, to obtain information about the contents of SteamTables, type:

> ? SteamTables

This will open a new window containing the following:

STEAM TABLES

Formulas used in this package (except saturation temperature for water which is based on an equation found in Steam and Gas Tables with Computer Equations by T.F. Irvine and P.E. Liley, Academic Press, 1984) are based on equations found in: ASME Steam Tables: Thermodynamic And Transport Properties Of Steam: Comprising Tables And Charts For Steam And Water, Calculated Using the 1967 IFC Formulation For Industrial Use In Conformity With The 1963 International Skeleton Tables, prepared by C. A. Meyer, R. B., McClintock, G. J. Silvestri and R. C. Spencer, Jr., Sixth Edition, ASME, 1993.

All rights are reserved.

This package consists of thermodynamic functions that return their corresponding values. The independent variables should be supplied together with their units.

SI units are exclusively used!

To read the SteamTables into your Maple session, you will need to have a compiled version of SteamTables on your hard disk and you will need to specify the appropriate path to the folder in which SteamTables was saved.

> read 'path\\SteamTables.m';

For example,

> read 'E:\\class work\\THERMODYNAMICS\\ThermoSoft\\Compiled\\SteamTables.m';

The function included in this package are listed below. P is the pressure expressed in MPa, T is the temperature expressed in degrees Kelvin (K).

SaturationPressureWater(T)

SaturationTemperatureWater(P)

SpecificVolumeSaturatedLiquidWater(T)

SpecificVolumeSaturatedVaporWater(T)

SpecificVolumeWater(P, T)

EnthalpySaturatedLiquidWater(T)

EnthalpySaturatedVaporWater(T)

EnthalpyWater(P, T)

EntropySaturatedLiquidWater(T)

EntropySaturatedVaporWater(T)

EntropyWater(P, T)

CriticalTemperatureWater

CriticalPressureWater

CriticalSpecificVolumeWater

TriplePointTemperatureWater

TriplePointPressureWater

To see how each function operates, invoke individual help commands, i.e.,

> ?SpecificVolumeWater

The lengthy function names can be abbreviated through the use of an alias. For example, the alias command,

> alias(v_v,SpecificVolumeSaturatedVaporWater);

allows one to use v_v(T) instead of the lengthier SpecificVolumeSaturatedVaporWater(T).

3. Using Thermodynamic Functions

In order to evaluate the various thermodynamics properties, you must load SteamTables into your Maple worksheet. Once you have done so, the thermodynamic functions can be used as you would any other built-in Maple™ functions. They can also be incorporated into user-defined functions or programs.

For your convenience, I created a worksheet template, Working-w-SteamTables, that will allow you to execute all the necessary command at the beginning of the Maple session in which you plan to evaluate thermodynamic properties. Remember to change the names of the paths to accord with they way you have saved the different files on your computer.

Working with SteamTables

You may use this worksheet as a template. Just make sure to modify the various paths according to your machine settings.

First, we need to read the package SteamTables into our worksheet. Note that file names containing characters special to Maple (such as backslash) must be preceded by a backslash when entering the string in Maple.

> read `E:\\class work\\THERMODYNAMICS\\ThermoSoft\\Compiled\\SteamTables.m`;

Next, you will need to establish a path to where your library files are located.

> libname:=libname,`E:\\class work\\THERMODYNAMICS\\ThermoSoft\\Compiled`:

Generally, it's a good idea to try to use one of the thermodynamic functions to make sure that everything works properly.

> SpecificVolumeWater(.2*MPa,500*K);

3

m

1.144220489 ----

kg

Now, you can modify this worksheet and save it under a separate title.

You may wish to save the worksheet under a different name so that the template remains unaltered and ready for future use.

The simplest use of SteamTables is to evaluate the thermodynamic properties of various states. This will save you from having to look up the data in tables and then interpolate it for states that are not documented explicitly in the tables.

3.1 Evaluate the Saturation Temperature (K).

> SaturationTemperatureWater(0.1*MPa);

372.8717383 K

> SaturationTemperatureWater(.999*CriticalPressureWater);

647.366934 K

You may wish to convert the above value to degrees centigrade.

> ("-273.15*K)*C/K;

374.216934 C

Try to calculate saturation temperatures at other pressures.

3.2 Find the Saturation Pressure Corresponding to 210 C.

Remember the temperature must be expressed in degrees K and the pressure in MPa.

> SaturationPressureWater((273.15+210)*K);

1.907739012 MPa

3.3 Find the Saturation Pressure Corresponding to 500C.

Saturation conditions exist only in the range of temperatures between the triple and critical points. Since the critical temperature of water is 647.3K T1:=TriplePointTemperatureWater; T2:=CriticalTemperatureWater;

[pic]

[pic]

>plot('SaturationPressureWater(T*K)/MPa',T=T1/K..T2/K,title=`Saturation Pressure vs. Temperature`, labels=[`Temperature (K)`,` p (MPa)`]);

[pic]

Note that the saturation pressure increases monotonically as a function of the temperature.

5.2 PLOTTING MORE THAN ONE FUNCTION ON THE SAME GRAPH

We may generate a similar graph for the specific volume of saturated water (liquid and vapor). Since the specific volumes of liquid and vapor differ by two orders of magnitude, we shall multiply the former by a factor of 1000.

> plot({'1000*SpecificVolumeSaturatedLiquidWater(T*K)*kg/m^3',

'SpecificVolumeSaturatedVaporWater(T*K)*kg/m^3'},T=T1/K .. T2/K, 0..20, title = `Specific Volume vs. Temperature`, labels=[`Temperature(K)`,`v(m^3/kg)`]);

[pic]

Note that the specific volume of the liquid increases with the temperature while the specific volume of the saturated vapor decreases with the temperature. Why?

Find the difference between the specific volumes at the critical point. Should there be a difference in the values?

> SpecificVolumeSaturatedLiquidWater(T2)-SpecificVolumeSaturatedVaporWater(T2);

[pic]

It also may be interesting to depict the specific volume as a function of the pressure. Unfortunately, the SteamTables do not provide us with an explicit relationship between specific volume and pressure. However, below we shall see that this shortcoming can be overcome without difficulty.

6. Using Thermodynamic Functions to Solve Some Simple Problems

In this section, I demonstrate how Maple™, together with the SteamTables, can be used to solve a few simple problems in thermodynamics. Feel free to make changes in problem parameters. Explore how the results change as you change problem variables. You may also try to solve problems different from the ones listed below. How about using Maple to help you solve your homework problems?

In all the examples below, we will manipulate the units together with the numerical values. This is a good practice that you should adopt in all your engineering calculations. This way you will be able to make sure that all the units are consistent and that the results of the calculations have the correct units. If the units are wrong, surely the result cannot be correct. One of the advantages of using a symbolic manipulation package such as Maple is that it can manipulate symbols just as well as it can manipulate numbers.

Problem 6.1: A vessel, having a volume of 0.4 m3, contains 2.0 kg of a liquid water and water vapor mixture in equilibrium at a pressure of 600 k Pa.

Calculate the volume and mass of the liquid.

First, we list the available data:

> volume := 0.4*m^3: mass := 2*kg: Tsat := SaturationTemperatureWater(0.6*MPa): x:='x':

NOTE: The colon is used to suppress the output. Next, we calculate the specific volume of the mixture.

> specificvolume := volume/mass;

[pic]

Then, we set up an equation (eq) for the specific volume with the only unknown being the quality x. We solve for x using Maple™'s solve command. Using solve here may be an overkill; but it will help us to familiarize ourselves with yet another Maple™ function.

> eq := (1-x)*SpecificVolumeSaturatedLiquidWater(Tsat)+

x*SpecificVolumeSaturatedVaporWater(Tsat) = specificvolume;

[pic]

> x := solve(eq,x);

[pic]

The mass of the liquid is (1-x)*mass

> liquid_mass := (1-x)*mass;

[pic]

Note that in this example, we incorporated the thermodynamic function into the equation.

7. Combined Functions

SteamTables and our thermodynamic functions are constructed in such a way that you can explicitly obtain the specific volume of a saturated vapor once you know the saturation temperature.

Suppose you wish to find the specific volume that corresponds to a given pressure. This is easy. Once you know the pressure, you can calculate the saturation temperature (Tsat) and insert its value in the function, SpecificVolumeSaturatedVaporWater(Tsat), to compute the specific volume. Moreover, you can combine these two operations into a single one by using a function within a function, i.e.,

> SpecificVolumeSaturatedVaporWater(SaturationTemperatureWater(0.1*MPa));

[pic]

You may even define your own specific volume function to obtain the specific volume directly as a function of the saturation pressure.

> MyVgsp := psat -> SpecificVolumeSaturatedVaporWater(SaturationTemperatureWater(psat));

[pic]

> MyVgsp(3.5*MPa);

[pic]

8. Implicit Relationships

A somewhat more difficult problem involves the determination of thermodynamic relationships which are not given explicitly in the tables such as the saturation pressure as a function of the specific volume or the temperature as a function of the pressure and specific volume. Under these circumstances, when you are using the tables, you will need to resort to trial and error techniques. As we shall see below, Maple™ offers us a more elegant solution.

Problem 8.1: Find the saturation temperature corresponding to a specific vapor volume of 0.02352 m^3/kg (the corresponding specific liquid volume is 0.001384 m^3/kg).

The problem is that we do not have an explicit expression which would give us the SaturationTemperatureWater(v). Instead, we need to evaluate the transcendental relation

(*) SpecificVolumeSaturatedVaporWater(T)-0.02352*m^3/kg=0

to find T. This is a single equation with a single unknown. The difficulty arises because the function SpecificVolumeSaturatedVaporWater(T) is nonlinear. In other words, we need to find the zero(es) of a transcendental equation.

It is always a good idea to plot the function so we can see how it behaves; see whether it has multiple zeroes, one, or none; and obtain a rough estimate for the zero location.

To this end, we will plot

SpecificVolumeSaturatedVaporWater(T)*kg/m^3-0.02352

as a function of T and find the zero of this function (or the point at which the function crosses the abscissa). In order to be able to plot, we need to peel off the non-numerical parts of our expressions (i.e., the units). Alternatively, we can write the expressions as nondimensional quantities.

First, we define the function f(T), where T is a pure number:

> fn := T -> SpecificVolumeSaturatedVaporWater(T*K)/(.02352*m^3/kg)-1:

> plot(fn,273.15+287..273.15+310,-0.03..0.03,labels=[`T (K)`,`fn`]);

[pic]

The figure suggests that the answer is Tsat~568K which, as we shall discover later, is not too bad an estimate. We could have refined the result by zooming on the curve to blow it up in the vicinity of the crossing point.

Although the above procedure shows us the qualitative behavior of specific volume as a function of the temperature T, it is not a very efficient procedure for obtaining the actual numerical data. To solve the equation fn(T)=0, we use the Maple numerical solver

>fsolve('fn(T)=0',T,500..600);

568.1314801

It is always a good practice to check the results.

> fn(");

[pic]

Close enough!

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download