jjgomera / iapws

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

HumidAir Pv undocumented #58

Open schymans opened 2 years ago

schymans commented 2 years ago

Not sure if I understand the HumidAir routine correctly, but to calculate saturation vapour pressure at given temperature and pressure, I do this:

import iapws
HA = iapws.HumidAir
Pa1 = 0.101325  # MPa
T1 = 298.  # K
humid_air = HA(T=T1,P=Pa1, A=HA()._eq(T1, Pa1))
sat_vap_p = humid_air.Pv

Is this the intended use? The meaning of Pv is not documented in the docstring of HumidAir, but it seems to give the saturation vapour pressure in this case. Would it be possible to allow passing RH=1. to HumidAir instead of A=HA()._eq(T1, Pa1)? Or did I misunderstand something?

ellieLitwack commented 2 years ago

According to the documentation it's the vapor pressure, not the saturation vapor pressure. I double checked this by comparing the source code to IAPWS G8-10 page 16 and I can confirm that it's giving the saturation vapor pressure.

If you want to get an HR value from an RH value to give to the HA object, I recommend using pyschrolib. It's got the reverse equations already programmed in for getting HR from RH.