-
Notifications
You must be signed in to change notification settings - Fork 18
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
Incorrect region for certain region 2 temperature/pressure inputs? #16
Comments
Ok, this seems to be a serious error. I will look into the Region select code where it differs from IF97. Just a heads up; it might take some time since I am quite busy with other stuff at the moment. I hope that is ok for you. |
Is it possible that the verification data in table 18 is wrong? I see that the code to determine the region uses equation 30 to get the saturation pressure from the provided temperature. If the provided pressure is greater than the saturation pressure it is region 1 and otherwise it is region 2. I don't see any logic error here so that would seem to make the issue fall on the implementation of equation 30. The only problem is that the data in table 35 used to verify equation 30 all checks out so there doesn't seem to be any error with the implementation of equation 30. All of this to say that it almost seems like the data in table 18 is just wrong. |
I think I identified the problem! Quite simply, the equations from section 6.2 simply aren't there. Tabel 18 is meant to test exactly the metastable vapor region but since there is no code, the tests fail. Looking back at the original Matlab code from Magnus Holmgren, it seems it was never implemented in the first place. |
That would make sense as to why the values are off, but does that explain why the code returns region 1 rather than region 2? I would expect the code currently to select region 2, but use the standard region 2 equation rather than the metastable vapor region equation. Currently it seems that the region 1 is being selected and the region 1 equation is being used. Thanks for looking into this! |
I had some time to add the equations from chapter 6.2 including the tests. As of now the tests still report an error for the collective precision but it is already below 5.6e-4. There is probably some typo in the coefficients or something but in general they seem to work. If you want, you can check out the branch chap6.2_metastable. The next step is, as you mentioned, to figure out what is wrong with the region selection code. |
According to table 18 on page 20 of the IAPWS-IF97 documentation the input values in that table should be in region 2 and should return the expected output values. When I use those input values in this library, I am not seeing the expected output values and the region is being identified as region 1.
Sample Code:
Expected Results:
Actual Results:
The text was updated successfully, but these errors were encountered: