Closed Alhabeeb86 closed 1 year ago
a) The refpropm interface is deprecated, please move to the python-based one. b) HS inputs are challenging, can you refactor into other kinds of inputs, ideally one that includes P, T, or D?
Also, need a runnable failing example
Thanks for your response, a) I didn't understand b) according to my model I just have enthalpy and entropy The example: P=refpropm('P','H',306.42641000,'S',1.38111000,'r1234yf');
a) https://github.com/usnistgov/REFPROP-wrappers/tree/master/wrappers/MATLAB b) what full version of REFPROP do you use?
a) Thanks, as I understand that I can continue use Matlab but with Python interface b) My REFPROP version is 9.1
HS inputs are tricky because you need to iterate on both temperature and density to match the given enthapy and entropy. They are the slowest and least reliable thermodynamic inputs. Often there is a way to restructure your problem to use PH, or PS inputs, for instance.
You should first try to upgrade to version 10.0, which has a lot of improvements to these routines.
Thanks for the comment. Unfortunately, I have no other option for inputs. So use Python's interface with Matlab doesn't solve the problem?
First try to upgrade to version 10, you need an improvement to flash calculations and this should hopefully help.
On my side, this:
import ctREFPROP.ctREFPROP as ct
import os
os.environ['RPPREFIX'] = os.getenv('HOME')+'/REFPROP10'
root = os.getenv('RPPREFIX')
RP = ct.REFPROPFunctionLibrary(root)
RP.SETPATHdll(root)
print(f'version: {RP.RPVersion()}')
z = [0, 0]
r1 = RP.REFPROPdll('R1234YF','HS','T',RP.MASS_BASE_SI,0,0,306.42641000e3,1.38111000e3,z)
print(r1.Output[0], r1.herr)
yields
version: 10.0
279.3272376575616
so the temperature works with version 10.0
In your case, the solution is to upgrade to version 10.0
Thanks a lot for your help, and I would like to say that I deleted the REFPROP and installed again (version 9.1) and it works.
Hi, I'm linking Matlab with refprop, and for some cases I have this message:
''Error using refpropm (line 464) [SHFLSH error 248] single-phase iteration did not converge, T, deltaT = 0.18627E+12 0.15709E-02 K.''
Any suggestion to solve this issue ? Thanks