Closed depcik closed 4 years ago
Some comments:
GETENUMdll
to retrieve the unit classes, they are now exposed as attributes of the REFPROPFunctionLibrary, so you could do: RP.MOLAR_BASE_SI
SETMIXdll
to get the names and molar compositions, and then pass the compositions (but not the names, leave hFld
as the empty string ''
. That should always work (in theory).Also:
ierr
at each call. If it is something other than 0, you should print herr
, which will give an indication of why the call failed (and returned the default bad value)OK, I have now been able to get values for h1, T1, and s1, but they are not correct. If you look at REFPROP10 for R-502 at a saturation pressure of 1.5168e+05 Pa (0.15168 MPa) you get:
My code now is:
WF = 'R502.MIX';
sm = RP.SETMIXdll(WF, 'HMX.BNC', 'DEF'); % See SETUPdll for specifics
% Properties
p1 = 1.5168e+05; % Pressure at State 1: Pa
x1 = 1; % Saturated vapor at State 1
% Get the enthalpy given the quality
r = RP.REFPROPdll('', 'PQ', 'H', MASSI, iMass, iFlag, p1, x1, sm.z); % Specify the pressure and quality
o = double(r.Output);
h1 = o(1); % [J/kg]
That gives me an enthalpy value of 3.3779e+05 J/kg or 337.79 kJ/kg which is different than the REFPROP value of 326.16 kJ/kg. The temperature and entropy provide different values too.
So then it comes to reference states. Try changing the reference state in the GUI; with the appropriate selection the DLL and the GUI should agree (the default reference states in the GUI and the DLL are different, a historical decision that we have been forced to live with into the present).
If you look at the image I uploaded, it indicates that: "Ref. State: Default" which is what I am running with SETMIXdll. I just tried the other reference states in the GUI and I get different answers than Matlab.
Wait. If I apply the reference state to "Each pure component" in the GUI, then it looks like I get the same answers between the GUI and Matlab.
Right, I was about to type that response to you.
OK, it seems like I am good to go at this point. Thanks!
Yes, I am hoping we can get some docs together on the reference states, and precisely how they operate, as it is a mystery to me still.
But glad to hear you are resolved for now.
Description
I have been using REFPROP 10 well with single fluids, however it is not working with a mixture
Steps to Reproduce
Code
Behavior: I expect to get a value of 326.16 kJ/kg at that pressure, but I end up getting -9999990. Same thing with temperature (should be 236.89 K) and entropy (should be 1.5458 kJ/kgK)
Versions
REFPROP Version: 10 Operating System and Version:
Microsoft Windows 10 Access Method:
Python in Matlab
Additional Information
If possible, please post examples and/or screenshots of the issue.