Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabular calcs with mixtures often return Dew T< Bubble T using PQ input pair #921

Closed
mapipolo opened this issue Jan 13, 2016 · 7 comments
Closed
Milestone

Comments

@mapipolo
Copy link

I've traced a number of issues back to this behavior of the tabular backend and have collected a bunch of cases to demonstrate it. The code is somewhat lengthy, so I will provide just an example and results.

I initialize arrays refrig and tSatVap with the first two columns below:

refrig tSatVap tSatLiqRefprop tSatLiqBicubic dT
R440A.mix 233.150017 231.6475746 246.3096705 14.6620959
R407D.mix 233.1500186 226.3933816 233.2254995 6.832117836
R449A.mix 233.1500201 227.4313526 233.4113896 5.980036991
R401A.mix 245.3722394 239.6272034 245.3913809 5.764177523
R404A.mix 226.1500205 225.3889674 229.6831741 4.29420675
R404A.mix 226.1500205 225.3889674 229.6831741 4.29420675
R404A.mix 231.4500081 230.7227298 234.3192037 3.596473883
R404A.mix 231.4833394 230.7562719 234.3405164 3.584244464
R404A.mix 232.155001 231.4320517 234.7466609 3.314609206
R404A.mix 233.1500159 232.4331244 235.2648581 2.831733721
R440A.mix 263.1500251 262.1155579 264.8568705 2.741312685
R507A.mix 233.1500237 233.1479196 235.6368096 2.488889966
R404A.mix 247.1500229 246.5116515 247.7053921 1.193740596
R404A.mix 247.038908 246.3999553 247.5892415 1.189286169
R404A.mix 246.1500249 245.5064014 246.6500922 1.143690836
R507A.mix 250.9341316 250.9245656 251.9898921 1.065326512
R404A.mix 243.1500264 242.4903483 243.366103 0.875754681
R507A.mix 235.6367987 235.6339113 236.4775308 0.843619451
R507A.mix 254.2611231 254.2498315 254.9242524 0.674420982
R507A.mix 240.9012428 240.8963585 241.5002823 0.603923744
R404A.mix 255.3500214 254.7530596 255.351379 0.598319337
R410A.mix 260.9278003 260.8323188 261.4154559 0.58313711
R507A.mix 254.9847256 254.9730511 255.5207537 0.547702564
R507A.mix 240.3722455 240.3675786 240.9012692 0.533690679
R507A.mix 240.2696508 240.2650255 240.7848147 0.519789221

Then we step through, using tSatVap and refrig as inputs, changing the "BICUBIC&REFPROP" backend string to "REFPROP" for the nontabular calculation:

for (int i = 0; i < tSatVap.Length; i++)
{
    AbstractState s = AbstractState.factory("BICUBIC&REFPROP", refrig[i]);
    s.update(input_pairs.QT_INPUTS, 1, tSatVap[i]);
    pSatLiq[i] = s.p();
    s.update(input_pairs.PQ_INPUTS, pSatLiq[i], 0);
    tSatLiqBicubic[i] = s.T();
}

