pyXSteam的Python项目详细描述
X团队
Magnus Holmgren为Matlab和Excel发布的原件:
http://xsteam.sourceforge.net和/或http://www.x-eng.com
xsteam(主要)从0-
1000巴,0-2000°C,根据IAPWS release IF-97。为了
不同区域的函数精度参见if-97第4页
还包括热导率和粘度,它们不是
IF97的发布。
要求
使用Python3.6及更高版本安装Pyxsteam没有任何要求。
测试需要numpy,演示需要numpy和matplotlib
安装
运行python3 setup.py install
要运行unittests:python setup.py test
但确保安装了numpy
要测试安装是否成功,请运行python3 bin/pyXSteamDemo.py
。这需要安装numpy和matplotlib。
声音函数的速度仍有一些错误(从v0.4.2开始),因此请注意,它们超出了错误范围。除了精度错误,不应该有警告。
命名
所有函数都遵循相同的命名模式:首先是所需的属性,
然后是下划线_
,然后是所需的输入属性示例:
t_ph
是温度与压力和焓的函数。一份清单
有效功能如下:
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 |
用法
简单示例:
from pyXSteam.XSteam import XSteam
steamTable = XSteam(XSteam.UNIT_SYSTEM_MKS) print steamTable.hL_p(220.0)
通过使用unit system参数,您可以告诉xsteam您正在使用的witch unit system。
steamTable = XSteam(XSteam.UNIT_SYSTEM_MKS) # m/kg/sec/°C/bar/W
steamTable = XSteam(XSteam.UNIT_SYSTEM_FLS) # ft/lb/sec/°F/psi/btu
steamTable = XSteam(XSteam.UNIT_SYSTEM_BARE) # m/kg/sec/K/MPa/W
要启用日志记录,请在代码中添加以下行:
import logging logger = logging.getLogger(\'pyXSteam\')
logger.setLevel(logging.DEBUG) sh = logging.StreamHandler()
sh.setFormatter(logging.Formatter(\'%(name)s - %(levelname)s - %(message)s\'))
logger.addHandler(sh)
可用功能
温度
Function | Description |
---|
tsat_p | Saturation temperature |
t_ph | Temperature as a function of pressure and enthalpy |
t_ps | Temperature as a function of pressure and entropy |
t_hs | Temperature as a function of enthalpy and entropy |
压力
Function | Description |
---|
psat_t | Saturation pressure |
p_hs | Pressure as a function of h and s. |
p_hrho | Pressure as a function of h and rho. Very inaccurate for solid water region since it's almost incompressible! |
焓
Function | Description |
---|
hV_p | Saturated vapor enthalpy |
hL_p | Saturated liquid enthalpy |
hV_t | Saturated vapor enthalpy |
hL_t | Saturated liquid enthalpy |
h_pt | Enthalpy as a function of pressure and temperature |
h_ps | Enthalpy as a function of pressure and entropy |
h_px | Enthalpy as a function of pressure and vapor fraction |
h_prho | Enthalpy as a function of pressure and density. Observe for low temperatures (liquid) this equation has 2 solutions |
h_tx | Enthalpy as a function of temperature and vapor fraction |
比体积
Function | Description |
---|
vV_p | Saturated vapor volume |
vL_p | Saturated liquid volume |
vV_t | Saturated vapor volume |
vL_t | Saturated liquid volume |
v_pt | Specific volume as a function of pressure and temperature |
v_ph | Specific volume as a function of pressure and enthalpy |
v_ps | Specific volume as a function of pressure and entropy |
密度
Function | Description |
---|
rhoV_p | Saturated vapor density |
rhoL_p | Saturated liquid density |
rhoV_t | Saturated vapor density |
rhoL_t | Saturated liquid density |
rho_pt | Density as a function of pressure and temperature |
rho_ph | Density as a function of pressure and enthalpy |
rho_ps | Density as a function of pressure and entropy |
比熵
Function | Description |
---|
sV_p | Saturated vapor entropy |
sL_p | Saturated liquid entropy |
sV_t | Saturated vapor entropy |
sL_t | Saturated liquid entropy |
s_pt | Specific entropy as a function of pressure and temperature (Returns saturated vapor enthalpy if mixture) |
s_ph | Specific entropy as a function of pressure and enthalpy |
比内能
Function | Description |
---|
uV_p | Saturated vapor internal energy |
uL_p | Saturated liquid internal energy |
uV_t | Saturated vapor internal energy |
uL_t | Saturated liquid internal energy |
u_pt | Specific internal energy as a function of pressure and temperature |
u_ph | Specific internal energy as a function of pressure and enthalpy |
u_ps | Specific internal energy as a function of pressure and entropy |
比等压热容
Function | Description |
---|
CpV_p | Saturated vapor heat capacity |
CpL_p | Saturated liquid heat capacity |
CpV_t | Saturated vapor heat capacity |
CpL_t | Saturated liquid heat capacity |
Cp_pt | Specific isobaric heat capacity as a function of pressure and temperature |
Cp_ph | Specific isobaric heat capacity as a function of pressure and enthalpy |
Cp_ps | Specific isobaric heat capacity as a function of pressure and entropy |
比等容热容
Function | Description |
---|
CvV_p | Saturated vapor isochoric heat capacity |
CvL_p | Saturated liquid isochoric heat capacity |
CvV_t | Saturated vapor isochoric heat capacity |
CvL_t | Saturated liquid isochoric heat capacity |
Cv_pt | Specific isochoric heat capacity as a function of pressure and temperature |
Cv_ph | Specific isochoric heat capacity as a function of pressure and enthalpy |
Cv_ps | Specific isochoric heat capacity as a function of pressure and entropy |
音速
Function | Description |
---|
wV_p | Saturated vapor speed of sound |
wL_p | Saturated liquid speed of sound |
wV_t | Saturated vapor speed of sound |
wL_t | Saturated liquid speed of sound |
w_pt | Speed of sound as a function of pressure and temperature |
w_ph | Speed of sound as a function of pressure and enthalpy |
w_ps | Speed of sound as a function of pressure and entropy |
粘度
Function | Description |
---|
my_pt | Viscosity as a function of pressure and temperature |
my_ph | Viscosity as a function of pressure and enthalpy |
my_ps | Viscosity as a function of pressure and entropy |
热导率
Function | Description |
---|
tcL_p | Saturated vapor thermal conductivity |
tcV_p | Saturated liquid thermal conductivity |
tcL_t | Saturated vapor thermal conductivity |
tcV_t | Saturated liquid thermal conductivity |
tc_pt | Thermal conductivity as a function of pressure and temperature |
tc_ph | Thermal conductivity as a function of pressure and enthalpy |
tc_hs | Thermal conductivity as a function of enthalpy and entropy |
表面张力
Function | Description |
---|
st_t | Surface tension for two phase water/steam as a function of T |
st_p | Surface tension for two phase water/steam as a function of p |
蒸汽分数
Function | Description |
---|
x_ph | vapor fraction as a function of pressure and enthalpy |
x_ps | vapor fraction as a function of pressure and entropy |
蒸汽体积分数
Function | Description |
---|
vx_ph | vapor volume fraction as a function of pressure and enthalpy |
vx_ps | vapor volume fraction as a function of pressure and entropy |
欢迎加入QQ群-->: 979659372
推荐PyPI第三方库