XSteam provides (mostly) accurate steam and water properties from 0 -
1000 bar and from 0 - 2000 °C according to the IAPWS release IF-97. For
accuracy of the functions in different regions see IF-97 Page 4
Also includes thermal conductivity and viscosity, which are not part of
the IF97 release.
Some effort has been made to include the refined function of more recent releases
and also functions for calculations on heavy water. This includes:
IAPWS R4
IAPWS R14
Contributors
In chronological order:
IAPWS
Magnus Holmgren
drunsinn
mohit0749
gonmolina
xjtu-blacksmith
Requirements
There are no requirements for installing pyXSteam with Python 3.6 and up.
Tests require numpy, demos require numpy and matplotlib
Install
run python3 setup.py install
To run unittests you need two additional packages: pytest and numpy. After installing both, just run pytest in
the base directory. The tests use some fixed values from the documentation to make sure that every coefficient
and formula works as intended.
To test if setup was successful, run python3 bin/pyXSteamDemo.py. This will require numpy and matplotlib to be installed.
Nomenclature
All Functions follow the same naming schema: First the wanted property,
then a underscore _, then the wanted input properties Example:
t_ph is temperature as a function of pressure and enthalpy. For a list
of valid functions se below:
Property
Description
t
Temperature (°C or °F)
p
Pressure (bar or psi)
h
Enthalpy (kJ/kg or btu/lb)
v
Specific volume (m3/kg or ft^3/lb)
rho
Density (kg/m3 or lb/ft^3)
s
Specific entropy (kJ/(kg °C) or btu/(lb °F))
u
Specific internal energy (kJ/kg or btu/lb)
Cp
Specific isobaric heat capacity (kJ/(kg °C) or btu/(lb °F))
Cv
Specific isochoric heat capacity (kJ/(kg °C) or btu/(lb °F))
w
Speed of sound (m/s or ft/s)
my
Viscosity (N s/m^2 or lbm/ft/hr)
tc
Thermal Conductivity (W/(m °C) or btu/(h ft °F))
st
Surface Tension (N/m or lb/ft)
x
Vapor fraction
vx
Vapor Volume Fraction
Usage
Simple Example:
from pyXSteam.XSteam import XSteam
steamTable = XSteam(XSteam.UNIT_SYSTEM_MKS)
print(steamTable.hL_p(220.0))
By using the unitSystem Parameter, you can tell XSteam witch Unit System you are using.
I am completely new to python, GitHub and using other people's code, so I could just be doing this wrong. But when I download it and ran the setup.py file in spyder (4.1.5) using python (3.8.1), it gave me this error:
An exception has occurred, use %tb to see the full traceback.
Traceback (most recent call last):
File "/Users/noaheby/opt/anaconda3/lib/python3.8/distutils/core.py", line 134, in setup
ok = dist.parse_command_line()
File "/Users/noaheby/opt/anaconda3/lib/python3.8/distutils/dist.py", line 501, in parse_command_line
raise DistutilsArgError("no commands supplied")
DistutilsArgError: no commands supplied
During handling of the above exception, another exception occurred:
In the enthalpy computation as a function of pressure and temperature , the pressure is limited to 100 instead of 1000 bars. Could you fix that please?
Hello, I am trying to use your library. I installed as you said pip install XSteamPython but when I open my IDE (Spyder) give me that Ñ ModuleNotFoundError: No module named 'XSteamPython'
I am new in python, btw
I tried the installation that you explained but got this error
Traceback (most recent call last):
File "/home/faisal/Downloads/pyXSteam-master/setup.py", line 4, in
import setuptools
ModuleNotFoundError: No module named 'setuptools'
setuptools are already installed so this error seems odd to me