本文整理汇总了Python中CoolProp.CoolProp.get_CAS_code方法的典型用法代码示例。如果您正苦于以下问题:Python CoolProp.get_CAS_code方法的具体用法?Python CoolProp.get_CAS_code怎么用?Python CoolProp.get_CAS_code使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CoolProp.CoolProp
的用法示例。
在下文中一共展示了CoolProp.get_CAS_code方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: params_table
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import get_CAS_code [as 别名]
def params_table(Fluid):
params = dict(mm = CP.Props(Fluid,'molemass'),
Tt = CP.Props(Fluid,'Ttriple'),
pt = CP.Props(Fluid,'ptriple'),
Tmin = CP.Props(Fluid,'Tmin'),
CAS = CP.get_CAS_code(Fluid),
ASHRAE = CP.get_ASHRAE34(Fluid)
)
return textwrap.dedent(
"""
Fluid Data
==========
Fluid Parameters
========================= ==============================
Mole Mass [kg/kmol] {mm:0.5f}
Triple Point Temp. [K] {Tt:0.3f}
Triple Point Press. [kPa] {pt:0.10g}
Minimum temperature [K] {Tmin:0.3f}
CAS number {CAS:s}
ASHRAE classification {ASHRAE:s}
========================= ==============================
""".format(**params))
示例2: open
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import get_CAS_code [as 别名]
# -*- coding: utf-8 -*-
"""
Created on Fri May 31 09:21:27 2013
@author: Belli
"""
import CoolProp.CoolProp as CP
import CoolProp
for fluid in CoolProp.__fluids__:
try:
lines = open('C:\\Program Files (x86)\\REFPROP\\fluids\\' + CP.get_REFPROPname(fluid) + '.fld','r').readlines()
for line in lines:
if line.find('CAS number') > -1:
CAS_number = line.split('!')[0].strip()
break
if not CP.get_CAS_code(fluid) == CAS_number:
print fluid, CP.get_CAS_code(fluid), CAS_number
else:
print 'CAS_number is ok for',fluid
except IOError:
pass#print "didn't find",fluid