-
Notifications
You must be signed in to change notification settings - Fork 62
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
GetTWetBulbFromHumRatio does not expected results #20
Comments
I don't believe this to be a bug, but rather result from the use of different formulae in the respective codes. In PsychroLib: In function GetHumRatioFromTWetBulb: In EnergyPlus: Wstar=0.62198d0*PSatstar/(Patm-PSatstar) ! Calculate new humidity ratio and determine difference from known The coefficients in PsychroLib are those used in the ASHRAE Handbook - Fundamentals over the past few editions. The coefficients in EnergyPlus are those found in Engineering Thermodynamics: SI Edition I don't know if one set of coefficients is more accurate than the other, in any case PsychroLib is implementing ASHRAE and in that respect is probably if not correct, at least consistent. |
Further comments on this issue. The equations used by ASHRAE have changed over the years, for example the equation for enthalpy in the 2001 Handbook (which you can find here: http://www.ce.utexas.edu/prof/Novoselac/classes/ARE383/Handouts/F01_06SI.pdf) is: |
Last comment - the formulae for enthalpy mentioned above are actually an approximation of the data published in Table 3 of the psychrometrics chapter. A comparison of the 2001 and 2005 formulae to data from the table makes me wonder why the change was made, as the new formula appears less accurate than the old one. See attached file. |
Perhaps this is not an issue per se but an inconsistency with other functions due to different coefficients or constants used, assumptions made, or validity checks. I will break this down into two points:
Continuing from #16, I note that a number of constants that we use can be easily calculate from a set of more fundamentals constants (I will add a table of those shortly). The only issue with this, would be that the values would be slightly different than what is currently reported in the ASHRAE handbook. The question would therefore be whether we want 100% consistency or better accuracy and perhaps fewer empirical solutions when analytical solutions are available... What's your take on this?
As a final comment for now, changing the value of specific heat of water vapour in PsychroLib will not significantly improved the results of the |
I have had a look at this issue in more details, the issue appears be purely numerical and, specifically to using the secant method rather than the false position method as done in EnergyPlus. There appears cases where we do not get convergence as we would do using the false position method (see this for example) -- this is probably why they chose to false position in EnergyPlus for this function. I have created some tests for this function and attached the results (see psychrolib-v-eplus.zip). The findings can be summarised by the following histogram. All significant errors are in the first few degrees -- this seems to indicates a convergence problem as given by using the bisection method. I have already tried in Fortran and we could simply change the loop and add a false position function that we can call. What do you think? This should be really straightforward if we do similarly to EnergyPlus but let me know if you had something else in mind we could use instead. |
Thanks for the various comments:
|
Some quick comments:
|
|
|
Great thanks - but I still don't see the issue.
|
I think you hit the nail on the head! The error metric I used should have should have also included the absolute error or at lest used the relative error or relative percentage error scaled to Kelvin -- sorry! I agree with the peak at 0.7 degree C but increasing as we approach the positive values -- I have summarised this in the following scatter-plot. I have added a table below, were the errors are largest.
Having said all this, I would agree in that one would not be able to tell you which one is the most accurate from this comparison... Is a disagreement of ~0.7 K significant for the application it is to be designed? In my specific case, I compared it against EnergyPlus as I started to notice large difference in my model outputs when switching from EnergyPlus to PsychroLib given that I needed a lightweight library to take care of the Psychometric calculations. |
I had a peek inside EnergyPlus but I don't really know how their ITERATE function works. In the body of the PsyTwbFnTdbWPb function though, it looks like they use only the formula appropriate for temperatures above zero, not an alternate formula for when temperatures are below zero as PsychroLib and ASHRAE do. Is that the source of the differences you observe between PsychroLib and EnergyPlus for negative temperatures? |
That's right, they only use the formula appropriate for temperatures above zero -- I tested the range again but this time using the formula for temperatures above zero for both below and above zero in PsychroLib and we get really good agreement against EnergyPlus. Max diff ~0.06 -- see below for plot. I agree, this is not a bug/issue with PsychroLib but actually a simplification in EnergyPlus. I have removed the bug label. Feel free to close this at your convenience. |
For reference, I am including the tests output below. |
Issue is closed, no action needed. |
I am using the
GetTWetBulbFromHumRatio
but noticed that the results are not as expected. when compared against EnergyPlus (PsyTwbFnTdbWPb, see this) or https://www.weather.gov/epz/wxcalc_rh, the results fromGetTWetBulbFromHumRatio
suggest an issue with the pressure.E.g.
I have not looked at this yet in detail as to the issue is with the implementation or with and issue/limitation in the ASHRAE formulae.
The text was updated successfully, but these errors were encountered: