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

Incoherent phase identification #626

Open
GZALAT opened this issue Jan 16, 2024 · 4 comments
Open

Incoherent phase identification #626

GZALAT opened this issue Jan 16, 2024 · 4 comments

Comments

@GZALAT
Copy link

GZALAT commented Jan 16, 2024

Property "Phase" is returning neither the same nor a correct result if calculated by Temperature - Density or Temperature - Pressure. This occurs when called from Excel (see attached Refprop Phase issue.xlsx) or Python with the code

import os
from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary
RP = REFPROPFunctionLibrary(os.environ['RPPREFIX'])
RP.SETPATHdll(os.environ['RPPREFIX'])
US = RP.GETENUMdll(0,"MASS BASE SI").iEnum
FLD = "Oxygen;Nitrogen"
Comp = [0.2,0.8]
T = 160 #K
P = 60e5 #Pa
D = RP.REFPROPdll(FLD,"TP","D",US, 0,0,T,P,Comp).Output[0] #kg/m3
Phase_TP = RP.REFPROPdll(FLD,"TP","PHASE",US, 0,0,T,P,Comp).hUnits # Returns incorrect but acceptable "Superheated gas"
Phase_TD = RP.REFPROPdll(FLD,"TD","PHASE",US, 0,0,T,D,Comp).hUnits # Returns incorrect "Subcooled liquid"
print (f"Phase calculated from T,P is {Phase_TP} and calculated from T,D is {Phase_TD}")

When using the Refprop GUI the Phase always correctly solves to "Supercritical" from both "TP" and "TD"
image

@ianhbell
Copy link
Contributor

@EricLemmon this looks like a bug, or is this expected behavior? How does the GUI handle this to get the right answer always?

@TMercerP
Copy link

I don't think that the (T,P) input pair is independent for saturated states and may not produce meaningful results for Quality/Phase. The independent pairs are (P,H), (P,S), (P,D), (T,S), (T,D), (H,D), and (S,D), right?

@GZALAT
Copy link
Author

GZALAT commented Jan 30, 2024

I don't think that the (T,P) input pair is independent for saturated states and may not produce meaningful results for Quality/Phase. The independent pairs are (P,H), (P,S), (P,D), (T,S), (T,D), (H,D), and (S,D), right?

I do not really agree as we are in unsaturated monophase here, but this question is about the different results in GUI and Python/Excel, and additionally, the result (T,D) is providing is even more off than the (T,P) one...

@GZALAT
Copy link
Author

GZALAT commented Feb 9, 2024

Any news on this issue? thank you

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

No branches or pull requests

3 participants