Closed Yili-Zhang closed 5 years ago
The core issue is a very subtle one: the properties that are coming from phase equilibrium calculations require you to specify a vapor fraction, even if in the end it doesn't matter. For heat of vaporization and surface tension, any value from 0 to 1 would do, because it only matters that you are at equilibrium. For thermal conductivity, the vapor quality DOES matter because that could be either the saturated vapor or saturated liquid thermal conductivity.
So your first call would read (for instance):
Q = 1;
RP.REFPROPdll('Ethanol','TQ','TCX',MASS_SI,int8(0),int8(0),300,Q,{1.0});
Additional comments:
1) Ethanol is mis-spelled
2) You should 100% of the time check the ierr
error code coming from a call to REFPROPdll. The herr
string provides sometimes useful error message.
3) The unit system should not be hard-coded, the enumerated value should be obtained from a call to GETENUMdll. E.g.: RP.GETENUMdll(int8(0), "DEFAULT").iEnum
Hi,
Thanks for your instructions. It helped a lot. After added the Quality features, both surface tension and the heat of vaporization worked:
>> I_FG=RP.REFPROPdll('Ethanol','TQ','HEATVAPZ',MASS_SI,int8(0),int8(0),500,1,{1.0});
I_FG_num=double(I_FG.Output);
i_fg=I_FG_num(1)
i_fg =
346.1581
>> SIG=RP.REFPROPdll('Ethanol','TQ','STN',MASS_SI,int8(0),int8(0),500,1,{1.0});
SIG_num=double(SIG.Output);
sigma_I=SIG_num(1)
sigma_I =
1.5185
However, for the thermal conductivity, I wonder if the quality is really necessary, for the combination of temperature and pressure also works:
>> K=RP.REFPROPdll('Water','TP','TCX',MASS_SI,int8(0),int8(0),300,12.8,{1.0});
K_num=double(K.Output);
k_H=K_num(1)
k_H =
616.4826
In the additional commends, I have a few questions:
RP = py.ctREFPROP.ctREFPROP.REFPROPFunctionLibrary('C:\Program Files (x86)\REFPROP');
MASS_SI=RP.GETENUMdll(int8(0), "MASS SI").iEnum;
And the unit system has been working fine so far. For the code you proposed, my I know how exactly I could incorporate into (or replace) the current setup?
Thanks a lot!
-Yili
if RP.ierr > 100
error(RP.herr)
end
Hi,
Thanks for the reply. Actually I'm using Ethanol's thermal conductivity under its two-phase conditions (0<Q<1). In this case, may I still use TP to find K, or I have to use TQ (or PQ)?
Thanks,
-Yili
The thermal conductivity of a two-phase mixture for a pure fluid is not defined. There are two possible values, one for the saturated liquid, another for the saturated liquid, and a no-mans-land in between. Besides, for a pure fluid, TP can NEVER be used to specify the state for a pure fluid for 0 < Q < 1. See https://github.com/usnistgov/REFPROP-issues/issues/82
I see. Thanks for your help.
Hi,
I could never get a correct result with the thermal conductivity function, surface tension function and the heat of vaporization (pure fluid) function with MatLAB. Here are the codes I applied:
And here are the results:
May I know where is wrong with the code? Thanks!
-Yili