4.69444

4.7 | 37 ratings Rate this file 300 Downloads (last 30 days) File Size: 192 KB File ID: #9817
image thumbnail

X Steam, Thermodynamic properties of water and steam.

by Magnus Holmgren

 

30 Jan 2006 (Updated 01 Aug 2007)

Water properties A complete IAPWS IF-97 standard.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

www.x-eng.com, Steam and water properties for Matlab based on the "International Association for Properties of Water and Steam Industrial Formulation 1997 (IAPWS IF-97). A full implementation of the IF-97 standard that provides very accurate steam and water properties in ranges from 0-1000 bar and 0-2000°C. Provided thermodynamic properties are:

Temperature
Pressure
Enthalpy
Specific volume
Density
Specific entropy
Specific internal energy
Specific isobaric heat capacity
Specific isochoric heat capacity
Speed of sound
Viscosity
Vapour fraction

All properties can be calculated with the inputs, p and T known, p and h known, h and s known and some with pressure and density known. X Steam are a full implementation of the IF-97 formulation including all regions and all backward functions for good calculation speed. The code are speed optimized with pressure and enthalpy as inputs for dynamic simulations.

Examples:
XSteam('h_pt',1,20) return the enthalpy of water at 1 bar and 20 degC. 84.0118 kJ/kg

XSteam('rho_ph',1,3000) return the density of steam at 1 bar and 3000 kJ/kg. 0.4056 kg/m3

XSteam('w_pt',1,20) returns the speed of sound at 1 bar and 20 deg C. 1483.4 m/s

XSteam('tSat_p',1) returns the saturation temperature at 1 bar. 99.6059 deg C

The X Steam Tables are the perfect tool both for replacing paper tables and for advanced calculations. The X Steam tables are open source and free of charge.

The X Steam tables are also available as MS Excel scripts, OOo Sripts, Dynamic Link Libary .DLL. Please visit www.x-eng.com.

New version 2.5

Acknowledgements

This file inspired Ideal Rankine Cycle Using Builder For Java, Diagrams Of Thermodynamic State Of Water, X Steam W A Vectorizing Wrapper For X Steam, Methane Solubility, Medium Model, Ideal Rankine Cycle, Ideal Regenerative Rankine Cycle, Ideal Reheat Rankine Cycle, Ideal Reheat Regenerative Rankine Cycle, Ideal Regenerative Rankine Cycle With One Open, One Closed Fwh, Ideal Reheat Regenerative Rankine Cycle With One Open, One Closed Fwh, Ideal Rankine Cycle Gui, and Iapws If97 Functional Form With No Slip.

MATLAB release MATLAB 6.0 (R12)
Other requirements None.
Tags for This File  
Everyone's Tags
chemistry, enthalpy(2), if97, pick of the week, potw, power, properties, steam(4), turbine, water(2)
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (47)
05 Apr 2013 Leon

Very good tool!
Excellent to have it condensed in a single .m file.

28 Feb 2013 Manel Soria

Excellent !!

25 Feb 2013 Rory

Excellent work! You have made my life immeasurably easier with this great tool!

15 Jan 2013 Vesa

A remark Concerning my previous comment:
The code calculates tcL and tcV as it should.
Only the documentation is vice versa.

15 Jan 2013 Vesa

In 19.7.2006 "X Steam for Matlab.pdf" and in 4.5.2007 "XSteam.m" comment lines 139-142:
%tcL_p Saturated vapour thermal conductivity
%tcV_p Saturated liquid thermal conductivity
%tcL_T Saturated vapour thermal conductivity
%tcV_T Saturated liquid thermal conductivity

Should be;
%tcL_p Saturated liquid thermal conductivity
%tcV_p Saturated vapour thermal conductivity
%tcL_T Saturated liquid thermal conductivity
%tcV_T Saturated vapour thermal conductivity
, I guess?

13 Dec 2012 Thomas Clark

Magnus,

Thank you for this thorough implementation with excellent help!

Tom

04 Dec 2012 marco ricotti  
13 Nov 2012 SooYoung Kang

Exactly what I needed, many thanks

27 Jun 2012 Mariano Nemec

ciao Magnus,

I appreciated and used your excell worksheet many years ago (vers. 2.6).

there is a new version, and from where can I get it?

14 Jun 2012 Dan Etenberg

Hello, the program is great, but I need to compute steam and ice values under 0ºC. Can anybody help me PLEASE?

24 Mar 2012 Andrew Yablokov

How to use XSteam in Simulink?

19 Mar 2012 Mark Mikofski

Thank you Magnus Holmgren for you outstanding work! Using your work as a inspiration, I completely re-coded all of the IAPWS IF97 (except region 5) and including some of the most recent documentation including thermodynamic derivatives which I needed for some non-linear 2-phase modeling. I have finally posted it here:
http://www.mathworks.com/matlabcentral/fileexchange/35710-iapwsif97-functional-form-with-no-slip
It is vectorized and fully tested, according to the test points in IF97 and accompanying documents and the numerous simulations I have performed using it. I hope you find it as useful as I have.

09 Nov 2011 Andrea Baricci  
10 Mar 2011 Morgan May

Very awesome, I was working on something similar myself, when i stumbled upon this. Talk about a time saver, I do have one question, in line 2496 Should the program read High_Bound = 2563.59200e+5 instead of High_Bound = 2563.592004+5?? Just curious.

