Skip to content

Extending EoS capabilities #280

@JelleLagerweij

Description

@JelleLagerweij

Dear all,
I am a PhD in the Engineering Thermodynamics group at the TU Delft. We mostly work on molecular simulations with Monte Carlo and molecular dynamics simulations in Fortran and C++. In my free time, I am learning Rust (I just finished coding my own LJ Monte Carlo program for fun) and came across this package because an office mate was using FeOs. He is using FeOs (from the python side) for phase equilibrium predictions of multi-component mixtures, where he computes among others spinodal lines.

Besides FeOs he is using Refprop and the GERG-2008 EoS (doi: 10.1021/je300655b) and asked me if it would be possible to implement this EoS as well into FeOs. I looked into the Peng-Robinson implementation (python example in the tutorial and the Rust code in the feos-core crate) and in the half hour I spend on it, it seems that FeOs requires Helmholtz free energy functions for correct predictions of its state. This is similar to GERG-2008, although that is a multivariable empirical relation instead of something as elegant and simple as the already implemented PR EoS. I propose the following process, as I have mediocre experience in Rust:

  • I implement and test the cubic equations of states first in python to check if I have proper understanding of what I am doing.
  • I implement additional cubic equation of states first to get some Rust practice. I went through the code and expect that I would not have too many problems in implementing the VdW and SRK EoSs for single and multi-component fluids.
  • When that is implemented and merged successfully in the main FeOs branch, I will start on implementing empirical Helmholtz free energy models such as GERG-2008 and maybe IAPWS95.

For this, I would need the following from the FeOs maintainers:

  • Some instructions on structure, styling, and testing guidelines in FeOs (as to integrate it well).
  • Are there other dependencies and requirements besides those mentioned on the prerequisite page in the documentation or included in the Cargo.toml files? (maybe there is some C++ Makefile trauma speaking here :) .)
  • Besides the: feos/crates/feos-core/src/cubic.rs, which other files should be changed to produce all required python bindings and such?
  • And connected to that. Why are the cubic EoS rust files in the src root directory and not in the equation_of_state subdirectory like the ideal gas law?
  • While I have some ideas already on how VdW and SRK can be implemented, I expect more issues with the GERG model. Do you foresee pitfalls for such empirical models, and can you give some advises on how to approach it?

I believe that FeOs would get the following gains from this proposal:

  • Having extensive, fast cubic EoS support might attract CFD crates to use FeOs for the prediction of fluid properties during simulations. Compressible CFD simulations require good and most of all fast EoS predictions for density, heat capacity and viscosity. I believe that FeOs can be attractive for such programs when there are more cubic equations of state to choose from.
  • When GERG-2008 is implemented, FeOs can claim that it can compute fluid properties compliant with the ISO 20765-2/3 standard. Scientifically, I do not see too much value in this, however, it might make FeOs suitable for usage in industry.

I cannot work on this project professionally, as my PhD is about computing transport properties in complex aqueous salt mixtures and I do not intend to use FeOs for my own projects. However, I think I can learn aplenty from this side project (especially regarding traits) and I am willing to spend some evenings on it.

Would you guys be interested in such extensions to FeOs?
Kind regards,
Jelle Lagerweij

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions