这是我的脚本。我想列出所有" e_p"和" e_f"我的for循环元素,但e_f以某种方式成为一个元组和我的" liste2"只是由最后一个" e_p"由我的for循环给出的值。谢谢你的帮助
import rty as cpt
import numpy as np
import CoolProp.CoolProp as cp
competition=cpt.rty()
import enthalpies as ent
import meteo as met
Ti = [competition.temp_liquide]
T_ext = [met.temp_journee,met.temp_max,met.temp_journee]
Teb = cp.PropsSI("T","P",met.press_journee,"H",0,ent.substance) - 273.15
def energie_perdue(T_liquide,T_air,P,force_vent):
v_vent = (force_vent*2) + 2
e_perdue_conv = ((10.45*v_vent)+(10*np.sqrt(v_vent)))*np.pi*(7.98/2)**2*np.abs(T_liquide-T_air)*8*3600
return e_perdue_conv
def energie_fournie(T,P):
Teb = cp.PropsSI("T","P",P,"H",0,ent.substance)
Cap = cp.PropsSI("C","T",298.15,"P",P,ent.substance)
rho = cp.PropsSI("D","T",273.15+T,"P",P, ent.substance)
V = 2*np.pi*(7.98/2)**2
m = rho*V
e_fournie = m*Cap*(Teb-273.15-T)
return e_fournie, m, Cap
for i in range (0,3):
e_f = energie_fournie(Ti[i],met.press_journee)
liste1 = []
liste1.append(e_f)
e_p = energie_perdue(Ti[i],T_ext[i],met.press_journee,0)
liste2 = []
liste2.append(e_p)
dif_e = e_f[0] - e_p
dif_T = dif_e/(e_f[1]*e_f[2])
Tf = Ti[i] + dif_T
Ti.append(Tf)
P.S enthalpies和meteo是我在其他脚本中编写的脚本 非常感谢