Closed Yili-Zhang closed 5 years ago
Nice post; you're really getting the hang of it! Can you please fill out the entire template in the future? I made your example formatted nicer, see my edits to see the changes.
Some notes:
1) We have had some issues with caching with mixture compositions, and you may have run into another bug with that. Usually the problem arises when the composition is on a mass-fraction, but in your case, you are using a mole fraction, so I don't think it is the same bug, but it could be another related bug. REFPROP is maybe getting confused because you passed a composition in the string and in the slot for z.
2) I note that you trust that the ierr
codes are always zero, but you should check after every single call to REFPROPdll
to ensure that ierr
is either zero or less than 100. Maybe you have an error in one of the calls? Particularly the first call?
3) Do you believe the mixture model for methanol + ethanol? I'm not totally sure that I do. This mixture should be quite ideal, but the model for this system is probably too simple to yield highly accurate predictions of mixture behavior. So watch out, and be cautious with any conclusions you make based on this model.
?Methanol/Ethanol [MEO/ETO]
?T.M. Blackham and E.W. Lemmon, NIST (2010)
c41aa690/3d5f67e0
XR0 1. 0.999 1. 1.012 0. 0. 0. 0. 0. 0. 0. 0.
TC1 -0.013455912 0.55791296 -0.92403449 2.6625274 -2.372638 0.897343 0. 0. 0. 0. 0. 0.
VC1 0.0015400039 0.00099950601 0.016948491 -0.054484426 0.077497449 -0.033556216 0. 0. 0. 0. 0. 0.
Hi ,
Thank you very much for your quick reply!
By " fill out the entire template", do you mean fill out:
REFPROPdll(hFld, hIn, hOut, iUnits, iMass, iFlag, a, b, z, Output, hUnits, iUCode, x, y, x3, q, ierr, herr, hFld_length, hIn_length, hOut_length, hUnits_length, herr_length)
?
If that were the case, I would love to do that. However, there is not any example about it (filling out all the parameter), and it would be very challenging to me for I don't even know what data type to be used...Therefore, if you could provide me a couple examples. it would be very helpful!
Furthermore, in term of your notes, I am mostly confused:
I don't quite understand what you mean by "REFPROP is maybe getting confused because you passed a composition in the string and in the slot for z". If my current pass for z were incorrect. what could be the potentially correct ones? May you give me some hints or examples?
For checking with the ierr
, again, I need a complete example for filling out the entire subroutine in order to be able to edit on that.
The reason why our team chose NIST is based on lots of paper reading in the thermodynamic fields, and almost all the mixture fluids are tested with NIST RefProp. So, we assumes this software is the authority in this area. However, combined with your statements, I am confused about the level of reliability of this software?
Thanks,
-Yili
Nope, by template, I mean that when you start a new issue on github, there are a set of common pieces of information we need, like operating system, version of REFPROP, how you are calling it, what errors you get, etc. You just deleted the entire template, rather than filling in the relevant information.
When you call the REFPROPdll function, a structure (class) is returned, and you can access the value of ierr
, see the example here: https://nbviewer.jupyter.org/github/usnistgov/REFPROP-wrappers/blob/master/wrappers/python/notebooks/Tutorial.ipynb#Use
A clarification: NIST is the National Institute of Standards and Technology, REFPROP is the software tool that you are using. Mixture models are empirical, and fit to experimental data. For some mixtures, there is very limited experimental data available, and therefore, we can only build as reliable a model as the data will allow. I don't know what data were used to build the mixture model for methanol + ethanol, but you are considering a mixture model of two problematic equations of state, which is never a good starting point.
Hi Lan,
Thanks for your reply. I have been busy and sorry for the late reply.
I recently encountered another problem with RefProp in MatLAB, and the debug leads to the source of issue as the reference point of enthalpies in the model are not consistent between different fluids.
From the https://refprop-docs.readthedocs.io/en/latest/DLL/highlevel.html#f//REFPROPdll website, I found the "SETREF" command under the "subroutine RefPROPdll". However, I have hard time on programming it specifically in MatLAB. Will you give me a explicit example, please?
Thanks, -Yili
Good question! I added a section to the Python tutorial: https://github.com/usnistgov/REFPROP-wrappers/blob/master/wrappers/python/notebooks/Tutorial.ipynb (see the section at the end on reference states)
Has this issue been resolved? If so, could you close this thread?
Hi Eric,
Unfortunately, no. Sorry about it. We might need more time.
-Yili
On Mon, May 13, 2019 at 7:20 AM Eric Lemmon notifications@github.com wrote:
Has this issue been resolved? If so, could you close this thread?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/usnistgov/REFPROP-wrappers/issues/109?email_source=notifications&email_token=AHEBAGLWF6V4OREM3PDI67DPVFTJTA5CNFSM4HAR2MRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVIJBMQ#issuecomment-491819186, or mute the thread https://github.com/notifications/unsubscribe-auth/AHEBAGJVE6RV6H4E64WGU2LPVFTJTANCNFSM4HAR2MRA .
Hi all,
The Matlab Refprop installed in my windows computer works well for pure working fluids. However, it never returns correct solutions when the working fluids is mixture. In addition, it returns different solutions if I run exact same code twice when the working fluid is mixture. For example, When the working fluid is:
hFld='Methanol;0.5;Ethanol;0.5';
The first law efficiency it returns is same as when the working fluid is pure:hFld='Methanol';
And if I run the code with mixture fluids twice, the first law efficiency it returns are totally different. Just for the readers' reference, here is the complete code:Moreover, by following this API website: https://refprop-docs.readthedocs.io/en/latest/DLL/highlevel.html#f//REFPROPdll, the MASS SI unit system's iUnits number is 0 instead of 2 shown in the website. Actually, after a few test, it turned out that only when the iUnits number is "0", the unit system is valid.
Looking forward to hearing suggestions!
Thanks a lot,
-Yili