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
Value jumps with PSmass_INPUTS #2319
Comments
I have tried a bit more at 293.15 K and it fails with HEOS for values near the critical pressure between 1274900 Pa and 1288200 Pa. Interestingly not all of them. Interestingly not all of them: import CoolProp.CoolProp as CP HEOS = CP.AbstractState('HEOS','Hydrogen') T0 = 293.15 # K step = 0.001e5 plt.plot(Ps,Ts,'.') The output: 1274900.0 failed |
Weird, did you also try to specify the phase? Perhaps that would help? I agree that you should not be having this problem. I wonder if the problem could be related to the issues identified in this paper: https://link.springer.com/article/10.1007/s10765-023-03261-8 ? |
Description
I am getting some weird values/behavior with hydrogen.
I'm setting the problem with TP conditions with 293.15 K and 12.8 bar.
Then calling with PSmass_INPUTS and it misbehaves when close to the critical pressure, although we're far from the critical temperature. It either crash during the root finding process with the HEOS or returns odd temperatures with the cubic HEOS.
Steps to Reproduce
Running with
HEOS = CP.AbstractState('HEOS','Hydrogen')
HEOS.update(CP.PT_INPUTS,1280000.0,293.15)
print(HEOS.smass())
HEOS.update(CP.PSmass_INPUTS,1280000.0,HEOS.smass())
print(HEOS.T())
And then
HEOS = CP.AbstractState('BICUBIC&HEOS','Hydrogen')
HEOS.update(CP.PT_INPUTS,1280000.0,293.15)
print(HEOS.smass())
HEOS.update(CP.PSmass_INPUTS,1280000.0,HEOS.smass())
print(HEOS.T())
EDIT: It does the same thing at 293.15K and
1840000.0 Pa
2280000.0 Pa
2440000.0 Pa
2460000.0 Pa
Expected behavior:
I'd expect the same temperature value +- some small tolerance.
Actual behavior:
The output:
42661.31838031734
Traceback (most recent call last):
Cell In[112], line 4
HEOS.update(CP.PSmass_INPUTS,1280000.0,HEOS.smass())
File CoolProp/AbstractState.pyx:102 in CoolProp.CoolProp.AbstractState.update
File CoolProp/AbstractState.pyx:104 in CoolProp.CoolProp.AbstractState.update
ValueError: unable to solve 1phase PY flash with Tmin=33.0479, Tmax=1500 due to error: solver_rho_Tp was unable to find a solution for T= 33.0479, p= 1.28e+06, with guess value 12445.8 with error: The molar density of -46108.837071 mol/m3 is below the minimum of 0.000000 mol/m3
Now when I run this with the bicubic HEOS approximation, the output is
42661.318399796466
111.05883327180031
Versions
CoolProp Version: '6.5.0'
Operating System and Version: macOS BigSUR 11.5.2
Access Method: Accessing via Python (3.8)
Additional Information
I checked via both coolprop and refprop plots of the entropy/pressure with iso temperature, there are no jumps in those regions.
Also when doing the reverse:
HEOS.update(CP.PT_INPUTS,1280000.0,111.0588)
print(HEOS.smass())
29811.642756672805
The entropy value has nothing to do with the one set in the PSmass_INPUTS inputs.
The text was updated successfully, but these errors were encountered: