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

HumidAir wrong calculations #56

Open JB-AM opened 3 years ago

JB-AM commented 3 years ago

It seems HumidAir return grossly wrong calculations at temperatures under around 295K, 1atm. Please try:

import iapws.humidAir as ha
a = ha.HumidAir(T=295, P=0.101325, W=0.00858)
print(a.RH)

It should return around 50%, or 0.5, but prints -0.9678. It seems calculations at higher temperatures are right:

a = ha.HumidAir(T=323, P=0.101325, W=0.0388)
print(a.RH)

shows 0.5009.

jjgomera commented 3 years ago

Hi, i can't reproduce that

import iapws.humidAir as ha
a = ha.HumidAir(T=295, P=0.101325, W=0.00858)
print(a.RH)
0.597440017070571

and

a = ha.HumidAir(T=323, P=0.101325, W=0.0388)
print(a.RH)
0.5009937761563956

Maybe you're not using the last version, I'm fairly sure that error was fixed in this commit, https://github.com/jjgomera/iapws/commit/0a687f6b0bb8b89eac9da583961e03812dbd5a29

JB-AM commented 3 years ago

You’re right. I simply installed iapws from pip (pip install iapws), it seems the version there is not up to date. After installing from git, the value given seems reasonnable. But why I get :

>>> import iapws.humidAir as ha
>>> a = ha.HumidAir(T=295, P=0.101325, W=0.00858)
>>> print(a.RH)
0.5282298396607987

While you get : 0.597440017070571 which seems rather high, I do not know…