CoolProp icon indicating copy to clipboard operation
CoolProp copied to clipboard

PS Input Pair Gives Erroneous Result on Saturation Curve in IF97 Backend

Open henningjp opened this issue 2 years ago • 2 comments

Description

IF97 Backend reverse calculation using (P, S) delivering erroneous values when state point is on the saturation Reporting this issue for a user of CoolProp with Mathcad and SMath interfaces.

Steps to Reproduce

  1. Evaluate PropSI("H","P",<p>,"S",<SsatL @ p>,"IF97::H2O")
  2. Any pressure below the critical pressure can be used,

  3. Any Output parameter will give the same issue

Expected behavior: Liquid saturation point values returned.

Actual behavior: Vapor saturation point values returned. "Phase" returns "gas_phase" erroneously.

image

Versions

CoolProp Version: Latest (6.6.0) Operating System and Version: Windows 10 Access Method: Mathcad/Python/SMath

Additional Information

  • Probably occurring at the saturated vapor point as well, but since the sat. vapor values are returned, it is not noticeable.
  • Probably the same for reverse calculations using (P, H).
  • Tracked it down so far to phase determination on the saturation curve, not sure yet if the issue is in the CoolProp backend routine, or in IF97 itself. A phase determination function from IF97.h does get called to make this determination.

henningjp avatar Dec 07 '23 12:12 henningjp

@ibell Having trouble figuring this one out. IF97.h is fine. Backend makes sense, but won't return the right phase flag on the saturation boundary. I always get confused on your CoolProp convention for points exactly on the saturation curve and recall it was not intuitive to me. Are these points considered part of the 2-phase region (with Q = 1 or 0) or are they considered part of the Liquid or Vapor 1-phase region?

henningjp avatar Dec 16 '23 13:12 henningjp

In CoolProp, Q=1 and Q=0 are considered to be two-phase states because the bulk phase is in equilibrium with an infinitely small amount of the incipient phase, and infinitely small is greater than zero :)

ibell avatar Dec 19 '23 14:12 ibell