AttributeError: 'IAPWS97' object has no attribute 'T'
Closed this issue · 3 comments
116 P = [P0]*N
117 P_last = [0]*N
118 Tf = [T0]*N
119 x_last = 0
120 h = prop(P=P0/(10**6),T=T0).h*1000
121
122 for n in range(N-1):
123 while(P[n] - P_last[n] > tol):
124 P_last[n] = P[n]
125 if (Tf[n] <= prop(P=P[n]/(10**6),x=0).T):
126 x = 0
127 else:
128 x = Quality(h,P[n]/(10**6))
129 P[n+1] = Pressure(P[n]/(10**6),x,x_last,Tf[n])
130 h = enthalpy(n+1)
131 Tf[n+1] = prop(P=P[n+1]/(10**6),h=h).T
132 x_last = x
Earlier in the Code I have:
from iapws import IAPWS97 as prop
Hi, I'm trying to use IAPWS97 package, but it keeps giving me this attribute error function. Another person had a similar issue but the poblem here isn't being in the mixed region. When I used iapws on its own outside my code, it works fine in any region. But in my code (This is only a small portion) I get this attribute error with any property. Sorry about the formatting. I've never used Github before.
Be careful with enthalpy units as with pressure, I think you are using J/kg as h input in line 131 so the iapws97 class give out of bound error
prop(P=P[n+1]/(10**6),h=h).msg
That fixed it. You're my hero jj. Is there any documentation available to view the units used by the package?
See iapws documentation at readthedocs:
http://iapws.readthedocs.io/en/latest/iapws.iapws97.html#iapws.iapws97.IAPWS97