Closed Alhabeeb86 closed 6 months ago
The REFPROP 10 HMX.BNC is not backwards compatible with 9.1. Better to update your MATLAB interface to the REFPROP 10 via python. That seems to work quite reliably.
Thanks a lot. Now I have Python interface for Matlab using Refprop 10. Is there a simple syntax to calculate a property like refpropm? Because I didn't fully understand this syntax:
MOLSI = RP.GETENUMdll(int8(1),'MOLAR BASE SI').iEnum; iMass = int8(0); % 0: molar fractions; 1: mass fractions iFlag = int8(0); % 0: don't call SATSPLN; 1: call SATSPLN z = {1.0}; % mole fractions, here a pure fluid, so mole fraction of 1.0 r = RP.REFPROPdll('Water','PQ','T',MOLSI,iMass,iFlag,101325,0.0,z)
When I replace water by a mixture, it works just for the first time and when I just repeat the calculation it returns with -9999990?
REFPROPdll works much like refpropm. Please read the docs: https://refprop-docs.readthedocs.io/en/latest/DLL/high_level.html#f/_/REFPROPdll
Thanks a lot, but is there a direct syntax to find the output property rather than , for example: 1- r = RP.REFPROPdll('CO2;R32;R1234yf','PQ','T',MOLSI,iMass,iFlag,101325,0.0,z); 2- rr=double(r.Output); 3- T=rr(1); Is there a way to use just one syntax rather than three syntaxes
double(RP.REFPROPdll('CO2;R32;R1234yf','PQ','T',MOLSI,iMass,iFlag,101325,0.0,z).Output)(1);
My syntaxes: clear; clc; RP = py.ctREFPROP.ctREFPROP.REFPROPFunctionLibrary('C:\Program Files (x86)\REFPROP'); MOLSI = RP.GETENUMdll(int8(1),'MOLAR BASE SI').iEnum; iMass = int8(1); % 0: molar fractions; 1: mass fractions iFlag = int8(1); % 0: don't call SATSPLN; 1: call SATSPLN z = {0.03 0.215 0.755}; % mole fractions, here a pure fluid, so mole fraction of 1.0 T=double(RP.REFPROPdll('CO2;R32;R1234yf','PQ','T',MOLSI,iMass,iFlag,101325,0.0,z).Output)(1); But the code didn't work the error message was:
RefpropPy Error: File: RefpropPy.m Line: 7 Column: 3 Indexing with parentheses '()' must appear as the last operation of a valid indexing expression.
This is a MATLAB problem, not related to REFPROP
Ok. How can I set the output unit like follow: Temperature (K) Pressure (kPa) density (kg/m^3) enthalpy (J/kg) entropy (J/kg k) Thanks
You can use custom units (read the docs), but I strongly advise against it. I would recommend you use mass-based SI units, which would be:
RP.MASS_BASE_SI
in your example code. Complete:
clear; clc;
RP = py.ctREFPROP.ctREFPROP.REFPROPFunctionLibrary('C:\Program Files (x86)\REFPROP');
MASSSI = RP.MASS_BASE_SI;
iMass = int8(1); % 0: molar fractions; 1: mass fractions
iFlag = int8(1); % 0: don't call SATSPLN; 1: call SATSPLN
z = {0.03 0.215 0.755}; % mole fractions, here a pure fluid, so mole fraction of 1.0
T=double(RP.REFPROPdll('CO2;R32;R1234yf','PQ','T',MASSSI,iMass,iFlag,101325,0.0,z).Output)(1);
You know R452A is a mixture of R32 , R125 and R1234yf. When I copy R452A.mix from Refprop10 to Refprop9.1 it worked but Refprop showed me a warning message that " no mixture data are available for one or more binary pairs ...". Thus, I copy HMX.BNC from Refprop10 to 9.1, but the warning still appears. How can I solve this problem? BTY, the interface of MATLAB does not work properly with Refprop10 that is why I have to use Refprop 9.1.