feos


Namefeos JSON
Version 0.6.1 PyPI version JSON
download
home_pagehttps://github.com/feos-org
SummaryFeOs - A framework for equations of state and classical density functional theory.
upload_time2024-01-11 16:35:13
maintainer
docs_urlNone
authorGernot Bauer <bauer@itt.uni-stuttgart.de>, Philipp Rehner <prehner@ethz.ch>
requires_python
licenseMIT OR Apache-2.0
keywords physics thermodynamics equations_of_state phase_equilibria
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # FeOs - A Framework for Equations of State and Classical Density Functional Theory

[![crate](https://img.shields.io/crates/v/feos.svg)](https://crates.io/crates/feos)
[![documentation](https://docs.rs/feos/badge.svg)](https://docs.rs/feos)
[![documentation](https://img.shields.io/badge/docs-github--pages-blue)](https://feos-org.github.io/feos/)
[![repository](https://img.shields.io/pypi/v/feos)](https://pypi.org/project/feos/)

The `FeOs` package provides Rust implementations of different equation of state and Helmholtz energy functional models and corresponding Python bindings.

```python
from feos.eos import EquationOfState, State
from feos.pcsaft import PcSaftParameters, PcSaftRecord

# PC-SAFT parameters for methanol (Gross and Sadowski 2002)
record = PcSaftRecord(1.5255, 3.23, 188.9, kappa_ab=0.035176, epsilon_k_ab=2899.5, na=1, nb=1)

# Build an equation of state
parameters = PcSaftParameters.from_model_records([record])
eos = EquationOfState.pcsaft(parameters)

# Define thermodynamic conditions
critical_point = State.critical_point(eos)

# Compute properties
p = critical_point.pressure()
t = critical_point.temperature
print(f'Critical point for methanol: T={t}, p={p}.')
```
```terminal
Critical point for methanol: T=531.5 K, p=10.7 MPa.
```

## Models
The following models are currently published as part of the `FeOs` framework

|name|description|eos|dft|
|-|-|:-:|:-:|
|`pcsaft`|perturbed-chain (polar) statistical associating fluid theory|✓|✓|
|`gc-pcsaft`|(heterosegmented) group contribution PC-SAFT|✓|✓|
|`pets`|perturbed truncated and shifted Lennard-Jones mixtures|✓|✓|
|`uvtheory`|equation of state for Mie fluids and mixtures|✓||
|`saftvrqmie`|equation of state for quantum fluids and mixtures|✓|✓|

The list is being expanded continuously. Currently under development are implementations of ePC-SAFT and a Helmholtz energy functional for the UV theory.

Other public repositories that implement models within the `FeOs` framework, but are currently not part of the `feos` Python package, are

|name|description|eos|dft|
|-|-|:-:|:-:|
|[`feos-fused-chains`](https://github.com/feos-org/feos-fused-chains)|heterosegmented fused-sphere chain functional||✓|

## Parameters
In addition to the source code for the Rust and Python packages, this repository contains JSON files with previously published [parameters](https://github.com/feos-org/feos/tree/main/parameters) for the different models including group contribution methods. The parameter files can be read directly from Rust or Python.

## Properties and phase equilibria

The crate makes use of [generalized (hyper-) dual numbers](https://github.com/itt-ustutt/num-dual) to generically calculate exact partial derivatives from Helmholtz energy equations of state. The derivatives are used to calculate
- **equilibrium properties** (pressure, heat capacity, fugacity, and *many* more),
- **transport properties** (viscosity, thermal conductivity, diffusion coefficients) using the entropy scaling approach
- **critical points** and **phase equilibria** for pure components and mixtures.

In addition to that, utilities are provided to assist in the handling of **parameters** for both molecular equations of state and (homosegmented) group contribution methods and for the generation of phase diagrams for pure components and binary mixtures.

## Classical density functional theory

`FeOs` uses efficient numerical methods to calculate density profiles in inhomogeneous systems. Highlights include:
- Fast calculation of convolution integrals in cartesian (1D, 2D and 3D), polar, cylindrical, and spherical coordinate systems using FFT and related algorithms.
- Automatic calculation of partial derivatives of Helmholtz energy densities (including temperature derivatives) using automatic differentiation with [generalized (hyper-) dual numbers](https://github.com/itt-ustutt/num-dual).
- Modeling of heterosegmented molecules, including branched molecules.
- Functionalities for calculating surface tensions, adsorption isotherms, pair correlation functions, and solvation free energies.

## Cargo features

Without additional features activated, the command
```
cargo test --release
```
will only build and test the core functionalities of the crate. To run unit and integration tests for specific models, run
```
cargo test --release --features pcsaft
```
to test, e.g., the implementation of PC-SAFT or
```
cargo test --release --features all_models
```
to run tests on all implemented models.

## Python package

`FeOs` uses the [`PyO3`](https://github.com/PyO3/pyo3) framework to provide Python bindings. The Python package can be installed via `pip` and runs on Windows, Linux and macOS:

```
pip install feos
```

If there is no compiled package for your system available from PyPI and you have a Rust compiler installed, you can instead build the python package from source using

```
pip install git+https://github.com/feos-org/feos
```

This command builds the package without link-time optimization (LTO) that can be used to increase the performance further.
See the *Building from source* section for information about building the wheel including LTO.

### Building from source

To compile the code you need the Rust compiler and `maturin` (>=0.13,<0.14) installed.
To install the package directly into the active environment (virtualenv or conda), use

```
maturin develop --release
```

which uses the `python` and `all_models` feature as specified in the `pyproject.toml` file.

Alternatively, you can specify the models or features that you want to include in the python package explicitly, e.g.

```
maturin develop --release --features "python pcsaft dft"
```

for the PC-SAFT equation of state and Helmholtz energy functional.

To build wheels including link-time optimization (LTO), use

```
maturin build --profile="release-lto"
```

which will use the `python` and `all_models` features specified in the `pyproject.toml` file.
Use the following command to build a wheel with specific features:

```
maturin build --profile="release-lto" --features "python ..."
```

LTO increases compile times measurably but the resulting wheel is more performant and has a smaller size.
For development however, we recommend using the `--release` flag.

## Documentation

For a documentation of the Python API, Python examples, and a guide to the underlying Rust framework check out the [documentation](https://feos-org.github.io/feos/).

## Benchmarks

Check out the [benches](https://github.com/feos-org/feos/tree/main/benches) directory for information about provided Rust benchmarks and how to run them.

## Developers

This software is currently maintained by members of the groups of
- Prof. Joachim Gross, [Institute of Thermodynamics and Thermal Process Engineering (ITT), University of Stuttgart](https://www.itt.uni-stuttgart.de/)
- Prof. André Bardow, [Energy and Process Systems Engineering (EPSE), ETH Zurich](https://epse.ethz.ch/)

## Contributing

`FeOs` grew from the need to maintain a common codebase used within the scientific work done in our groups. We share the code publicly as a platform to publish our own research but also encourage other researchers and developers to contribute their own models or implementations of existing equations of state.

If you want to contribute to ``FeOs``, there are several ways to go: improving the documentation and helping with language issues, testing the code on your systems to find bugs, adding new models or algorithms, or providing feature requests. Feel free to message us if you have questions or open an issue to discuss improvements.

## Cite us

If you find `FeOs` useful for your own scientific studies, consider citing our [publication](https://pubs.acs.org/doi/full/10.1021/acs.iecr.2c04561) accompanying this library.

```
@article{rehner2023feos,
  author = {Rehner, Philipp and Bauer, Gernot and Gross, Joachim},
  title = {FeOs: An Open-Source Framework for Equations of State and Classical Density Functional Theory},
  journal = {Industrial \& Engineering Chemistry Research},
  volume = {62},
  number = {12},
  pages = {5347-5357},
  year = {2023},
}
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/feos-org",
    "name": "feos",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "physics,thermodynamics,equations_of_state,phase_equilibria",
    "author": "Gernot Bauer <bauer@itt.uni-stuttgart.de>, Philipp Rehner <prehner@ethz.ch>",
    "author_email": "Gernot Bauer <bauer@itt.uni-stuttgart.de>, Philipp Rehner <prehner@ethz.ch>",
    "download_url": "",
    "platform": null,
    "description": "# FeOs - A Framework for Equations of State and Classical Density Functional Theory\n\n[![crate](https://img.shields.io/crates/v/feos.svg)](https://crates.io/crates/feos)\n[![documentation](https://docs.rs/feos/badge.svg)](https://docs.rs/feos)\n[![documentation](https://img.shields.io/badge/docs-github--pages-blue)](https://feos-org.github.io/feos/)\n[![repository](https://img.shields.io/pypi/v/feos)](https://pypi.org/project/feos/)\n\nThe `FeOs` package provides Rust implementations of different equation of state and Helmholtz energy functional models and corresponding Python bindings.\n\n```python\nfrom feos.eos import EquationOfState, State\nfrom feos.pcsaft import PcSaftParameters, PcSaftRecord\n\n# PC-SAFT parameters for methanol (Gross and Sadowski 2002)\nrecord = PcSaftRecord(1.5255, 3.23, 188.9, kappa_ab=0.035176, epsilon_k_ab=2899.5, na=1, nb=1)\n\n# Build an equation of state\nparameters = PcSaftParameters.from_model_records([record])\neos = EquationOfState.pcsaft(parameters)\n\n# Define thermodynamic conditions\ncritical_point = State.critical_point(eos)\n\n# Compute properties\np = critical_point.pressure()\nt = critical_point.temperature\nprint(f'Critical point for methanol: T={t}, p={p}.')\n```\n```terminal\nCritical point for methanol: T=531.5 K, p=10.7 MPa.\n```\n\n## Models\nThe following models are currently published as part of the `FeOs` framework\n\n|name|description|eos|dft|\n|-|-|:-:|:-:|\n|`pcsaft`|perturbed-chain (polar) statistical associating fluid theory|\u2713|\u2713|\n|`gc-pcsaft`|(heterosegmented) group contribution PC-SAFT|\u2713|\u2713|\n|`pets`|perturbed truncated and shifted Lennard-Jones mixtures|\u2713|\u2713|\n|`uvtheory`|equation of state for Mie fluids and mixtures|\u2713||\n|`saftvrqmie`|equation of state for quantum fluids and mixtures|\u2713|\u2713|\n\nThe list is being expanded continuously. Currently under development are implementations of ePC-SAFT and a Helmholtz energy functional for the UV theory.\n\nOther public repositories that implement models within the `FeOs` framework, but are currently not part of the `feos` Python package, are\n\n|name|description|eos|dft|\n|-|-|:-:|:-:|\n|[`feos-fused-chains`](https://github.com/feos-org/feos-fused-chains)|heterosegmented fused-sphere chain functional||\u2713|\n\n## Parameters\nIn addition to the source code for the Rust and Python packages, this repository contains JSON files with previously published [parameters](https://github.com/feos-org/feos/tree/main/parameters) for the different models including group contribution methods. The parameter files can be read directly from Rust or Python.\n\n## Properties and phase equilibria\n\nThe crate makes use of [generalized (hyper-) dual numbers](https://github.com/itt-ustutt/num-dual) to generically calculate exact partial derivatives from Helmholtz energy equations of state. The derivatives are used to calculate\n- **equilibrium properties** (pressure, heat capacity, fugacity, and *many* more),\n- **transport properties** (viscosity, thermal conductivity, diffusion coefficients) using the entropy scaling approach\n- **critical points** and **phase equilibria** for pure components and mixtures.\n\nIn addition to that, utilities are provided to assist in the handling of **parameters** for both molecular equations of state and (homosegmented) group contribution methods and for the generation of phase diagrams for pure components and binary mixtures.\n\n## Classical density functional theory\n\n`FeOs` uses efficient numerical methods to calculate density profiles in inhomogeneous systems. Highlights include:\n- Fast calculation of convolution integrals in cartesian (1D, 2D and 3D), polar, cylindrical, and spherical coordinate systems using FFT and related algorithms.\n- Automatic calculation of partial derivatives of Helmholtz energy densities (including temperature derivatives) using automatic differentiation with [generalized (hyper-) dual numbers](https://github.com/itt-ustutt/num-dual).\n- Modeling of heterosegmented molecules, including branched molecules.\n- Functionalities for calculating surface tensions, adsorption isotherms, pair correlation functions, and solvation free energies.\n\n## Cargo features\n\nWithout additional features activated, the command\n```\ncargo test --release\n```\nwill only build and test the core functionalities of the crate. To run unit and integration tests for specific models, run\n```\ncargo test --release --features pcsaft\n```\nto test, e.g., the implementation of PC-SAFT or\n```\ncargo test --release --features all_models\n```\nto run tests on all implemented models.\n\n## Python package\n\n`FeOs` uses the [`PyO3`](https://github.com/PyO3/pyo3) framework to provide Python bindings. The Python package can be installed via `pip` and runs on Windows, Linux and macOS:\n\n```\npip install feos\n```\n\nIf there is no compiled package for your system available from PyPI and you have a Rust compiler installed, you can instead build the python package from source using\n\n```\npip install git+https://github.com/feos-org/feos\n```\n\nThis command builds the package without link-time optimization (LTO) that can be used to increase the performance further.\nSee the *Building from source* section for information about building the wheel including LTO.\n\n### Building from source\n\nTo compile the code you need the Rust compiler and `maturin` (>=0.13,<0.14) installed.\nTo install the package directly into the active environment (virtualenv or conda), use\n\n```\nmaturin develop --release\n```\n\nwhich uses the `python` and `all_models` feature as specified in the `pyproject.toml` file.\n\nAlternatively, you can specify the models or features that you want to include in the python package explicitly, e.g.\n\n```\nmaturin develop --release --features \"python pcsaft dft\"\n```\n\nfor the PC-SAFT equation of state and Helmholtz energy functional.\n\nTo build wheels including link-time optimization (LTO), use\n\n```\nmaturin build --profile=\"release-lto\"\n```\n\nwhich will use the `python` and `all_models` features specified in the `pyproject.toml` file.\nUse the following command to build a wheel with specific features:\n\n```\nmaturin build --profile=\"release-lto\" --features \"python ...\"\n```\n\nLTO increases compile times measurably but the resulting wheel is more performant and has a smaller size.\nFor development however, we recommend using the `--release` flag.\n\n## Documentation\n\nFor a documentation of the Python API, Python examples, and a guide to the underlying Rust framework check out the [documentation](https://feos-org.github.io/feos/).\n\n## Benchmarks\n\nCheck out the [benches](https://github.com/feos-org/feos/tree/main/benches) directory for information about provided Rust benchmarks and how to run them.\n\n## Developers\n\nThis software is currently maintained by members of the groups of\n- Prof. Joachim Gross, [Institute of Thermodynamics and Thermal Process Engineering (ITT), University of Stuttgart](https://www.itt.uni-stuttgart.de/)\n- Prof. Andr\u00e9 Bardow, [Energy and Process Systems Engineering (EPSE), ETH Zurich](https://epse.ethz.ch/)\n\n## Contributing\n\n`FeOs` grew from the need to maintain a common codebase used within the scientific work done in our groups. We share the code publicly as a platform to publish our own research but also encourage other researchers and developers to contribute their own models or implementations of existing equations of state.\n\nIf you want to contribute to ``FeOs``, there are several ways to go: improving the documentation and helping with language issues, testing the code on your systems to find bugs, adding new models or algorithms, or providing feature requests. Feel free to message us if you have questions or open an issue to discuss improvements.\n\n## Cite us\n\nIf you find `FeOs` useful for your own scientific studies, consider citing our [publication](https://pubs.acs.org/doi/full/10.1021/acs.iecr.2c04561) accompanying this library.\n\n```\n@article{rehner2023feos,\n  author = {Rehner, Philipp and Bauer, Gernot and Gross, Joachim},\n  title = {FeOs: An Open-Source Framework for Equations of State and Classical Density Functional Theory},\n  journal = {Industrial \\& Engineering Chemistry Research},\n  volume = {62},\n  number = {12},\n  pages = {5347-5357},\n  year = {2023},\n}\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT OR Apache-2.0",
    "summary": "FeOs - A framework for equations of state and classical density functional theory.",
    "version": "0.6.1",
    "project_urls": {
        "Homepage": "https://github.com/feos-org",
        "Source Code": "https://github.com/feos-org/feos"
    },
    "split_keywords": [
        "physics",
        "thermodynamics",
        "equations_of_state",
        "phase_equilibria"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23d13797e8e60168cbcaa1f323eaf43612d00603772e0600a645ecd40ce57608",
                "md5": "536e90fb049a1f80048bc11fb8c04f1b",
                "sha256": "a7a4dd78365e6d8c2f3d880bc7ba395fa6ae50b04857b9ce9d3ea22f409785c4"
            },
            "downloads": -1,
            "filename": "feos-0.6.1-cp37-abi3-macosx_10_7_x86_64.whl",
            "has_sig": false,
            "md5_digest": "536e90fb049a1f80048bc11fb8c04f1b",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 11570789,
            "upload_time": "2024-01-11T16:35:13",
            "upload_time_iso_8601": "2024-01-11T16:35:13.457689Z",
            "url": "https://files.pythonhosted.org/packages/23/d1/3797e8e60168cbcaa1f323eaf43612d00603772e0600a645ecd40ce57608/feos-0.6.1-cp37-abi3-macosx_10_7_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cd1bc57eaae2bed128a10548b98734da3783c9781504962b3c61e66e237db5be",
                "md5": "0df556309edb941f8ce8ab0284bba756",
                "sha256": "c15bcd6ffe711932e2ff83a4f3d67e38a379d1da02e8ca345e44271cc2a2d9c6"
            },
            "downloads": -1,
            "filename": "feos-0.6.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl",
            "has_sig": false,
            "md5_digest": "0df556309edb941f8ce8ab0284bba756",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 21145352,
            "upload_time": "2024-01-11T16:35:19",
            "upload_time_iso_8601": "2024-01-11T16:35:19.134566Z",
            "url": "https://files.pythonhosted.org/packages/cd/1b/c57eaae2bed128a10548b98734da3783c9781504962b3c61e66e237db5be/feos-0.6.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "06fa9b6c5094bdca09656b35480cc20d9e74afe50538a07c8a4efbd626b10440",
                "md5": "a1deaf517868463f2e66295063a72089",
                "sha256": "7f042478c3fcd0bf7921f742ed1c5f2bb1c7ca35cc8af5660189773c6897e116"
            },
            "downloads": -1,
            "filename": "feos-0.6.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "a1deaf517868463f2e66295063a72089",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 11639414,
            "upload_time": "2024-01-11T16:35:21",
            "upload_time_iso_8601": "2024-01-11T16:35:21.931185Z",
            "url": "https://files.pythonhosted.org/packages/06/fa/9b6c5094bdca09656b35480cc20d9e74afe50538a07c8a4efbd626b10440/feos-0.6.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5171d47454cecff53eb15562b0434cce8bee751827d8667b65516d1dc930a230",
                "md5": "fb9ec58d5acfe97e7808300e6be34142",
                "sha256": "8afed26c309882d221cd2824866f41346e4b2c17ecbd0725b285dc37d7952958"
            },
            "downloads": -1,
            "filename": "feos-0.6.1-cp37-abi3-win32.whl",
            "has_sig": false,
            "md5_digest": "fb9ec58d5acfe97e7808300e6be34142",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 11182175,
            "upload_time": "2024-01-11T16:35:24",
            "upload_time_iso_8601": "2024-01-11T16:35:24.749232Z",
            "url": "https://files.pythonhosted.org/packages/51/71/d47454cecff53eb15562b0434cce8bee751827d8667b65516d1dc930a230/feos-0.6.1-cp37-abi3-win32.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "efe97b5086413bfbaf81e5caf3c01d3616713a8268d044d25f596d4f6adf44aa",
                "md5": "ded381016fcaa758f8f6a00492efb396",
                "sha256": "a59e792cbce8c8c37b0aa1ad54e1c7ae1efe6b0bf53189328a3901be63d7bf1f"
            },
            "downloads": -1,
            "filename": "feos-0.6.1-cp37-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "ded381016fcaa758f8f6a00492efb396",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 12156487,
            "upload_time": "2024-01-11T16:35:26",
            "upload_time_iso_8601": "2024-01-11T16:35:26.976377Z",
            "url": "https://files.pythonhosted.org/packages/ef/e9/7b5086413bfbaf81e5caf3c01d3616713a8268d044d25f596d4f6adf44aa/feos-0.6.1-cp37-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-11 16:35:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "feos-org",
    "github_project": "feos",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "feos"
}
        
Elapsed time: 0.22374s