usnistgov / REFPROP-issues

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

REFPROP ver.10 (PHFLSH error 248, Ethylene glycol and water) #587

Open StoneRockSteel opened 1 year ago

StoneRockSteel commented 1 year ago

I’ve tried to find the thermal properties of ethylene glycol and water mixture. There seem to be problem with getting the properties of the mixture fluid. The procedure I’ve done is like below.

Mixture: Ethylene glycol (50%), Water(50%) (Mass % base)

First, call enthalpy with pressure and temperature. (P: 3.5barg, T: 11degC, Result h: -217.52kJ/kg)

And next,, call temperature with pressure and enthalpy. (Here, enthalpy come from above the value.) However, there is error message (PHFLSH error248) and I can’t get the pressure value with temperature and enthalpy. (P: 3.5barg, h: -217.52kJ/kg, Result T: [PHFLSH error 248] Single-phase iteration did not converge for P=0.350000MPa and H=-6074.36J/mol.)

How can I get the correct property value of the ethylene glycol and water mixture?

Versions

REFPROP Version: REFPROP ver.10 Operating System and Version: Windows10 64bit **Access Method: EXCEL/VBA

ianhbell commented 1 year ago

Make sure you enable saturation splines with the calls in the VBA code

StoneRockSteel commented 1 year ago

Yes. I'm struggling to find the Eglycol water mixture temperature with pressure and enthalpy depending on your advice. However, I still have a problem with getting the properties of the Eglycol water mixture. P: 2.5barg, T: 10degC -> h: -518.276kJ/kg enthalpy difference: -66.842kJ/kg And then, P: 1barg, h: -585.118kJ/kg -> T: #VALUE! (In other thermal property calculation program, T: -10.01degC)

How can I solve this problem?

nist-aharvey commented 1 year ago

As a first step, I would try seeing if the "easier" calculation of the final state as a function of T and P worked -- input T=-10 degC and p=1 barg and see if you get near the expected enthalpy. If that calculation works, that means that the problem is in the convergence of the iterative routine that solves as a function of (p,h). @ianhbell may have suggestions for helping that. You might also try using mole fractions for your mixture (that is the natural measure for mixture thermodynamics that REFPROP uses internally); I believe there are a few cases where mass fractions are not handled correctly in REFPROP 10.0.

@ianhbell -- I sort of doubt that saturation splines would help (although it is worth trying), since the liquid mixture as described is not anywhere close to the V/L saturation boundary.

ianhbell commented 1 year ago

I agree, this seems like a bug in REFPROP. I tried to do the calls to REFPROP via CoolProp because CoolProp handles the mass fractions properly, but got the same bug. Python:

import CoolProp.CoolProp as CP 
import os
os.environ['RPPREFIX'] = os.getenv('HOME')+'/REFPROP10'

CP.set_config_string(CP.ALTERNATIVE_REFPROP_PATH, os.getenv('RPPREFIX'))

AS = CP.AbstractState('REFPROP','EGLYCOL&WATER')
AS.set_mass_fractions([0.5, 0.5])
AS.update(CP.PT_INPUTS, 3.5e5+101325, -11+273.15)
print(AS.hmass())

AS.update(CP.HmassP_INPUTS, AS.hmass(), AS.p())
print(AS.T())

-287615.25259259256
Traceback (most recent call last):
  File "/Users/ihb/Desktop/issues/import CoolProp.py", line 12, in <module>
    AS.update(CP.HmassP_INPUTS, AS.hmass(), AS.p())
  File "CoolProp/AbstractState.pyx", line 102, in CoolProp.CoolProp.AbstractState.update
  File "CoolProp/AbstractState.pyx", line 104, in CoolProp.CoolProp.AbstractState.update
ValueError: HmolarPmolar: One or more inputs are out of range; Temperature below triple-point or minimum temperature: T = 193.784 K, Tmin = 239.401 K; Density above upper limit: D = 50.1240 mol/L, Dmax = 48.7256 mol/L.