本文整理汇总了Python中CoolProp.CoolProp.disable_TTSE_LUT方法的典型用法代码示例。如果您正苦于以下问题:Python CoolProp.disable_TTSE_LUT方法的具体用法?Python CoolProp.disable_TTSE_LUT怎么用?Python CoolProp.disable_TTSE_LUT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CoolProp.CoolProp
的用法示例。
在下文中一共展示了CoolProp.disable_TTSE_LUT方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import disable_TTSE_LUT [as 别名]
def check(N=5000,param='D',fluid = 'R245fa'):
values = []
CP.enable_TTSE_LUT(fluid)
try:
CP.Props('D','P',CP.Props(fluid,'ptriple')+1,'Q',1,fluid)
except:
return []
#CP.set_TTSESinglePhase_LUT_size(fluid,500,500)
hmin,hmax,pmin,pmax = CP.get_TTSESinglePhase_LUT_range(fluid)
for i in range(N):
x1 = random.random()
h = x1*hmin+(1-x1)*hmax
x2 = random.random()
logp = x2*log(pmin)+(1-x2)*log(pmax)
p = exp(logp)
try:
CP.enable_TTSE_LUT(fluid)
value_withTTSE = CP.Props(param,'P',p,'H',h,fluid)
CP.disable_TTSE_LUT(fluid)
value_noTTSE = CP.Props(param,'P',p,'H',h,fluid)
values.append((h,p,value_withTTSE,value_noTTSE))
except ValueError:
pass
return values
示例2: check_Pother
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import disable_TTSE_LUT [as 别名]
def check_Pother(N=5000,param='T',other='S',fluid='R245fa'):
values = []
CP.enable_TTSE_LUT(fluid)
try:
CP.Props('D','P',CP.Props(fluid,'ptriple')+1,'Q',1,fluid)
except:
return []
#CP.set_TTSESinglePhase_LUT_size(fluid,500,500)
hmin,hmax,pmin,pmax = CP.get_TTSESinglePhase_LUT_range(fluid)
for i in range(N):
x1 = random.random()
h = x1*hmin+(1-x1)*hmax
x2 = random.random()
logp = x2*log(pmin)+(1-x2)*log(pmax)
p = exp(logp)
try:
try:
#Get the T,rho from the EOS directly without the LUT
CP.disable_TTSE_LUT(fluid)
s = CP.Props('S','P',p,'H',h,fluid)
T = CP.Props('T','P',p,'H',h,fluid)
rho = CP.Props('D','P',p,'H',h,fluid)
except:
print 'EOS failed: ', p,h
raise
#Now get p,h from the T,rho
CP.enable_TTSE_LUT(fluid)
if other =='S':
other_val = s
elif other =='T':
other_val = T
elif other == 'D':
other_val = rho
else:
raise ValueError
val = CP.Props(param,'P',p,other,other_val,fluid)
except ValueError:
print 'TTSE failed: ', p,other_val
values.append((p,other_val,0,0))
pass
return values
示例3: check_Trho
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import disable_TTSE_LUT [as 别名]
def check_Trho(N=5000,param='P',fluid='R245fa'):
values = []
CP.enable_TTSE_LUT(fluid)
try:
CP.Props('D','P',CP.Props(fluid,'ptriple')+1,'Q',1,fluid)
except:
return []
#CP.set_TTSESinglePhase_LUT_size(fluid,500,500)
hmin,hmax,pmin,pmax = CP.get_TTSESinglePhase_LUT_range(fluid)
for i in range(N):
x1 = random.random()
h = x1*hmin+(1-x1)*hmax
x2 = random.random()
logp = x2*log(pmin)+(1-x2)*log(pmax)
p = exp(logp)
try:
try:
#Get the T,rho from the EOS directly without the LUT
CP.disable_TTSE_LUT(fluid)
s = CP.Props('S','P',p,'H',h,fluid)
T = CP.Props('T','P',p,'H',h,fluid)
rho = CP.Props('D','P',p,'H',h,fluid)
except:
print 'EOS failed: ', p,h
raise
#Now get p,h from the T,rho
CP.enable_TTSE_LUT(fluid)
val = CP.Props(param,'T',T,'D',rho,fluid)
CP.disable_TTSE_LUT(fluid)
valREFPROP = CP.Props(param,'T',T,'D',rho,fluid)
#print T,rho,val,valREFPROP,(val/valREFPROP-1)*100
if abs(val-valREFPROP)>0.00001:
raise ValueError
except ValueError:
print 'TTSE failed: ', T,rho
values.append((T,rho,0,0))
pass
return values
示例4: getErrors
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import disable_TTSE_LUT [as 别名]
def getErrors(p, h, out="D", Ref=""):
"Get the relative errors from table-based interpolation"
errorTTSE = 1e3
errorBICUBIC = 1e3
try:
# Using the EOS
CP.disable_TTSE_LUT(Ref)
EOS = CP.PropsSI(out, "P", p, "H", h, Ref)
# Using the TTSE method
CP.enable_TTSE_LUT(Ref)
CP.set_TTSE_mode(Ref, "TTSE")
TTSE = CP.PropsSI(out, "P", p, "H", h, Ref)
# Using the Bicubic method
CP.enable_TTSE_LUT(Ref)
CP.set_TTSE_mode(Ref, "BICUBIC")
BICUBIC = CP.PropsSI(out, "P", p, "H", h, Ref)
errorTTSE = abs(TTSE / EOS - 1.0) * 100.0
errorBICUBIC = abs(BICUBIC / EOS - 1.0) * 100.0
except ValueError as VE:
print VE
pass
return errorTTSE, errorBICUBIC
示例5: print
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import disable_TTSE_LUT [as 别名]
print('Density of saturated vapor R290 at 101.325 kPa:',
CP.Props('D', 'P', 101.325, 'Q', 1, 'R290'), 'kg/m^3')
print('TWO PHASE INPUTS (Temperature)')
print('Density of saturated liquid Propane at 300 K:',
CP.Props('D', 'T', 300, 'Q', 0, 'Propane'), 'kg/m^3')
print('Density of saturated vapor R290 at 300 K:',
CP.Props('D', 'T', 300, 'Q', 1, 'R290'), 'kg/m^3')
p = CP.Props('P', 'T', 300, 'D', 1, 'Propane')
h = CP.Props('H', 'T', 300, 'D', 1, 'Propane')
T = CP.Props('T', 'P', p, 'H', h, 'Propane')
D = CP.Props('D', 'P', p, 'H', h, 'Propane')
print('SINGLE PHASE CYCLE (propane)')
print('T,D -> P,H', 300, ',', 1, '-->', p, ',', h)
print('P,H -> T,D', p, ',', h, '-->', T, ',', D)
CP.disable_TTSE_LUT('Propane')
try:
print(' ')
print('************ USING REFPROP ***************')
print(' ')
print('TWO PHASE INPUTS (Pressure)')
print('Density of saturated liquid Propane at 101.325 kPa:',
CP.Props('D', 'P', 101.325, 'Q', 0, 'REFPROP-Propane'), 'kg/m^3')
print('Density of saturated vapor Propane at 101.325 kPa:',
CP.Props('D', 'P', 101.325, 'Q', 1, 'REFPROP-propane'), 'kg/m^3')
print('TWO PHASE INPUTS (Temperature)')
print('Density of saturated liquid Propane at 300 K:',
CP.Props('D', 'T', 300, 'Q', 0, 'REFPROP-propane'), 'kg/m^3')
print('Density of saturated vapor Propane at 300 K:',
CP.Props('D', 'T', 300, 'Q', 1, 'REFPROP-propane'), 'kg/m^3')
示例6: range
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import disable_TTSE_LUT [as 别名]
hV = CP.Props("H", "T", T, "Q", 1, Ref)
HHH1, PPP1, EEE1 = [], [], []
HHH2, PPP2, EEE2 = [], [], []
cNorm = colors.LogNorm(vmin=1e-12, vmax=10)
scalarMap = cmx.ScalarMappable(norm=cNorm, cmap=plt.get_cmap("jet"))
for a_useless_counter in range(40000):
h = random.uniform(100, 590)
p = 10 ** random.uniform(np.log10(100), np.log10(7000))
try:
# Using the EOS
CP.disable_TTSE_LUT(Ref)
rhoEOS = CP.Props("D", "P", p, "H", h, Ref)
TEOS = CP.Props("T", "P", p, "H", h, Ref)
## cpEOS = CP.Props('C','P',p,'H',h,Ref)
# Using the TTSE method
CP.enable_TTSE_LUT(Ref)
CP.set_TTSE_mode(Ref, "TTSE")
rhoTTSE = CP.Props("D", "P", p, "H", h, Ref)
TTTSE = CP.Props("T", "P", p, "H", h, Ref)
## cpTTSE = CP.Props('C','P',p,'H',h,Ref)
# Using the Bicubic method
CP.enable_TTSE_LUT(Ref)
CP.set_TTSE_mode(Ref, "BICUBIC")
rhoBICUBIC = CP.Props("D", "P", p, "H", h, Ref)
示例7: print
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import disable_TTSE_LUT [as 别名]
print(" ")
print("TWO PHASE INPUTS (Pressure)")
print("Density of saturated liquid Propane at 101.325 kPa:", CP.Props("D", "P", 101.325, "Q", 0, "Propane"), "kg/m^3")
print("Density of saturated vapor R290 at 101.325 kPa:", CP.Props("D", "P", 101.325, "Q", 1, "R290"), "kg/m^3")
print("TWO PHASE INPUTS (Temperature)")
print("Density of saturated liquid Propane at 300 K:", CP.Props("D", "T", 300, "Q", 0, "Propane"), "kg/m^3")
print("Density of saturated vapor R290 at 300 K:", CP.Props("D", "T", 300, "Q", 1, "R290"), "kg/m^3")
p = CP.Props("P", "T", 300, "D", 1, "Propane")
h = CP.Props("H", "T", 300, "D", 1, "Propane")
T = CP.Props("T", "P", p, "H", h, "Propane")
D = CP.Props("D", "P", p, "H", h, "Propane")
print("SINGLE PHASE CYCLE (propane)")
print("T,D -> P,H", 300, ",", 1, "-->", p, ",", h)
print("P,H -> T,D", p, ",", h, "-->", T, ",", D)
CP.disable_TTSE_LUT("Propane")
try:
print(" ")
print("************ USING REFPROP ***************")
print(" ")
print("TWO PHASE INPUTS (Pressure)")
print(
"Density of saturated liquid Propane at 101.325 kPa:",
CP.Props("D", "P", 101.325, "Q", 0, "REFPROP-Propane"),
"kg/m^3",
)
print(
"Density of saturated vapor Propane at 101.325 kPa:",
CP.Props("D", "P", 101.325, "Q", 1, "REFPROP-propane"),
"kg/m^3",