TPWS
Thermodynamic
Properties of Water and Steam
by Howard Chao and Stella Unruh
Matlab Code
The
IAPWS IF-97 equations were programmed and tested with Matlab 7.0.0.19920
(R14). In order to make future updates
and modifications easier, the code is broken down into numerous sub-functions. These twenty-five files are detailed below.
Uses
the bisection method to solve f(x) = target with use with tpws.m. For instance, this code was used to solve for
the density corresponding with a given pressure and temperature in Region 3
calculations.
Calculates
the thermodynamic properties of water based on the IAPWS IF-97 Release for
Region 1.
Loads
the numerical values of the coefficients and exponents of the dimensionless
Gibbs free energy for Region 1.
Calculates
the thermodynamic properties of water based on the IAPWS IF-97 Release for
Region 2.
Loads
the numerical values of the coefficients and exponents of the ideal gas part of
the dimensionless Gibbs free energy for Region 2.
Loads
the numerical values of the coefficients and exponents of the residual part of
the dimensionless Gibbs free energy for Region 2.
Loads
the numerical values of the coefficients of the B23-equation for defining the
boundary between regions 2 and 3.
Calculates
the pressure at a given temperature for the boundary between regions 2 and 3
based upon the IAPWS IF-97 Release.
Calculates
the temperature at a given pressure for the boundary between regions 2 and 3
based upon the IAPWS IF-97 Release.
Calculates
the thermodynamic properties of water based on the IAPWS IF-97 Release for
Region 3.
Loads
the numerical values of the coefficients and exponents of the dimensionless
Helmholtz free energy for Region 3.
Calculates
the thermodynamic properties of water based on the IAPWS IF-97 Release for
Region 4.
Calculates
the saturation pressure at a given temperature based upon the IAPWS IF-97
Release for Region 4.
Loads
the numerical values of the coefficients of the dimensionless saturation
equations.
Calculates
the saturation temperature at a given pressure based upon the IAPWS IF-97
Release for Region 4.
Calculates
the thermodynamic properties of water based on the IAPWS IF-97 Release for
Region 5.
Loads
the numerical values of the coefficients and exponents of the ideal gas part of
the dimensionless Gibbs free energy for Region 5.
Loads
the numerical values of the coefficients and exponents of the residual part of
the dimensionless Gibbs free energy for Region 5.
Calculates
the properties of water and steam based on the IAPWS IF-97 release as a function
of temperature and pressure.
Thermodynamic properties are returned in a data structure and displayed
in a table (optional). The units used by
this application must be stored in tpws_SetUnit.m.
Converts
a tpws data structure from the standard IAPWS units to the unit set defined by
tpwsUnits.
Converts
a tpws data structure from the units defined by tpwsUnits to the default IAPWS
units.
Displays
the tpws data structure in a table format with corresponding units.
Initializes
a empty data structure for use in the tpws applications.
Determines
the region of the data point at p and T based upon the IAPWS IF-97 Release.
Defines
the unit set for use with tpws.m.
[ Introduction | Matlab
Code | Program
Verification | Examples | Suggested Improvements | References ]