psychrometrics / psychrolib

📚 Library of psychrometric functions to calculate 🌡️ thermodynamic properties of air for Python, C, C#, Fortran, R, JavaScript and VBA/Excel
MIT License
228 stars 61 forks source link

Calculations of wet bulb when dry bulb above 100 C converge to unreasonable value #31

Open dmey opened 5 years ago

dmey commented 5 years ago

The calculations of wet bulb when dry bulb when above 100 C are not handled properly. The convergence tests implemented (test_GetTDewPointFromVapPres_convergence) converge to unreasonable values when hen above 100 C. For example GetTWetBulbFromRelHum(TDryBulb, RelHum, Pressure) with TDryBulb = 25, RelHum = 1 and Pressure = 101325. As expected the function returns 25 (when the air is saturated, wet bulb = dew point = dry bulb). With TDryBulb = 99 it returns 99.. When called with TDryBulb = 101 it returns 43.

dmey commented 4 years ago

@didierthevenard we may want to revisit this at the next release -- do you have any thoughts?

dvd101x commented 2 years ago

Hi, I'm sorry this is a bit off topic but maybe it's useful for review:

I'm testing two libraries in javascript: coolprop for thermodynamics and mathjs for units and other math stuff. When testing HAprops('DewPoint', { 'Tdb': 25 degC, 'P': 1 atm, 'RelHum': 100 % }) to degC The results is: 25.000000000064 degC

You can benchmark here if you would like: https://github.com/dvd101x/CoolPropJavascriptDemo

PHCEAC commented 1 year ago

I apologise if this is completely obvious, but it seems that GetTWetBulbFromRelHum should be evaluating Psat * RelHum at the very beginning, and verifying that it is not larger than than the actual value of Pressure, which would indicate supersaturation, and therefore "unphysical" in the world of psychrolib. If not obvious, did I misunderstand something?