Closed HightopRaven closed 6 months ago
Recently checked and now see that the NIST REFPROP FAQ page was updated 2021-Mar-29. The "NEWMIX.ZIP" file still does not include many of the newer refrigerant designations in ASHRAE 34-2019 and published addenda. (see https://pages.nist.gov/REFPROP-docs/#hfo-1234yf-1234zee-1234zez-1233zde-and-refrigerant-mixtures) Forces users to create their own user-defined mixtures, but many REFPROP users are not confident on how to do this or how much to trust the results. Seems like the refrigerant mixture files currently provided on the REFPROP FAQ page are from 2016 and prior. Version 10 released in mid-2018 does not include many of the newer refrigerant blends (particularly when a new suffix letter based on a pre-existing component combination where there are no new components).
That's a good point, I can update the file. That FAQ section was made for Refprop 9.1. All of the files there were incorporated into Refprop 10 when it was released three years ago. But you are right that new mixtures have been approved and we need to make them available. I'll zip them up and put them on the webpage in a day or so.
Any update as to when Refprop 10.1 will be released?
Or any update on when the NEWMIX.ZIP file will be updated to include all of the current mixtures with designations per ASHRAE 34-2019 (and published addenda) or ISO 817:2014 (and published amendments and Maintenance Agency updates) where the mixture contains fluid components available with REFPROP 10?
Nope, no proposed schedule for this. The MIX files are easy enough to put together, their structure is described in the README in the MIXTURES folder
We can make new MIX files ourselves, but one of the main reasons people use RefProp is the trust and confidence that the industry has in it. I'd guess most users of RefProp, like me, aren't expert enough to make an informed technical argument that its refrigerant properties are "right", but we can say that we use RefProp and that is the gold standard for the industry. "You don't have to trust us; trust the NIST RefProp team. They are the experts." If we make our own MIX files, we lose the ability to make that argument because it's not all coming from the experts. And that's important. I'm sure y'all are busy, but if you could find time to put out a new NEWMIX.ZIP file with as many of the new blends as you can readily support, it would be very helpful.
I could do that. It would include everything in the ASHRAE standard 34 at the nominal composition. But you should definitely NOT automatically trust REFPROP. Especially you should not automatically trust models for binary mixtures where estimation approaches are used. Our recent (open-access) paper demonstrates that quite clearly: https://doi.org/10.1021/acs.jced.1c00192
I agree with the comment from @paarfi , there are many REFPROP users with limited or no understanding of what happens under the hood inside the REFPROP engine. Even though users could create the files themselves, it would be useful to have periodic updates from NIST to provide new .MIX files, annually at a minimum. Perhaps the user community could support this in an open source fashion, first providing new .MIX files in an appropriate thread on Github to be peer reviewed prior to NIST releasing the files.
I also agree with @ianhbell , don't blindly trust REFPROP output for mixtures. Do your homework to understand the level of confidence that is appropriate.
This leads me to a new feature suggestion, perhaps more appropriate in another thread, that REFPROP should provide an uncertainty interval estimate for each property prediction (which would vary appropriately over a range of state conditions), reflecting the uncertainty in both the underlying property measurements and the model fit to the data. I can hear the groans already, because this would be a huge effort, but it would be a valuable means to communicate to users the level of trust to put in the REFPROP property outputs.
@HightopRaven - are you proposing to do the uncertainty estimation you suggest :) There have already been some efforts to do this with equation of state for pure fluids (https://pubs.acs.org/doi/abs/10.1021/acs.jced.9b00689, among others), but it is difficult to say the least. A key challenge is that most experimental uncertainty values should not be believed, and these uncertainty values are needed in any sort of uncertainty propagation approach. For estimation schemes, by definition we can't provide conclusive estimation of error. For mixtures, and even more so for supercritical mixtures, sometimes pressure deviations don't make sense, and other times composition uncertainty doesn't make sense. Handling this generically is close to impossible I would say, but would be, as you note, of great interest to those that are interested in more than a blindly-trusting REFPROP approach.
In summary, this problem is way harder than it sounds. That's not to diminish its importance, but to highlight the challenges inherent in what you propose.
@HightopRaven Yes, it would be good if we could at minimum provide the .MIX files in a more timely fashion. Let me see if I can get this together, I think I have all the mass compositions from ASHRAE34. I can make MIX files for all the binary mixtures in ASHRAE 34 where all constituents are in REFPROP, which will be all but a few.
I totally agree that RefProp is not perfect and should be used with a rational sense of caution. That applies to just about any engineering or scientific tool, and is something that (hopefully) all of us who use it directly understand. If it was perfect, then Ian, Eric, and the rest of the team would have worked themselves out of a job. My point was more towards the uses to which RefProp is often put. If you're using it rate the performance of a piece of equipment or a system, then the customer or salesperson involved in the sale of that equipment, or the person responsible for the equipment or system being modeled needs to have confidence in the results. Otherwise there is the temptation for everyone in the communication chain to add unnecessary extra safety factor, or to be constantly questioning things. One of the common ways those kinds of questions come up is by customers looking up refrigerant properties in old ashrae tables or off of refrigerant manufacturer websites, and then using that to try to poke holes in the original analysis. Being able to say that your calculations use the latest refrigeration property information from NIST RefProp is sufficient to answer those concerns 99% of the time. So even though we all know that no set of properties calculations is (or will ever be) perfect, the reputation of NIST RefProp allows us to provide confidence to those who don't understand all the underlying details, and that's important.
Here's a Python script to generate all the .MIX files:
import CoolProp.CoolProp as CP
import numpy as np
def get_std34():
lines = open('ASHRAE342019blends.txt','r').readlines()
mixes = []
for line in lines:
if 'must' in line: continue
entries = [l for l in line.split(' ') if l]
name, components, mass_composition = entries[0:3]
components = ['R'+ n.upper() for n in components[2::].split('/')]
mass_composition = [float(m) for m in mass_composition.lstrip('(').strip().rstrip(')').split('/')]
mixes.append({'name': name, 'components': components, "mass_composition": mass_composition})
return mixes
def get_addenda():
lines = open('ASHRAE342019addenda.txt','r').readlines()
mixes = []
for line in lines:
entries = [l for l in line.split(' ') if l]
addendum, name, components, mass_composition = entries[0:4]
components = ['R'+ n.upper() for n in components[2::].split('/')]
mass_composition = [float(m) for m in mass_composition.lstrip('(').strip().rstrip(')').split('/')]
mixes.append({'name': name, 'components': components, "mass_composition": mass_composition})
return mixes
def get_all():
mixes = get_std34() + get_addenda()
for m in mixes:
sumcomp = sum(m['mass_composition'])
if sumcomp not in [100.0]:
if (sumcomp-100) > 1e5:
print(sumcomp)
print(m)
raise ValueError()
return mixes
name_remapping = {
'R744': 'CO2',
'R290': 'PROPANE',
'R600': 'BUTANE',
'R600A': 'ISOBUTAN',
'R601': 'PENTANE',
'R601A': 'IPENTANE',
'R1270': 'PROPYLEN',
'RE170': 'DME',
'R170': 'ETHANE',
'R1336MZZ(Z)': 'R1336MZZZ',
'R1336MZZ(E)': 'R1336MZZE',
'R1234ZE(E)': 'R1234ZEE',
'R1130(E)': 'R1130E'
}
from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary
import os
RP = REFPROPFunctionLibrary(os.environ['RPPREFIX'])
def build_MIXes(mixes):
outlist = []
for m in mixes:
try:
components = [name_remapping.get(n,n) for n in m['components']]
ierr = RP.SETFLUIDSdll('*'.join(components))
asterisk = '' if ierr == 0 else ' !!warning: estimated parameters!!'
AS = CP.AbstractState('REFPROP', '&'.join(components))
AS.set_mass_fractions(np.array(m['mass_composition'])/100.0)
Ncomp = len(m['components'])
assert(Ncomp == len(m['mass_composition']))
xmolar = AS.get_mole_fractions()
molemass_kgkmol = AS.molar_mass()*1e3
AS.build_phase_envelope("")
rhoc_moldm3 = AS.rhomolar_critical()/1e3
Tc_K = AS.T_critical()
pc_kPa = AS.p_critical()/1e3
def deR(c):
if c.startswith('R'):
return c[1::]
else:
return c
headrow = 'R' + m['name'] + ' [R-' + '/'.join([deR(c) for c in components]) + ' (' + '/'.join([str(c) for c in m['mass_composition']]) + ')]'
header = f'{headrow}\n {molemass_kgkmol} {Tc_K} {pc_kPa} {rhoc_moldm3} \n {Ncomp}\n'
header += '\n'.join([c+'.FLD' for c in components]) + '\n'
header += '\n'.join([str(x) for x in xmolar]) + '\n '
header += str(0)
with open('R'+m['name']+'.MIX', 'w') as fp:
fp.write(header)
# print(header)
outlist.append('R'+m['name']+' ['+'/'.join([deR(c) for c in components])+']'+' (' + '/'.join([str(c) for c in m['mass_composition']]) + ' by mass)' +asterisk)
except BaseException as BE:
print(BE)
print(type(BE))
print('\n\n'.join(outlist))
build_MIXes(get_all())
And here is a zip: ASHRAE34blends.zip
I maybe need to do a little bit more debugging before I am 100% confident, but spot checks so far are promising
The FAQ (https://pages.nist.gov/REFPROP-docs/) has not been updated since 2019-May-11. Are there any updates to REFPROP v10 available to all users or the general public? (whether mixture files for new refrigerant mixture designations from ASHRAE Standard 34-2019 and published addenda, or new mixing parameters in HMX.BNC, and so on) Are there any tentative plans for v10.x?