freesteam is an open source implementation of
international-standard steam
tables from the International Association for the Properties of Water
and
Steam (IAPWS). freesteam lets you compute water and steam properties for a wide range of pressures and temperatures: you can specify the state of the steam in terms of a variety of combinations of 'known' properties, then freesteam will solve and allow you to query to find the values of the 'unknown' properties.
IAPWS-IF97 Industrial formulation (high speed, but complex code)
IAPWS-95 Scientific formulation (low speed, but simple code)
The library includes bindings for the Python language, as well as bindings to allow it to be used from the ASCEND modelling environment. For Windows users, a convenient .exe installer is provided.
New: The 0.8 release contains a rewrite of the thermal conductivity correlation, and fixes a bug in the calculation of densities in the two-phase Region 4.
There is a mailing list for freesteam users, which is the preferred support mechansim (it ensures that FAQs are captured for others to re-use). Alternatively, you can email the developer directly on
. The project is under active development as of Aug 2007, and contributions are most welcome!
1. What can I do with it?
1.1 IAPWS-IF97 Industrial Formulation
You can use freesteam to calculate the properties of steam and water
given its state, using the IAPWS-IF97 equations.
First you must specify
the state of the steam,
using one of the following combinations of variables:
(p,T) for subcooled/superheated steam.
(rho,T) for supercritical steam.
(T,x) for saturated steam
(p,T,x) anywhere
(p) plus one of (s,h,u,v,cp,cv,rho)
(T) plus one of (s,h,u,v,cp,cv,rho)
By two-way iteration, state can furthermore be solved for:
(u,v) (p,h) (p,u) (p,s) (T,s) (T,h)
Alternatively, you can specify:
saturated water at T
saturated steam at T
Then, you can obtain the value of any of
the following steam properties:
p
Pressure
T
Temperature
h
Enthalpy
s
Entropy
cp
Isobaric heat capacity
cv
Isochoric heat capacity
v
Specific volume
rho
Density
u
Internal energy
x
Quality (when saturated)
k
Thermal conductivity
A correlation for viscosity is also provided but this has not been rigorously validated.
New: Calculation of surface tension is now supported (from version 0.6.2)
Also available are some 'boundary' functions which allow you to
calculate the
following:
Saturation pressure
psat(T)
Saturation temperature
Tsat(p)
You can also create property diagrams
from the freesteam code for most of the above combinations of
steam properties.
You can also access freesteam from the EMSO simulation. More plug-ins for other systems are proposed: python hooks, MATLAB, Excel and OpenOffice/Gnumeric plugins. See future directions (below) for more info.
The code for calculating steam properties according to the IAPWS-95 equations, developed by Don Peterson, is included. In their present form, the formulation allows you to calculate the above properties but only in terms of density and temperature.
IAWPS-95 is said to be higher accuracy but consumes greater computing time. This may depend on the formulation of your problem however - some problems require quite a lot of iterative root-finding when using IAPWS-IF97.
1.3 Goal-seeking for steam state
freesteam offers more flexibility than many other steam tables packages in its ability to find a particular steam state in terms of the combination of steam properties you desire. With other packages, you may only be given the properties correlated in terms of (p,T) or (ρ,T), etc. This would then require you to link to or write your own root-finding code before you could use the correlation to solve your problem.
At present, freesteam permits the robust solution of steam state in terms of the following sets of properties: (p,T)
(u,v) (p,h) (p,u) (p,s) (T,s) (T,h) (p,v) (p,cp) (p,cv) (p,rho) (T,u) (T,v) (T,cp) (T,cv) (T,rho). The architecture for adding new property combinations is modular, if you need another combination, let me know.
There is a test-suite provide with the source code that allows you to verify the above iterative solutions against the results from forward computation.
2. License
freesteam is released under
the GNU GPL, which is available online
at
http://www.gnu.org/copyleft/gpl.html.
It is also distributed with the source code distribution for freesteam,
as LICENSE.txt.
Note that under the GPL, you can not dynamically or statically
link to the freesteam library from your own code unless your code is
also licensed under the GPL.
3. Bugs
For a complete up-to-date list of bugs and feature requests, visit
the Mantis bug tracker for
the project. We are not using the SourceForge 'tracker' at this stage.
Some of the bugs current at the time of writing:
There is a problem with whichStateStr which we need to fix.
The one-way solver has some problems in certain situations. For example, solving for a desired value of specific volume along the saturation curve will give errors at low temperatures, because of the 'density anomaly'. See this bug.
The current implementation uses an IAPWS Supplementary Release correlation for the density of saturated steam when the temperature exceeds that of the region 1/region 3 boundary. This is not in keeping with the 'pure' IAPWS-IF97 Release, and gives slightly different values for specific entropy at the critical point as a result. See this bug for more information.
4. Future directions
Some of the things waiting 'on the drawing board' are as follows. If you can help, please let me know!
High priority
Write some documentation!
Add a directory with some more example code.
Support for Visual C++ 2005 compiler. Seems that this may require adoption of the units-of-measurement C++ template classes from Boost.org, in place of those currently in use from Embedded.com, which are broken at present.
Genick Bar-Meir has started working on a Qt-based GUI for freesteam. Stay tuned!
DIY Ideas 4U
Initial work has being done on an Excel add-in version using the XLW wrapper classes. There are some build issues with XLW to be resolved.
Preliminary work on another hook library to integrate freesteam with the EES equation solver (manual here)has also been performed; this will likewise require some special license agreement. At present, EES provides only the IAPWS-95 'scientific and general use' correlation.
Integration of the IAPWS-95 correlation into GiNaC. This work is largely complete (the code's not on the net yet though): it needs to be incorporated into the freesteam distribution.
Saturation properties for region 3 are currently implemented used the rho_sat(T) correlations from the IAPWS supsat release. Need to change this to use an iterative solver based on the region 3 correlations, since the current equations give slight inconsistencies with pure IAPWS data for pressures above about 16 MPa.
Backwards correlations will massively reduce the amount of two-way iteration required when finding the state for unsual combinations of variables.
An interactive command-line
steam tables program for easy demonstration/interactive testing.
An add-in version for OpenOffice would be good. Have received some partially-working source code for this from Allan Curtis
There have been contributions for the reverse equations in Region 2 - I haven't incorporated these into the source code yet though.
There have been contributions from Allan Curtis for some reverse equations in Region 3 - I haven't incorporated these into the source code yet though.
The compiled size of the code is quite large at the moment, probably because of the large amount of debugging code and GDB symbols. However some of this might be to do with bad use of C++ templates, need to take a look at that.
Region 5 has not yet been implemented at all, but it's a low priority. Let us know if you'd need it.
We'd like to extend the phase diagrams code so that lines of constant properties (pressure, temperature, entropy, enthalpy, etc) can be shown as well as the saturation/region lines.
University of Applied Sciences Zittau/Görlitz, Germany: FluidEXL
Edward Throm: ASTEM97
G&P Engineering: StmProps
Wagner, Wolfgang, Kretzschmar, Hans-Joachim, International Steam Tables - The
Industrial Standard IAPWS-IF97 for the Thermodynamic Properties and
Supplemetary Equations for Other Properties: Tables, Algorithms,
Diagrams, Software, 2nd ed., 2006 (!),
Springer, Germany.
MegaWatSoft: Steam97
ARC Engineering plc: arcSteam
GP International: GPSteam ("ASME
97" formulation)
Rudjer Boskovic Institute: ISANO
Iapwsif97
Other steam calculators (Non IF97)
WinSim STEAM67
(ASME 1967 Steam Tables, with source code in C)
PARVO95, PARVO67 http://fortraner.narod.ru/
(Fortran) In Russian, not tested.
Some useful steam table charts
Copied from Reynolds' Thermodynamic
Properties in SI, Stanford Univ, 1979: h-s,
p-h,
T-s,
v-u