Once this loop is complete, we have the tSatLiq***** outputs in the third and fourth columns above. As we see, the bubble point temperatures are lower than the dew point temperatures as calculated by Refprop directly (as we would expect), but higher than the dew point temperatures as calculated by the tabular backend (I've sorted the results by decreasing dT, the disparity between the Refprop and tabular result). I calculated with the TTSE backend as well, but the results were identical to those returned using the bicubic backend.

Using: January 11th nightly build of 5.1.2, C#.

@mapipolo mapipolo changed the title Tabular calcs with mixtures often return Dew T< Bubble T Tabular calcs with mixtures often return Dew T< Bubble T using PQ input pair Jan 13, 2016
@mapipolo
Copy link
Author

NOTE: Until a few minutes ago, the data in the above table was incorrectly entered. It has been edited to correct the errors.

@ibell
Copy link
Contributor

ibell commented Jan 14, 2016

Could this just be a result of the interaction parameters? Do CoolProp & REFPROP agree when you don't use tabular backends?

What version of REFPROP do you use? Do you use a custom HMX.BNC file?

@ibell
Copy link
Contributor

ibell commented Jan 14, 2016

Sorry forget my last comment - must be something with the interpolation, not the interaction parameters. Would be useful to just look at error in prediction of p for given T for these given fluids. So we can see where the problems start. Could do you that? Calculate dewpoint pressure for given dewpoint temperatures for these fluids?

@mapipolo
Copy link
Author

No problem. For bicubic, I ran this in a loop:

AbstractState s = AbstractState.factory("BICUBIC&REFPROP", refrigs[i]);
s.update(input_pairs.QT_INPUTS, 1, tSatVap[i]);
pSatVapBicubic[i] = s.p();
s.update(input_pairs.PQ_INPUTS, pSatVapBicubic[i], 0);
tSatLiqBicubic[i] = s.T();

And similarly for Refprop:

AbstractState s = AbstractState.factory("REFPROP", refrigs[i]);
s.update(input_pairs.QT_INPUTS, 1, tSatVap[i]);
pSatVapRefprop[i] = s.p();
s.update(input_pairs.PQ_INPUTS, pSatVapRefprop[i], 0);
tSatLiqRefprop[i] = s.T();

The results were as below (again, I've ignored TTSE because results were identical to bicubic):

refrig tSatVap pSatVapBicubic pSatVapRefprop tSatLiqBicubic tSatLiqRefprop dP dT
R440A.mix 233.150017 47550.00382 47541.78582 246.3096705 231.6475746 8.217998456 14.6620959
R407D.mix 233.1500186 70198.33488 70232.44298 233.2254995 226.3933816 34.10809874 6.832117836
R449A.mix 233.1500201 101305.9639 101325.111 233.4113896 227.4313526 19.14702065 5.980036991
R401A.mix 245.3722394 98637.09132 98640.82158 245.3913809 239.6272034 3.730263846 5.764177523
R404A.mix 226.1500205 94181.29423 94061.93947 229.6831741 225.3889674 119.3547581 4.29420675
R404A.mix 226.1500205 94181.29423 94061.93947 229.6831741 225.3889674 119.3547581 4.29420675
R404A.mix 231.4500081 121154.2973 121119.5991 234.3192037 230.7227298 34.69819676 3.596473883
R404A.mix 231.4833394 121341.2697 121307.1227 234.3405164 230.7562719 34.14703283 3.584244464
R404A.mix 232.155001 125157.622 125133.8304 234.7466609 231.4320517 23.79163436 3.314609206
R404A.mix 233.1500159 130984.2256 130975.2615 235.2648581 232.4331244 8.964092735 2.831733721
R440A.mix 263.1500251 182936.9578 182939.2217 264.8568705 262.1155579 2.263882957 2.741312685
R507A.mix 233.1500237 138654.8973 138661.6102 235.6368096 233.1479196 6.712901083 2.488889966
R404A.mix 247.1500229 237832.0631 237891.8519 247.7053921 246.5116515 59.78878533 1.193740596
R404A.mix 247.038908 236780.0902 236840.4144 247.5892415 246.3999553 60.32418061 1.189286169
R404A.mix 246.1500249 228492.9593 228557.0512 246.6500922 245.5064014 64.09188081 1.143690836
R507A.mix 249.8166787 277111.1911 277143.8853 250.9341432 249.8076771 32.69418687 1.126466057
R507A.mix 250.9341316 289209.2682 289233.4566 251.9898921 250.9245656 24.18845521 1.065326512
R404A.mix 243.1500264 202163.4786 202232.6175 243.366103 242.4903483 69.13891423 0.875754681
R507A.mix 235.6367987 154824.7331 154859.2576 236.4775308 235.6339113 34.52446542 0.843619451
R507A.mix 240.9012428 193913.1158 193978.3 241.5002823 240.8963585 65.18420171 0.603923744
R404A.mix 255.3500214 325902.3562 325904.7201 255.351379 254.7530596 2.363878097 0.598319337
R410A.mix 260.9278003 529947.282 529947.2369 261.4154559 260.8323188 0.045167093 0.58313711
R507A.mix 254.9847256 336464.3549 336462.1653 255.5207536 254.9730511 2.189518309 0.547702565
R507A.mix 240.3722455 189670.5954 189734.5299 240.9012692 240.3675786 63.93448419 0.533690679
R507A.mix 240.2696508 188856.2116 188919.8556 240.7848147 240.2650255 63.64403836 0.519789221

dP = abs(pSatVapBicubic - pSatVapRefprop)
dT = abs(tSatLiqBicubic - tSatLiqRefprop)

@mapipolo
Copy link
Author

If it's relevant, I'm using Refprop 9.12, the version that you provided at the beginning of last week.

@ibell
Copy link
Contributor

ibell commented Jan 17, 2016

I think I have mostly fixed these issues. Please confirm. It will never be perfect, but I think I made it much better.

@ibell ibell added this to the v5.1.3 milestone Jan 17, 2016
@mapipolo
Copy link
Author

It looks like your work was very effective. All discrepancies have been fixed to within an accuracy of 0.045°C. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants