Abstract

In this work, we present an open-source software package, referred to as FeOs─Framework for Equations of State and Classical Density Functional Theory. FeOs is a collection of interfaces and data types that can be used (1) to implement thermodynamic equations of state and Helmholtz energy functionals for classical density functional theory, and (2) to compute thermodynamic properties of pure substances and mixtures, phase equilibria, and interfacial properties such as surface tensions and adsorption isotherms. The framework is written in the Rust programming language with a complete Python interface and is designed with a focus on usability and extensibility. It is openly available on GitHub (https://github.com/feos-org/feos). Equations of state can be implemented in Rust, yielding performant code, or as a Python class, which is useful for prototyping and with less emphasis on execution speed. In both cases, the user has to implement a single function: the Helmholtz energy. FeOs then uses generalized (hyper-) dual numbers to evaluate the Helmholtz energy as well as the required exact partial (higher-order) derivatives. Using this type of automatic differentiation delivers performance without the need for implementing any analytical derivatives. The performance is further enhanced by a caching mechanism that avoids duplicate model evaluations. Together with the core interfaces and functionalities for equations of state and classical density functional theory, we provide implementations for multiple models such as the PC-SAFT equation of state (with homo- and heterosegmented group contribution methods) and Helmholtz energy functionals (including segment-based functionals). To showcase a selection of FeOs’ features, an example study of the adsorption of biogas in porous media using the PC-SAFT functional is provided.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call