jjgomera / iapws

python libray for IAPWS standard calculation of water and steam properties
GNU General Public License v3.0
170 stars 64 forks source link

Entropy and Energy at tripple point of water #51

Closed mnijh closed 4 years ago

mnijh commented 4 years ago

Since the IAPWS-documents define that the entropy and energy at the tripple point (t=273.160 K , p= 611.657) are by definition zero, is there a way to fix that also in your implementation?

When I run the following small script

from iapws import IAPWS95
from iapws import _Ice

p0 = 101325. # Pa
t0 = 1. # can not pass zero K
pt = 611.657 # Pa
tt = 273.160 # K
ice_1h_ref1 = _Ice(P=p0*1E-6, T=t0)
ice_1h_ref2 = _Ice(P=pt*1E-6, T=tt)
liq_ref2 = IAPWS95(P=pt*1E-6, T=tt)
print('s',ice_1h_ref1['s'],ice_1h_ref2['s'],liq_ref2.s)
print('u',ice_1h_ref1['u'],ice_1h_ref2['u'],liq_ref2.u)
print('g',ice_1h_ref1['g'],ice_1h_ref2['g'],liq_ref2.g)

I get as a result

s -3.3273345133447987 -1.2206943393968697 9.155491719295108
u -632.1287397782819 -333.444921196524 2374.9196737638176
g -628.6928965324292 0.0006117841346053865 0.0010709336770560185

Thanks

mnijh commented 4 years ago

I just realized that this might be a problem of the formulation of Feistel & Wagner. Given the values they provide in Table 6 of www.iapws.org/relguide/Ice-Rev2009.pdf...

jjgomera commented 4 years ago

Hi, IAPWS95 formulation define the reference state as the saturated liquid at triple point temperature, but P and T can't used as input pair parameters in the two phase region, because only one is fixed, at triple temperature the liquid was at triple pressure, but the saturated vapor are too at these conditions..., in two phase region the correct input pair is with vapor quality, T-x or P-x

In [1]: from iapws import IAPWS95
In [2]: st = IAPWS95(T=273.16, x=0)

In [3]: st.u
Out[3]: -4.209567262911801e-10

In [4]: st.s
Out[4]: -7.001269159090048e-13

In [26]: st.P*1e6
Out[26]: 611.6547710069695

this is the triple pointe temperature from equation, the other value is the experimental value. About ice the values are the expected in triple point, check the table 6 in iapws ice paper but I don't know the expected value at 0 K and triple point pressure