本文整理汇总了Python中CoolProp.CoolProp.enable_TTSE_LUT方法的典型用法代码示例。如果您正苦于以下问题:Python CoolProp.enable_TTSE_LUT方法的具体用法?Python CoolProp.enable_TTSE_LUT怎么用?Python CoolProp.enable_TTSE_LUT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CoolProp.CoolProp
的用法示例。
在下文中一共展示了CoolProp.enable_TTSE_LUT方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import enable_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 enable_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: compareProperty
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import enable_TTSE_LUT [as 别名]
def compareProperty(fluid="",p=0,what=""):
global c_diff, c_unit, c_exce
if p==0:
p = 0.75*CP.Props(fluid,"pcrit")
Delta_T = 50
T_bub = CP.Props("T","P",p,"Q",0,fluid)
T_dew = CP.Props("T","P",p,"Q",1,fluid)
h_bub = CP.Props("H","P",p,"Q",0,fluid)
h_dew = CP.Props("H","P",p,"Q",1,fluid)
T_1 = T_bub-Delta_T
if T_1 < CP.Props(fluid,"Tmin"):
T_1 = CP.Props(fluid,"Tmin")+0.5*(T_bub-CP.Props(fluid,"Tmin"))
T_2 = T_dew+Delta_T
h_1 = CP.Props("H","P",p,"T",T_1,fluid)
h_2 = CP.Props("H","P",p,"T",T_2,fluid)
h_liq = numpy.linspace(h_1,h_bub,num=100)
h_vap = numpy.linspace(h_dew,h_2,num=100)
T_liq = CP.Props("T","P",p,"H",h_liq,fluid)-T_bub
T_vap = CP.Props("T","P",p,"H",h_vap,fluid)-T_dew
X_liq_STDV = CP.Props(what,"P",p,"H",h_liq,fluid)
X_vap_STDV = CP.Props(what,"P",p,"H",h_vap,fluid)
CP.enable_TTSE_LUT(fluid)
X_liq_TTSE = CP.Props(what,"P",p,"H",h_liq,fluid)
X_vap_TTSE = CP.Props(what,"P",p,"H",h_vap,fluid)
if numpy.max([X_liq_STDV/X_liq_TTSE,X_vap_STDV/X_vap_TTSE])>1.25 or numpy.min([X_liq_STDV/X_liq_TTSE,X_vap_STDV/X_vap_TTSE])<0.75:
c_diff += 1
print("")
print("There were problems with "+what+" for "+fluid)
print("Relative difference liquid: "+str(numpy.mean((X_liq_STDV-X_liq_TTSE)/X_liq_STDV)))
print("Relative difference vapour: "+str(numpy.mean((X_vap_STDV-X_vap_TTSE)/X_vap_STDV)))
print("Average factor liquid: "+str(numpy.mean(X_liq_STDV/X_liq_TTSE)))
print("Average factor vapour: "+str(numpy.mean(X_vap_STDV/X_vap_TTSE)))
示例4: check_Trho
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import enable_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
示例5: getErrors
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import enable_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
示例6:
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import enable_TTSE_LUT [as 别名]
import CoolProp.CoolProp as CP
fluid = 'Propane'
print CP.enable_TTSE_LUT(fluid)
print CP.isenabled_TTSE_LUT(fluid)
print CP.Props('H','P',300,'Q',0,fluid)
print CP.Props('H','P',310,'Q',0,fluid)
print CP.Props('H','P',315,'Q',0,fluid)
#
fluid = 'TestSolution-0.3'
print CP.enable_TTSE_LUT(fluid)
print CP.isenabled_TTSE_LUT(fluid)
print CP.Props('H','P',3000,'T',280,fluid)
示例7: Compressor
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import enable_TTSE_LUT [as 别名]
def Compressor(Te = 273, Tc = 300, f = None,TTSE = False, OneCycle = False):
if TTSE:
CP.set_TTSESinglePhase_LUT_size("Propane", 500, 500)
CP.enable_TTSE_LUT('Propane')
global Injection
ScrollComp=Scroll()
#This runs if the module code is run directly
ScrollComp.set_scroll_geo(83e-6, 3.3, 0.005, 0.006) #Set the scroll wrap geometry
ScrollComp.set_disc_geo('2Arc',r2 = 0)
ScrollComp.geo.delta_flank = 10e-6
ScrollComp.geo.delta_radial = 10e-6
ScrollComp.geo.delta_suction_offset = 0.0e-3
ScrollComp.geo.phi_ie_offset = 0.0
ScrollComp.omega = 3000/60*2*pi
ScrollComp.Tamb = 298.0
#Temporarily set the bearing dimensions
ScrollComp.mech = struct()
ScrollComp.mech.D_upper_bearing = 0.04
ScrollComp.mech.L_upper_bearing = 0.04
ScrollComp.mech.c_upper_bearing = 20e-6
ScrollComp.mech.D_crank_bearing = 0.04
ScrollComp.mech.L_crank_bearing = 0.04
ScrollComp.mech.c_crank_bearing = 20e-6
ScrollComp.mech.D_lower_bearing = 0.025
ScrollComp.mech.L_lower_bearing = 0.025
ScrollComp.mech.c_lower_bearing = 20e-6
ScrollComp.mech.thrust_ID = 0.05
ScrollComp.mech.thrust_friction_coefficient = 0.028 #From Chen thesis
ScrollComp.mech.orbiting_scroll_mass = 2.5
ScrollComp.mech.L_ratio_bearings = 3
ScrollComp.mech.mu_oil = 0.008
ScrollComp.h_shell = 0.02
ScrollComp.A_shell = 0.05
ScrollComp.HTC = 1.0
ScrollComp.motor = Motor()
ScrollComp.motor.set_eta(0.9)
ScrollComp.motor.suction_fraction = 1.0
Ref = 'Propane'
#Ref = 'REFPROP-MIX:R410A.mix'
Te = -20 + 273.15
Tc = 20 + 273.15
Tin = Te + 11.1
DT_sc = 7
pe = CP.PropsSI('P','T',Te,'Q',1.0,Ref)/1000.0
pc = CP.PropsSI('P','T',Tc,'Q',1.0,Ref)/1000.0
inletState = State.State(Ref,{'T':Tin,'P':pe})
T2s = ScrollComp.guess_outlet_temp(inletState,pc)
outletState = State.State(Ref,{'T':T2s,'P':pc})
mdot_guess = inletState.rho*ScrollComp.Vdisp*ScrollComp.omega/(2*pi)
ScrollComp.add_tube(Tube(key1='inlet.1',
key2='inlet.2',
L=0.3,
ID=0.02,
mdot=mdot_guess,
State1=inletState.copy(),
fixed=1,
TubeFcn=ScrollComp.TubeCode))
ScrollComp.add_tube(Tube(key1='outlet.1',
key2='outlet.2',
L=0.3,
ID=0.02,
mdot=mdot_guess,
State2=outletState.copy(),
fixed=2,
TubeFcn=ScrollComp.TubeCode))
ScrollComp.auto_add_CVs(inletState, outletState)
ScrollComp.auto_add_leakage(flankFunc = ScrollComp.FlankLeakage,
radialFunc = ScrollComp.RadialLeakage)
FP = FlowPath(key1='inlet.2',
key2='sa',
MdotFcn=IsentropicNozzleWrapper(),
)
FP.A = pi*0.01**2/4
ScrollComp.add_flow(FP)
ScrollComp.add_flow(FlowPath(key1='sa',
key2='s1',
MdotFcn=ScrollComp.SA_S1,
MdotFcn_kwargs = dict(X_d = 0.7)
)
)
ScrollComp.add_flow(FlowPath(key1 = 'sa',
key2 = 's2',
MdotFcn = ScrollComp.SA_S2,
MdotFcn_kwargs = dict(X_d = 0.7)
)
#.........这里部分代码省略.........
示例8: print
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import enable_TTSE_LUT [as 别名]
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.enable_TTSE_LUT('Propane')
print(' ')
print('************ USING TTSE ***************')
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')
示例9: range
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import enable_TTSE_LUT [as 别名]
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)
TBICUBIC = CP.Props("T", "P", p, "H", h, Ref)
## cpBICUBIC = CP.Props('C','P',p,'H',h,Ref)
## errorTTSE = abs(TTTSE/TEOS-1)*100
## errorBICUBIC = abs(TBICUBIC/TEOS-1)*100
errorTTSE = abs(rhoTTSE / rhoEOS - 1) * 100
示例10: getlim
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import enable_TTSE_LUT [as 别名]
return fig, ax, Z
def getlim(key,dicts,fac=1):
min = np.min([ dict[key]/fac for dict in dicts ])
max = np.max([ dict[key]/fac for dict in dicts ])
return [np.floor(min)*fac, np.ceil(max)*fac]
#########################################################################
# Here starts the real script
#########################################################################
fluid = 'water'
CP.enable_TTSE_LUT(fluid)
PRINT = False
if PRINT:
points = 200
dpi = 300
toFile = True
else:
points = 100
dpi = 75
toFile = False
Tmin = CP.PropsSI('Tmin' ,'T',0,'P',0,fluid) + 5.0
Tcri = CP.PropsSI('Tcrit','T',0,'P',0,fluid)
示例11: print
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import enable_TTSE_LUT [as 别名]
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.enable_TTSE_LUT("Propane")
print(" ")
print("************ USING TTSE ***************")
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)")
示例12: print
# 需要导入模块: from CoolProp import CoolProp [as 别名]
# 或者: from CoolProp.CoolProp import enable_TTSE_LUT [as 别名]
import CoolProp.CoolProp as CP
fluid = 'Propane'
print(CP.enable_TTSE_LUT(fluid))
print(CP.isenabled_TTSE_LUT(fluid))
print(CP.Props('H','P',300,'Q',0,fluid))
print(CP.Props('H','P',310,'Q',0,fluid))
print(CP.Props('H','P',315,'Q',0,fluid))
#
fluid = 'TestSolution-0.3'
print(CP.enable_TTSE_LUT(fluid))
print(CP.isenabled_TTSE_LUT(fluid))
print(CP.Props('H','P',3000,'T',280,fluid))