pyxsteam是magnus holmgren的matlab/excel包xsteam的一个端口,www.x-eng.com到python 3

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是温度与压力和焓的函数。一份清单 有效功能如下:

PropertyDescription
tTemperature (°C or °F)
pPressure (bar or psi)
hEnthalpy (kJ/kg or btu/lb)
vSpecific volume (m3/kg or ft^3/lb)
rhoDensity (kg/m3 or lb/ft^3)
sSpecific entropy (kJ/(kg °C) or btu/(lb °F))
uSpecific internal energy (kJ/kg or btu/lb)
CpSpecific isobaric heat capacity (kJ/(kg °C) or btu/(lb °F))
CvSpecific isochoric heat capacity (kJ/(kg °C) or btu/(lb °F))
wSpeed of sound (m/s or ft/s)
myViscosity (N s/m^2 or lbm/ft/hr)
tcThermal Conductivity (W/(m °C) or btu/(h ft °F))
stSurface Tension (N/m or lb/ft)
xVapor fraction
vxVapor 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)

可用功能

温度

FunctionDescription
tsat_pSaturation temperature
t_phTemperature as a function of pressure and enthalpy
t_psTemperature as a function of pressure and entropy
t_hsTemperature as a function of enthalpy and entropy

压力

FunctionDescription
psat_tSaturation pressure
p_hsPressure as a function of h and s.
p_hrhoPressure as a function of h and rho. Very inaccurate for solid water region since it's almost incompressible!

FunctionDescription
hV_pSaturated vapor enthalpy
hL_pSaturated liquid enthalpy
hV_tSaturated vapor enthalpy
hL_tSaturated liquid enthalpy
h_ptEnthalpy as a function of pressure and temperature
h_psEnthalpy as a function of pressure and entropy
h_pxEnthalpy as a function of pressure and vapor fraction
h_prhoEnthalpy as a function of pressure and density. Observe for low temperatures (liquid) this equation has 2 solutions
h_txEnthalpy as a function of temperature and vapor fraction

比体积

FunctionDescription
vV_pSaturated vapor volume
vL_pSaturated liquid volume
vV_tSaturated vapor volume
vL_tSaturated liquid volume
v_ptSpecific volume as a function of pressure and temperature
v_phSpecific volume as a function of pressure and enthalpy
v_psSpecific volume as a function of pressure and entropy

密度

FunctionDescription
rhoV_pSaturated vapor density
rhoL_pSaturated liquid density
rhoV_tSaturated vapor density
rhoL_tSaturated liquid density
rho_ptDensity as a function of pressure and temperature
rho_phDensity as a function of pressure and enthalpy
rho_psDensity as a function of pressure and entropy

比熵

FunctionDescription
sV_pSaturated vapor entropy
sL_pSaturated liquid entropy
sV_tSaturated vapor entropy
sL_tSaturated liquid entropy
s_ptSpecific entropy as a function of pressure and temperature (Returns saturated vapor enthalpy if mixture)
s_phSpecific entropy as a function of pressure and enthalpy

比内能

FunctionDescription
uV_pSaturated vapor internal energy
uL_pSaturated liquid internal energy
uV_tSaturated vapor internal energy
uL_tSaturated liquid internal energy
u_ptSpecific internal energy as a function of pressure and temperature
u_phSpecific internal energy as a function of pressure and enthalpy
u_psSpecific internal energy as a function of pressure and entropy

比等压热容

FunctionDescription
CpV_pSaturated vapor heat capacity
CpL_pSaturated liquid heat capacity
CpV_tSaturated vapor heat capacity
CpL_tSaturated liquid heat capacity
Cp_ptSpecific isobaric heat capacity as a function of pressure and temperature
Cp_phSpecific isobaric heat capacity as a function of pressure and enthalpy
Cp_psSpecific isobaric heat capacity as a function of pressure and entropy

比等容热容

FunctionDescription
CvV_pSaturated vapor isochoric heat capacity
CvL_pSaturated liquid isochoric heat capacity
CvV_tSaturated vapor isochoric heat capacity
CvL_tSaturated liquid isochoric heat capacity
Cv_ptSpecific isochoric heat capacity as a function of pressure and temperature
Cv_phSpecific isochoric heat capacity as a function of pressure and enthalpy
Cv_psSpecific isochoric heat capacity as a function of pressure and entropy

音速

FunctionDescription
wV_pSaturated vapor speed of sound
wL_pSaturated liquid speed of sound
wV_tSaturated vapor speed of sound
wL_tSaturated liquid speed of sound
w_ptSpeed of sound as a function of pressure and temperature
w_phSpeed of sound as a function of pressure and enthalpy
w_psSpeed of sound as a function of pressure and entropy

粘度

FunctionDescription
my_ptViscosity as a function of pressure and temperature
my_phViscosity as a function of pressure and enthalpy
my_psViscosity as a function of pressure and entropy

热导率

FunctionDescription
tcL_pSaturated vapor thermal conductivity
tcV_pSaturated liquid thermal conductivity
tcL_tSaturated vapor thermal conductivity
tcV_tSaturated liquid thermal conductivity
tc_ptThermal conductivity as a function of pressure and temperature
tc_phThermal conductivity as a function of pressure and enthalpy
tc_hsThermal conductivity as a function of enthalpy and entropy

表面张力

FunctionDescription
st_tSurface tension for two phase water/steam as a function of T
st_pSurface tension for two phase water/steam as a function of p

蒸汽分数

FunctionDescription
x_phvapor fraction as a function of pressure and enthalpy
x_psvapor fraction as a function of pressure and entropy

蒸汽体积分数

FunctionDescription
vx_phvapor volume fraction as a function of pressure and enthalpy
vx_psvapor volume fraction as a function of pressure and entropy

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java JBPM:无法部署进程存档:null   java将一个数组拆分为两个大小相等的数组   java Spring boot验证该字段是否为string类型   JAVA JPA保存到TSV而不是SQL   java PMD报告超过X个违规   java是否支持springdatagremlin中的自定义查询?   java在“for”循环后使用变量   JPQL中默认查询中的java错误列   如何在java中实现不同于线程的进程?   java如何检查字符串是否平衡?   xml使用xalan扩展在XSL中处理java集合   java我试图使用子类/超类重写另一个类的值   转换为JSON时出现java堆栈溢出问题   java考虑定义一个类型为“COM”的bean。实例演示。在您的配置中命令$DefaultIO   java在kubernetes中如何检索转发端口的值?   JavaEclipse,动态web项目,向类路径添加另一个eclipse项目   eclipse的java Spring上下文XML验证器?   Linux下利用MATLAB(Windows)生成Java包   Java:在存储到DDC之前验证属性   java校验字符串