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 call converges using CoolProp but diverges using REFPROP as the backend #2352

Open
8cold8hot opened this issue Feb 21, 2024 · 6 comments

Comments

@8cold8hot
Copy link

8cold8hot commented Feb 21, 2024

Description

The following PropsSI calls, which aim at getting the temperature of Toluene from its specified enthalpy and entropy, failed for the case of using REFPROP as the backend but can successfully get the value using CoolProp. Is there any way to fix the REFPROP case as I need to use the REFPROP backend in my main program?

Steps to Reproduce

PropsSI("T","H",195908.1014,"S",624.230099,"REFPROP::Toluene")

PropsSI("T","H",195908.1014,"S",624.230099,"Toluene")

Expected behavior: The temperature of the Toluene at this thermodynamic state

Actual behavior:
For the REFPROP case:

File CoolProp\CoolProp.pyx:391, in CoolProp.CoolProp.PropsSI()
File CoolProp\CoolProp.pyx:471, in CoolProp.CoolProp.PropsSI()
File CoolProp\CoolProp.pyx:358, in CoolProp.CoolProp.__Props_err2()
ValueError: HmolarSmolar: [HSFLSH error 260] h-s inputs are two-phase or out of bounds, iterative routine is not available to find a solution. : PropsSI("T","H",195908.1014,"S",624.230099,"REFPROP::Toluene")

For the CoolProp case:

327.4550058572102

Versions

CoolProp Version: 6.4.3.post1
REFPROP version: 10.0
Operating System and Version: Windows 10
Access Method: Python wrapper

@ibell
Copy link
Contributor

ibell commented Feb 22, 2024 via email

@8cold8hot
Copy link
Author

8cold8hot commented Feb 22, 2024

@ibell Thank you for the reply. I checked the reference state for CoolProp and REFPROP, they were the same. But this problem continues, which is shown as follows for the water case:

CP.set_reference_state('Water','DEF')
CP.PropsSI('H', 'T', 300, 'Q', 0, 'Water')

112564.85985348356

CP.PropsSI('H', 'T', 300, 'Q', 0, 'REFPROP::Water')

112564.85985388973

PropsSI("T","H",1542101.039,"S",4755.078077,"Water")

329.02706411370366

PropsSI("T","H",1542101.039,"S",4755.078077,"REFPROP::Water")

ValueError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_2068\2296138933.py in
----> 1 PropsSI("T","H",1542101.039,"S",4755.078077,"REFPROP::Water")
CoolProp\CoolProp.pyx in CoolProp.CoolProp.PropsSI()
CoolProp\CoolProp.pyx in CoolProp.CoolProp.PropsSI()
CoolProp\CoolProp.pyx in CoolProp.CoolProp.__Props_err2()
ValueError: HmolarSmolar: [HSFLSH error 260] h-s inputs are two-phase or out of bounds, iterative routine is not available to find a solution. : PropsSI("T","H",1542101.039,"S",4755.078077,"REFPROP::Water")

@ibell
Copy link
Contributor

ibell commented Feb 24, 2024 via email

@8cold8hot
Copy link
Author

REFPROP 10.0

@ianhbell
Copy link
Contributor

Where are those inputs supposed to be in the phase diagram?

@8cold8hot
Copy link
Author

I solved the problem by changing the codes to rely on CoolProp instead of REPROP.

To be honest, I do not know where those inputs are supposed to be in the phase diagram. They are generated in a scipy.optimization.bisection procedure of seeking a solution for a nonlinear equation involving getting the thermodynamic states of a refrigerant.

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

No branches or pull requests

3 participants