Advanced Thermodynamics

advancedthermo.com

Thermodynamic properties of natural gas mixtures containing helium - Part 9a

15 August 2021

This is Part 9a of a series.

In Part 9, I applied some external tools to the problem of flashing mixtures containing helium. I mentioned that I had exhausted the options readily available. However, I happened upon two julia packages that are worth examining.

The first one is Clapeyron.jl (view on GitHub — known formerly as OpenSAFT.jl). An example of calculating with the GERG-2008 EOS [1] looks like:


    using Clapeyron
    model = Clapeyron.GERG2008(["nitrogen", "helium"])
    ρ = inv(Clapeyron.volume(model, 1.e4, 300, [0.7, 0.3]))
    p = Clapeyron.pressure(model, inv(1.e3), 300, [0.7, 0.3])
Other features of the API are described in the documentation. For the few examples I tried, the calculated values differed from TREND 4.0 [2] by a bit more than the values calculated with my implementation. I think it would be relatively easy to track down the reason for the discrepancy if one were inclined. However, although the package does contain a user friendly implementation of the GERG-2008 EOS [1], the documentation explains that
"Mixture VLE properties are currently in development"
meaning that the package is not currently able to solve the flash problems of interest in this series.

The second package I came across is ThermoModels.jl which is by one of the contibutors to Clapeyron.jl. It implements the GERG-2008 EOS [1] and has a flash routine so I can test its ability to flash mixtures containing helium. The method of installation is described on the GitHub page but note that to perform a flash it will also be necessary to install ThermoState.jl by the same author. The documentation is a bit sparse but it wasn't hard to guess the following input based on the examples provided:


    using ThermoModels, ThermoState
    model = ThermoModels.GERG2008(:CH4, :He)
    st = ThermoState.state(t=90, p=2e6, xn=[0.5,0.5])
    result = ThermoModels.equilibria(model,st)
Unfortunately, this leads to an error:

    weird, v₁ =0.02460000000000001 and v₀ =0.02460000000000001
    ERROR: ArgumentError: the the vector of values is not a valid fraction
which looks like it might be a failure in the volume root solver. I tried two other flash cases where I already have a solution from TREND 4.0 (see AdvancedThermo/test/runtests.jl) and they also resulted in errors. So, although this package implements the GERG-2008 EOS and has a flash routine, it seems like it hasn't been thoroughly tested and is also unsuitable for the task I'm trying to solve.

Discussion

Clearly, flashing mixtures containing helium is challenging. None of the three flash solvers I've tried have proven reliable enough to do the job. As mentioned last time, I'll resume this series once I have access to a reliable flash solver.

References

[1] Kunz and Wagner, J. Chem. Eng. Data, 2012, 57, 3032 (link to publisher)

[2] Span et al., TREND. Thermodynamic Reference and Engineering Data 4.0. Lehrstuhl für Thermodynamik, Ruhr-Universität Bochum, 2019

Go to Home How to cite this page Permalink to this page