usnistgov / REFPROP-wrappers

Wrappers around NIST REFPROP for languages such as Python, MATLAB, etc.
195 stars 127 forks source link

Convergence issue for pure CO2 in the two phase state, when input is density & enthalpy #594

Closed SoerenTropy closed 6 months ago

SoerenTropy commented 6 months ago

Hi,

I am aware that the Matlab wrapper is legacy but maybe there is a fix to this.

When I use refpropm.m to ask for properties of pure CO2 giving density and enthalpy, and a two phase state is probable, the evaluation either gives false values or fails to converge. The same inquiries resolved just fine in GUI and Excel.

False Value Example

p = refpropm('P','D',128,'H',390000,'CO2')

Expected Answer:

p =

3.7905e+03

Actual Answer:

p =

3.0755e+03

Nonconverging Example

p = refpropm('P','D',131,'H',140000,'CO2')

Expected Answer:

p =

7.2503e+02

Actual Answer:

Error using refpropm [DHFL2 error 226] 2-phase iteration did not converge.

Versions

REFPROP Version: 10.0 Operating System and Version: Windows 10 Access Method: Matlab

ianhbell commented 6 months ago

First you need to switch to the new interface. Then you have (some) options.

SoerenTropy commented 6 months ago

Thanks, switching to the Python wrapper solved the problem for me.