usnistgov / REFPROP-issues

A repository solely used for reporting issues with NIST REFPROP
26 stars 13 forks source link

HMX is required to have .BNC file extension #476

Open ianhbell opened 3 years ago

ianhbell commented 3 years ago

There are a few issues:

1) When passing absolute paths to HMX.BNC file, it appears the file must have the .BNC extension. 2) In 10.0.0+, if absolute paths are passed to HMX.BNX and the fluid files, estimation scheme is not applied properly, and subsequent calls are unable to set the interaction parameters: 3) In development version, no warning is returned about estimated parameters: https://github.com/usnistgov/REFPROP-tests/commit/27bb3b4c40c95a9f7e7215af813c645889b3668a . Also the estimated parameters are incorrect.

import os

from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary
RProot = os.environ['RPPREFIX']

RP = REFPROPFunctionLibrary(RProot)
print('REFPROP version:', RP.RPVersion())
here = os.path.abspath(os.path.dirname(__file__))
assert(os.path.exists(here+'/FLUIDS/HMXBAG.BNC'))
r0 = RP.SETUPdll(2, here+'/FLUIDS/'+'R152A.FLD;'+here+'/FLUIDS/R1234YF.FLD', here+'/FLUIDS/HMXBAG.BNC', 'DEF')
print(r0)
print(RP.GETKTVdll(1,2))

yields (in development)

REFPROP version: 10.0.1.16
SETUPdlloutput(ierr=0, herr='')
GETKTVdlloutput(hmodij='XR0', fij=array('d', [1.0, 1.0, 1.0, 1.0, 0.0, 0.0]), hFmix='estimated by ESTBNC', hfij='', hbinp='Mixture data have not been fitted for this binary pair; the mixing parameters have been estimated with the method of Lemmon and McLinden (2001).', hmxrul='')

and in version 10.0.0

REFPROP version: 10.0.0.02
SETUPdlloutput(ierr=-117, herr='[SETUP warning -117] Mixture data have not been fitted for one or more binary pairs in the specified mixture; the mixing parameters have been estimated.')
GETKTVdlloutput(hmodij='XR0', fij=array('d', [1.0, 1.0, 1.0, 1.0, 0.0, 0.0]), hFmix='estimated by ESTBNC', hfij='', hbinp='Mixture data have not been fitted for this binary pair; the mixing parameters have been estimated.', hmxrul='')
ianhbell commented 3 years ago

And if I try to set the interaction parameters, it doesn't change the values or yield an error:

import os

from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary
RProot = os.environ['RPPREFIX']

RP = REFPROPFunctionLibrary(RProot)
print('REFPROP version:', RP.RPVersion())
here = os.path.abspath(os.path.dirname(__file__))
r0 = RP.SETUPdll(2, here+'/FLUIDS/'+'R1234YF.FLD;'+here+'/FLUIDS/R152A.FLD', here+'/FLUIDS/HMXBAG.BNC', 'DEF')
print(r0)
ktv = RP.GETKTVdll(1,2)
print(ktv)
ktv.fij[0] = -1
# ktv.fij[1] = -1
print(ktv)
sktv = RP.SETKTVdll(1, 2, ktv.hmodij, ktv.fij, ktv.hFmix)
print(sktv)
ktvnew = RP.GETKTVdll(1,2)
print(ktvnew)

yielding

REFPROP version: 10.0.1.16
SETUPdlloutput(ierr=0, herr='')
GETKTVdlloutput(hmodij='XR0', fij=array('d', [1.0, 1.0, 1.0, 1.0, 0.0, 0.0]), hFmix='estimated by ESTBNC', hfij='', hbinp='Mixture data have not been fitted for this binary pair; the mixing parameters have been estimated with the method of Lemmon and McLinden (2001).', hmxrul='')
GETKTVdlloutput(hmodij='XR0', fij=array('d', [-1.0, 1.0, 1.0, 1.0, 0.0, 0.0]), hFmix='estimated by ESTBNC', hfij='', hbinp='Mixture data have not been fitted for this binary pair; the mixing parameters have been estimated with the method of Lemmon and McLinden (2001).', hmxrul='')
SETKTVdlloutput(ierr=0, herr='')
GETKTVdlloutput(hmodij='XR0', fij=array('d', [1.0, 1.0, 1.0, 1.0, 0.0, 0.0]), hFmix='estimated by ESTBNC', hfij='', hbinp='The binary parameter(s) for (R1234yf+R152a) have been modified from their original values.', hmxrul='')