usnistgov / REFPROP-issues

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

Strange mixture properties calculated in REFPROP 10 #420

Closed siwolga closed 3 years ago

siwolga commented 3 years ago

Description

Below see the figure, where two fluids are edged in red, the composition differs only in the presence of 0.5% water ("Fluid 1 Simple" and "Fluid 1 Simple with water"). But the properties differ significantly. For example, the quality of the fluid without water is 0.566, and when 0.5% of water is added to the composition, it is 0.998 at the same temperature and pressure.

unnamed

We doubt that adding only 0.5% water can drastically change the properties of the fluid. How reliable is such a result?

Expected behavior: similar quality with the addition of 0.5% water

Actual behavior: very different quality

Versions

REFPROP Version: [REFPROP 10.0]
Operating System and Version: [Win10]
Access Method: [Excel]

ianhbell commented 3 years ago

Yes, water can change the phase equilibria dramatically, even a very small amount of water. I would look at phase envelopes (more correctly: isopleths of the phase envelope) of the mixture with and without water to get a sense for it.

siwolga commented 3 years ago

I tried to build the isolines in hs coordinates for the same ranges directly in the REFPROP interface. without water on the left, with 0.5% water on the right. As far as I understand, no condensation is observed in the presence of water in this range?

Screenshot_1

And this is the result when trying to build quality lines in PT coordinates (without water on the left, with water on the right)

Screenshot_2

It seems that the solver does not converge in the presence of water. Can you comment on whether such a difference in properties can be expected?

ianhbell commented 3 years ago

Can you please remake the figures with the same axis scales so we can have a fair side-by-side comparison?

A little bit of water goes a long ways...

siwolga commented 3 years ago

hs-comp

PT-comp

I will also give the contents of the fluid files:

Fluid1_WithWater 34.9427740314242 0 0 0 9 METHANE.FLD ETHANE.FLD PROPANE.FLD ISOBUTAN.FLD BUTANE.FLD IPENTANE.FLD PENTANE.FLD WATER.FLD CO2.FLD .351545869234668 .164521033958439 .270755195134313 4.04460212873796E-02 .130663963507349 1.34820070957932E-02 .012772427774962 4.56158134820071E-03 1.12519006588951E-02 0

Fluid1_Simple 35.0203440692464 347.806457399162 8422.73912233062 6.91286046691827 8 METHANE.FLD ETHANE.FLD PROPANE.FLD ISOBUTAN.FLD BUTANE.FLD IPENTANE.FLD PENTANE.FLD CO2.FLD .353156822810591 .165274949083503 .271995926680244 4.06313645621181E-02 .131262729124236 1.35437881873727E-02 1.28309572301426E-02 1.13034623217923E-02 0

nist-aharvey commented 3 years ago

At the conditions of the calculation, probably the true thermodynamic equilibrium for the system with 0.5% H2O will include two liquid phases: a liquid water phase and a liquid hydrocarbon phase. REFPROP does not calculate liquid-liquid equilibria, and will give unpredictable results if you try to use it for a system that exhibits LLE.

ianhbell commented 3 years ago

@nist-aharvey is probably right, which fits in the "a little bit of water goes a long way" response to thermodynamic modeling question.

nist-aharvey commented 3 years ago

Another thing is that REFPROP is not optimized to be reliable for hydrocarbon-water mixtures, even if there is no LLE. I just tried a sample calculation at the T and P of this question with mole fractions 0.995 methane and 0.005 water (to eliminate the liquid hydrocarbon phase), and got a result that is clearly physically wrong (everything remaining in the gas phase). It fails to find the equilibrium liquid water phase, while a back-of-the-envelope calculation aided by steam tables indicates that 50-60% of the water should condense.

ianhbell commented 3 years ago

@nist-aharvey for posterity, can you provide your back-of-the-envelope calculation please?

nist-aharvey commented 3 years ago

@ianhbell Sure, although now I wish I hadn't shut down my copy of REFPROP. Easy enough to re-do.

I made the mixture as described (I can't tell from the original issue whether compositions are molar or mass; I used molar but for CH4/H2O there is not much difference). Turned on some extra properties to display, like fugacity, fugacity coefficient, phase, quality, and composition.

Phase equilibrium occurs when the fugacity in the liquid phase equals that in the vapor phase for each component (water is the component of interest here). If for a given condition the fugacity of water in the vapor is greater than that of the equilibrium liquid, it will condense out until the fugacity of water in the vapor is as low as that of the equilibrium liquid (this is a rough description of rain). For a hydrocarbon-water mixture, the solubility of methane in water is so small that we can consider a pure liquid water phase. According to the steam tables, the vapor pressure of pure water at 32.2 degC is about 4.8 kPa. That's a low enough pressure that the water vapor will be nearly ideal, so we can also take that as the fugacity (If I wanted to be more rigorous, I could use REFPROP to calculate the fugacity of the pure water). For the vapor phase, the calculation of that mixture in REFPROP at 32.2 degC and 2378.69 kPa yields a water fugacity of 10.55 kPa (fugacity coefficient 0.887, so a little nonideal). 10.55 is larger than 4.8, so at equilibrium enough water should condense out of the vapor to lower the fugacity of water in the vapor to 4.8 kPa. To a rough approximation, the fraction condensed would be (10.55-4.8)/10.55.

siwolga commented 3 years ago

Thanks for the analysis! So, I can draw the following conclusion: it is better to remove this 0.5% of the water from the composition to get more adequate results. Right?

nist-aharvey commented 3 years ago

I suppose it depends on what you mean by "adequate". Taking the water out of the calculation should cause REFPROP to give a well-converged answer. But if the real-life situation you are trying to model has the water present, that well-converged answer will omit the liquid water phase that would be present in reality, which could be significant in a process.

siwolga commented 3 years ago

Sorry, I am an uninitiated person in these matters, it is a little bit difficult for me to understand your previous answer about fugacity. The addition of 0.5% water to the mixture leads to the fact that at the same temperature and pressure the quality increases from 0.566 to 0.998 in REFPROP. In one of the previous answers, you mentioned "REFPROP does not calculate liquid-liquid equilibria, and will give unpredictable results if you try to use it for a system that exhibits LLE". Whether such quality does or not in real life, that’s my main question. Does this value arise because REFPROP is not intended for calculating such mixtures, or can I rely on this result? Because the presence or absence of a 40% liquid phase is very important when designing real equipment.

ianhbell commented 3 years ago

You cannot rely on REFPROP to give the right result for these mixtures containing water, even a small amount of water. As Allan writes, a phase split is likely, which will dramatically alter what you have in your system.

siwolga commented 3 years ago

Many thanks!