09 Feb 2010 Jason Wang

OMG. This program saves me so much time on each thermodynamics homework. Thanks so much!

03 Mar 2009 Patrik

Solid and precise, thank you.

17 Sep 2008 aman brar

Awesome...This is exactly what I was looking for.

19 Jun 2008 ashek ullah

So many thank for your information?

05 Jun 2008 Xiangbin zhu

Thanks a lot!

07 Mar 2008 William Hounks

Beau travail

18 Feb 2008 Lourenco Crawford

very good!! thank you very much!

18 Feb 2008 Lourenco Crawford

very good!! thank you very much!

13 Nov 2007 Bogdan Marcu

Exactly what I needed, many thanks

31 Jul 2007 Jonas Andersson

Just what I need

23 Nov 2006 mario lebbe  
16 Nov 2006 Magnus Holmgren

Comment to review bellow. Temperature lines does off course break at the saturation line on ph diagrams. (However h_pt is not valid for mixtures of steam and water since temperature do not vary with enthalpy in that region. Answer becomes NaN. Temperature can?t be the saturation temp of p since then h is undefined.) I think you mixed up the numbers a little to.

XSteamUS('pSat_t',700) = 3.0928896229137e+03 psia
XSteamUS('hV_t',700) = 9.9063684424454e+02 btu/lb
XSteamUS('hV_p',3.0928896229137e+03) = 9.9063684424454e+02 btu/lb

14 Nov 2006 Allan Zadiraka

Very happy to find steam properties as good as this. Saved me from having to create my own again. Only problem is the temperature lines not breaking at the saturation line on ph diagrams (in english units)at higher pressures; sat line at 3097 psia gives 989.2 BTU/Lb versus 981.5 BTU/Lb for 3097 psia and 700F.

27 Sep 2006 David Andersson

Perfect.
Simple, exact.

26 Sep 2006 mohammad kazemi  
14 Sep 2006 pippo pluto  
29 Jun 2006 Giovani Tonel

On line 1428 ==> err=check();

24 Jun 2006 Jim Mechell

This is an extraordinary and excellent effort. In particular the ablity to obtain properties as functions P and h, h and s.
However it is not clear how the author has stated that properties can be found upto 2000 degree celcius if they are based on IF 97. These to my knowledge are applicable upto 800 degree celcius only. Students would still require a compact printed steam table that they can carry to a test or examination.An excellent new one called "Engineering Steam Tables"by Ashok Malhotra is now available for the purpose at Amazon.com. (type the title in their search box to locae it)

16 Jun 2006 TATEK ZEWDIR

I NEED HELP.................

07 Jun 2006 Dave Abramovich

Very useful. Author must have had a lot of spare time, 150kb of code isn't a few hours job.

12 May 2006 zhu jian

General Conmments

20 Apr 2006 Poomjai Sa-adchom

I like this program

01 Mar 2006 Jeff Buske

very nice piece of work! Well done.

25 Feb 2006 Tamir Suliman

Great program and excellent structure.

16 Feb 2006 Mike Baldea

Excellent work. Thank you.

06 Feb 2006 donghui zheng  
06 Feb 2006 John McKenzie

Water data that really will save me a lot of work writing tables for interpolation into my program. A really great program!
I have two minor improvements:
- I would like the different functions as separate m files rather than commands.
- I agree with the previous reviewers that it would nice if the functions where vectorized.
However that?s minor problems, the program does what it?s supposed to and it?s simple to use and well structured. The program is worth a five star.

01 Feb 2006 Duane Hanselman

1 star just to balance the author giving himself a 5 star rating. Thanks for the advice Urs!

01 Feb 2006 urs (us) schwarz

it's ok - BUT (and this is a big BUT) - in the future, do NOT give your OWN submission(s) a rating of 5/5; some people might get really offended and nasty with this inappropriate behavior
us

01 Feb 2006 Magnus Holmgren

I finally succeded in adding my file and I appriciate all the positive ratings the first day.
I'll consider to vectorize the functions.
The X Steam for MS Excel and the "spiffy figure" is also open source and can be downloaded from www.x-eng.com but I will add them to the ZIP file the next time I update it.

01 Feb 2006 Johan Karlsson

Simple and gives exact accurate results.

31 Jan 2006 John D'Errico

If you were to call this inside a long loop, the lack of vectorization might slow things down. However, thats the only reason why I might choose to downrate this at all. The documentation is far above average, so its still a 5 in my book.

31 Jan 2006 urs (us) schwarz

really nice result of a project
- extraordinary help (including PDF, to boot)
it would be even nicer
- if it was vectorized
- if the spiffy figure could be reproduced easily (see above)
- if the ...XSteam macros for MS Excel... (as mentioned in the help section) came with the package
but this is just ranting a bit
us

Updates
21 Feb 2006

Version 2.2
* Added function:
  * p_hrho
  * Prandtl number added
* Extensive testing.
* Fixed error in Cp_ph

15 Jun 2006

* English Units implemented!!!
* Fixed small error in region_ph speed up functions.
* my_ph not defined in region 4.

19 Jul 2006

Extensive testing.
Fixed missing ;.
Calling functions by pressure and density.

02 Nov 2006

Update of unit error for function T_ps for mixture of steam and water.
Only important for english units.

15 Jan 2007

New release with minor updates.

01 Aug 2007

New version with minor fixes

Contact us