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

PropsSI failed ungracefully with Water::IF97 #1999

Closed
jccberthet opened this issue Feb 12, 2021 · 9 comments · Fixed by #2058
Closed

PropsSI failed ungracefully with Water::IF97 #1999

jccberthet opened this issue Feb 12, 2021 · 9 comments · Fixed by #2058
Assignees
Milestone

Comments

@jccberthet
Copy link

Description

PropsSI failed ungracefully, with IF97::Water

Steps to Reproduce

import CoolProp.CoolProp as cp
cp.PropsSI('Q', 'P', 6.4743994800040303e+06, 'H',1.2394090698400016e+06 , 'IF97::Water')

Expected behavior:

Expected to return zero, or something indicating that the fluid in fully liquid.

Actual behavior:
Raised an exception:
ValueError: PropsSI failed ungracefully :: inputs were:"Q","P",6.4743994800040303e+06,"H",1.2394090698400016e+06,"IF97::Water"; please file a ticket at https://github.com/CoolProp/CoolProp/issues

Versions

CoolProp Version: 6.4.1
Operating System and Version: Windows 10
Access Method: Python

Additional Information

@ibell
Copy link
Contributor

ibell commented Feb 12, 2021

Is that statepoint valid? And the only problem is the value that is returned for Q? How about density?

@henningjp
Copy link
Contributor

Other props return values in the liquid phase, Q is undefined here. This point is just outside the vapor dome in the liquid region. HEOS returns Q = -1 (i.e.. undefined) and does not throw an error. Nudging the IF97 enthalpy value up to 1239.795 returns a sensible Q value (Hsat is 1239.7942 at this pressure).

I think the point here is that IF97 should return something other than an ungraceful failure if Q is undefined.

Workaround: The calling code should check to make sure H is inclusively between the saturated liquid value and the saturated vapor value before making the call.

@ibell
Copy link
Contributor

ibell commented Feb 20, 2021

@henningjp can you add an exception for Q < 0 or Q > 1 for surface tension?

@henningjp
Copy link
Contributor

henningjp commented Feb 20, 2021 via email

@henningjp henningjp self-assigned this Feb 20, 2021
@henningjp henningjp added the bug label Feb 20, 2021
@ibell
Copy link
Contributor

ibell commented Feb 21, 2021

Thanks, yes I should think so.

@henningjp
Copy link
Contributor

@ibell Finally getting back to this issue. Was intending to modify IF97 to make Q return an undefined value (-1) in all single-phase regions; like HEOS behavior. However, your request above has me confused as you mentioned surface tension. Did we not address surface tension in #1755 ? Not sure how surface tension relates here. Unfortunately, it was so long ago, you may not remember either! 😕 I'll proceed with the original issue above at risk until apprehended.

@henningjp
Copy link
Contributor

@ibell - Maybe you meant, "like" for surface tension?

@henningjp
Copy link
Contributor

NVM. Surface Tension error thrown is just wrong for IF97 backend when Q < 0 or Q > 1. Fixed.
_Q issue is a little less trivial than I thought. Working on that.

@ibell
Copy link
Contributor

ibell commented Oct 29, 2021

I haven't the foggiest about what is meant about surface tension. I think that it should not be allowed for Q < 0 or Q > 1?

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

Successfully merging a pull request may close this issue.

4 participants