-
Notifications
You must be signed in to change notification settings - Fork 15
How do I get saturation densities near but below the EOS critical point temperature #754
Description
I am using Fluid "CYCLOPRO". I am unable to get saturation densities near but below the EOS critical temperature. When I call SATTdll() I get an error message saying that the temperature is above the critical temperature. I have a small test program which clearly shows that the temperature is below the EOS critical temperature and hence saturation densities do exist!
I assume that SATTdll() is using an internal correlation which is supposed to closely match the EOS but clearly it is not close enough. Is there another means to get the saturation densities directly from the EOS instead of going through the correlations?
`void ToNIST(REFPROPInstance& RP)
{
int iIn, iOut[200]{}, iFlag = 0, kph = 1, ierr;
char herr[MAX_PATH]{};
double Tctrue, Tc, T, P, Dctrue, den, q, Dl, Dv, dPdD, d2PdD2, z[20]{ 1.0 }, x[20]{}, y[20]{}, Output[200]{};
Tctrue = Tc = T = P = Dctrue = den = q = Dl = Dv = dPdD = d2PdD2 = HUGE_VAL;
iIn = 2;
iOut[0] = 424; // rpEnumFor[TCTRUE];
iOut[1] = 425; // rpEnumFor[DCTRUE];
RP.ALLPROPS0dll(iIn, iOut, iFlag, Tc, den, z, Output, ierr, herr, MAX_PATH);
// ierr: 0
// herr: ""
Tctrue = Output[0]; // 398.69140098377221
Dctrue = Output[1]; // 6.1162146148792953
// Verify that the TCTRUE/DCTRUE point is actually the critical.
iOut[0] = 61; // rpEnumFor[DPDD];
iOut[1] = 67; // rpEnumFor[D2PDD2];
RP.ALLPROPS0dll(iIn, iOut, iFlag, Tctrue, Dctrue, z, Output, ierr, herr, MAX_PATH);
// ierr: 0
// herr: ""
dPdD = Output[0]; // 6.6245104393966252e-12
d2PdD2 = Output[1]; // 5.5358765256702575e-12
// Now drop the temperature to something close to but below TCTRUE,
// to retrieve the saturation densities
T = 398.6; // < 398.69140098377221 (Tctrue)
RP.SATTdll(T, z, kph, P, Dl, Dv, x, y, ierr, herr, MAX_PATH);
// ierr: 121
// herr: "[SATT error 121] Temperature input is greater than the critical or maxcondentherm temperature: T = 398.600 K, Tc = 398.300 K."
}
`
I am also attaching the Fluid file (as a txt file) I am using.