Dein erster Versuch war schon fast richtig, so sollte es gehn:
Code: Alles auswählen
op = []
op.append(operationData(humidAir, 0., GlysantinG48, 0.4))
tLiqIn = 50.
tAirIn = 20.
for i in range(len(op)):
op[i].setOperationData(1.,tAirIn, 0.05, tLiqIn)
co.setTurbulatorModel('shah')
co.setFinModel('junqiWengfeng')
co.calculateHeatTransfer('eNtu', op[i])
print co.Q, co.hA, op[i].tAirOut,op[i].tLiqOut
Was dann hier diskutiert wurde, war nicht Dein Fehler, sondern Stilfragen, das hier ist mehr Pythonic:
Code: Alles auswählen
op = []
op.append(operationData(humidAir, 0., GlysantinG48, 0.4))
tLiqIn = 50.
tAirIn = 20.
for opItem in op:
opItem.setOperationData(1.,tAirIn, 0.05, tLiqIn)
co.setTurbulatorModel('shah')
co.setFinModel('junqiWengfeng')
co.calculateHeatTransfer('eNtu', opItem)
print co.Q, co.hA, opItem.tAirOut,opItem.tLiqOut
Brauchst Du beides, guten Stil und die Zählvariable, dann geht das so
Code: Alles auswählen
op = []
op.append(operationData(humidAir, 0., GlysantinG48, 0.4))
tLiqIn = 50.
tAirIn = 20.
for i, opItem in enumerate(op):
opItem.setOperationData(1.,tAirIn, 0.05, tLiqIn)
co.setTurbulatorModel('shah')
co.setFinModel('junqiWengfeng')
co.calculateHeatTransfer('eNtu', opItem)
print i, co.Q, co.hA, opItem.tAirOut,opItem.tLiqOut