Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial guess of bisection loop of GetTWetBulbFromHumRatio leading to an error for high dry bulb temperatures and high humidity ratios #96

Open
hsallandt-arup opened this issue Feb 17, 2023 · 1 comment

Comments

@hsallandt-arup
Copy link

hsallandt-arup commented Feb 17, 2023

Describe the bug
Dry bulb temperature returned by GetTWetBulbFromHumRatio for high dry bulb temperatures and high humidity ratios.

To Reproduce
Steps to reproduce the behavior:
psychrolib.GetTWetBulbFromHumRatio(150, 1,101325)
returns 149.9995190883829

Expected behavior
The wet bulb temperature should not exceed 100°C at standard sea level pressure.

Additional context
The issue is created by the lines and following code. The bisection loop starts with the maximum theoretical wet bulb temperature (WBT) and minimum theoretical WBT as initial bounds.
Min WBT --> dew point
Max WBT --> dry bulb temperature
The latter is not correct (for dry bulb temperatures >100°C at this pressure), as at standard sea level pressure, the WBT cannot exceed ~100°C. The code then takes the average of the min and max WBT and starts the iteration. If the average of dew point and dry bulb temperature is higher than the maximum possible WBT at this pressure, this line returns 0 and therefore the error occurs:
error

A solution would be to set initially the max WBT to the minimum of the dry bulb temperature and the boiling temperature of water at the given pressure.

@didierthevenard
Copy link
Contributor

Thanks for that, definitely a but. Actually, any calculation with dry bulb temperature > 100 C and relative humidity above a certain level leads to values that don't make sense.
We are due to fix a few other bugs soon and we'll add that one to the list. I think the fix you suggest will work but we'll confirm with more tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants