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
Negative vapor and unsteady liquid quality caluculation for Helium #2360
Comments
Where are your state points? Please provide a runnable example with all necessary imports and so on. |
please see the post above. |
Doesn't answer my question: where in the phase diagram (in words) are the state points? |
Hi, sorry for the late answer. The data are for a saturated liquid and a superheated vapor |
Looks like a weird bug in CoolProp. @msaitta-mpr can you take a look? The liquid points are basically saturated, the vapor ones are superheated. Of course you could calculate the vapor quality yourself as a workaround. import matplotlib.pyplot as plt, numpy as np
import CoolProp.CoolProp as CP
p = [137461.323112938,138230.195483501,139009.601323972,139802.273201606,140612.019520862,140624.831673310,140624.881557153]
rho_l = [116.801408146380,116.622690424081,116.440870994868,116.255265192642,116.064936888442,116.061915920152,116.061904153613]
rho_v = [21.1913767379303,21.2996648399277,21.4066320262526,21.5120163010261,21.6154385418442,21.6170372666172,21.6170434816964 ]
q_v_cool = CP.PropsSI('Q','P',p,'D',rho_v,"HELIUM")
q_v_ref = CP.PropsSI('Q','P',p,'D',rho_v,"REFPROP::HELIUM")
q_l_ref = CP.PropsSI('Q','P',p,'D',rho_l,"REFPROP::HELIUM")
q_l_cool = CP.PropsSI('Q','P',p,'D',rho_l,"HELIUM")
Tt, Tc = [CP.PropsSI(k,'Helium') for k in ['Ttriple','Tcrit']]
Ts = np.linspace(Tt, Tc, 1000)
ps = CP.PropsSI('P','T',Ts,'Q',0,'REFPROP::Helium')
dLs = CP.PropsSI('D','T',Ts,'Q',0,'REFPROP::Helium')
dVs = CP.PropsSI('D','T',Ts,'Q',1,'REFPROP::Helium')
plt.plot(dLs, ps)
plt.plot(dVs, ps)
plt.plot(rho_l, p, 'x')
plt.plot(rho_v, p, 'o')
plt.gca().set(xlabel=r'$\rho$ / kg/m$^3$', ylabel='$p$ / Pa')
plt.tight_layout(pad=0.2)
plt.show()
plt.plot(p, q_v_cool, label='CoolProp')
plt.plot(p, q_v_ref, label='REFPROP')
plt.title('gas (should be > 1)')
plt.legend(loc='best')
plt.gca().set(xlabel='$p$ / Pa', ylabel='Q')
plt.show()
plt.plot(p, q_l_cool, label='CoolProp')
plt.plot(p, q_l_ref, label='REFPROP')
plt.title('liquid (should be = 0)')
plt.legend(loc='best')
plt.gca().set(xlabel='$p$ / Pa', ylabel='Q')
plt.show() yields and and
|
Hello!
I've noticed some issues during the calculation of Helium state variables. For example, the quality of the pure vapor state results in -1. For a liquid state, it appears unsteady and oscillates between 0 and -1. In comparison, REFPROP (10.0) shows steady curves of 1→100 (superheated vapor) and 0 (saturated liquid). Here are the data points to compare in MATLAB:
If you repeat it for the enthalpy, you will see that the enthalpy calculated with CoolProp deviates by almost a factor of 10² J/kg.
Is it a bug? Any help would be appreciated!
The text was updated successfully, but these errors were encountered: