Java IAPWS-IF97 Steam Tables

Java IF97 library

IAPWS-IF97 is the Industrial Formulation by The International Association for the Properties of Water and Steam (www.iapws.org).

Hummeling Engineering released its water & steam thermodynamic properties library to the public domain, under GNU Lesser General Public License. That is, free for any product to use and redistribute. Even proprietary software developers can use our library.

Stay informed via the IF97 mailing list → Name: Email:
Download IF97

IF97 project binaries and source code are hosted on SourceForge: sourceforge.net/projects/if97 as well as compiled sources and API documentation (javadoc).

Our IF97 library is developed in Java, with a test suite containing a mere 100 tests readily available in the source distribution.

IF97 artefacts are also available in The Central Repository and can be added to your Maven project dependencies section:

<dependency>
    <groupId>com.hummeling</groupId>
    <artifactId>if97</artifactId>
    <version>1.0.5</version>
</dependency>

This library has no dependencies on other software libraries, except for the test classes which require JUnit.

>> Available properties

(p, T)(p, h)(p, s)(h, s)(T, s)(ρ, T)(p, x?)(T, x?)
ρdensity
εdielectric constant
ηdynamic viscosity
αvisobaric cubic expansion coefficient
κTisothermal compressibility
νkinematic viscosity
PrPrandtl number
pabsolute pressure✓sat.
nrefractive index
hspecific enthalpy
uspecific internal energy
sspecific entropy
cpspecific isobaric heat capacity
cvspecific isochoric heat capacity
vspecific volume
wspeed of sound
σsurface tension
Ttemperature✓sat.
λthermal conductivity
κthermal diffusivity
xvapour fraction
gspecific Gibbs free energy
(z/x)ypartial derivative

Partial derivatives can be specified using the com.hummeling.if97.IF97.Quantity enumeration. For example, the partial derivative of pressure with respect to enthalpy for constant temperature is retrieved as follows:

double dp_dh = if97.partialDerivativePT(3, 300, IF97.Quantity.h, IF97.Quantity.T, IF97.Quantity.p);

Note that partial derivatives are returned in the DEFAULT unit system, so (p/h)T would be in MPa·kg/kJ.

>> Using IF97 in Java

  1. Add IF97 to the imports: import com.hummeling.if97.IF97;
  2. Create an IF97 object: IF97 if97 = new IF97(IF97.UnitSystem.ENGINEERING);
  3. Retrieve a property: double v = if97.specificVolumePT(3, 300);

When arguments are out-of-range, an com.hummeling.if97.OutOfRangeException is thrown, which states the exceeded limit. This class contains methods that return the limit (double getLimit()), the quantity (String getQuantity()), and the exceeding value (double getValue()).

Use IF97.UnitSystem enumeration to select a unit system:

  • DEFAULT
  • ENGINEERING
  • SI
  • IMPERIAL
DEFAULTENGINEERINGSIIMPERIAL
ρdensitykg/m³kg/m³kg/m³lb/ft³
εdielectric constant----
ηdynamic viscosityPa·sPa·sPa·scP
αvisobaric cubic expansion coefficient1/K1/K1/K1/R
κTisothermal compressibility1/MPa1/MPa1/Pain²/lb
νkinematic viscositym²/sm²/sm²/scSt
κthermal diffusivitym²/sm²/sm²/scSt
PrPrandtl number----
pabsolute pressureMPabarPapsi
nrefractive index----
hspecific enthalpykJ/kgkJ/kgJ/kgBTU/lb
uspecific internal energykJ/kgkJ/kgJ/kgBTU/lb
gspecific Gibbs free energykJ/kgkJ/kgJ/kgBTU/lb
sspecific entropykJ/(kg·K)kJ/(kg·K)J/(kg·K)BTU/(lb·R)
cpspecific isobaric heat capacitykJ/(kg·K)kJ/(kg·K)J/(kg·K)BTU/(lb·R)
cvspecific isochoric heat capacitykJ/(kg·K)kJ/(kg·K)J/(kg·K)BTU/(lb·R)
vspecific volumem³/kgm³/kgm³/kgft³/lb
wspeed of soundm/sm/sm/sft/s
σsurface tensionN/mN/mN/mlbf/ft
TtemperatureK°CK°F
λthermal conductivityW/(m·K)kW/(m·K)W/(m·K)BTU/(hr·ft·R)
xvapour fraction----
λwave lengthμmμmmin

Note that partial derivatives are returned in the DEFAULT unit system.

>> Accessing IF97 from MATLAB

MATLAB is a registered trademark of The MathWorks, inc.

Our IF97 library can be accessed easily from within MATLAB since Java is standard shipped with MATLAB. First add IF97.jar to MATLAB's dynamic class path
>> javaaddpath path_to_IF97.jar

Select your preferred unit system
>> unitSystem = javaMethod('valueOf', 'com.hummeling.if97.IF97$UnitSystem', 'ENGINEERING');

Create an instance of the IF97 class
>> if97 = com.hummeling.if97.IF97(unitSystem);

Retrieve a property, e.g., specific volume as a function of pressure and temperature as follows
>> if97.specificVolumePT(3, 300)

Alternatively, the Java archive can be added to MATLAB's static class path by editing your classpath.txt file, see your documentation for more details. Or you could add the javaaddpath statement to your MATLAB startup file, startup.m.

For a list of available methods issue the following command
>> methodsview(if97)

>> Need help?

Send us an email:

Call us: +316 5758 1679

Happy with our library? Consider a donation!

We've also implemented the more accurate (but slower) formulation for scientific and general use, IAPWS-95. Contact us for more information.

For an implementation in C, refer to sourceforge.net/projects/freesteam.

© 2009-2017 Hummeling Engineering BV — Trade Register of The Hague 57591113

MATLAB & Java professional