From a9a6d2b20fc32f367514e90c93a12e2538ee810e Mon Sep 17 00:00:00 2001 From: Philipp Rehner <69816385+prehner@users.noreply.github.com> Date: Fri, 13 May 2022 16:24:02 +0200 Subject: [PATCH] Fix ideal gas contribution for EquationOfState (#17) --- CHANGELOG.md | 4 ++++ Cargo.lock | 6 +++--- Cargo.toml | 2 +- README.md | 2 +- src/eos.rs | 11 +++++++++++ 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae067b9e7..e824157a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.2.1] - 2022-05-13 +### Fixed +- Fixed a bug due to which the default ideal gas contribution was used for every equation of state. [#17](https://github.com/feos-org/feos/pull/17) + ## [0.2.0] - 2022-05-10 ### Added - Added [gc-PC-SAFT](https://github.com/feos-org/feos-gc-pcsaft) equation of state and Helmholtz energy functional. diff --git a/Cargo.lock b/Cargo.lock index 18674872c..571a1c1ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,7 +135,7 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "feos" -version = "0.2.0" +version = "0.2.1" dependencies = [ "feos-core", "feos-dft", @@ -978,9 +978,9 @@ checksum = "a3ff2f71c82567c565ba4b3009a9350a96a7269eaa4001ebedae926230bc2254" [[package]] name = "syn" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04066589568b72ec65f42d65a1a52436e954b168773148893c020269563decf2" +checksum = "a07e33e919ebcd69113d5be0e4d70c5707004ff45188910106854f38b960df4a" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index b78326e3d..b500d7bf2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "feos" -version = "0.2.0" +version = "0.2.1" authors = ["Gernot Bauer ", "Philipp Rehner "] edition = "2018" rust-version = "1.53" diff --git a/README.md b/README.md index 343195290..9d6bf77e9 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ The following models are currently published as part of the `FeOs` framework |[`feos-pets`](https://github.com/feos-org/feos-pets)|perturbed truncated and shifted Lennard-Jones mixtures|✓|✓| |[`feos-uvtheory`](https://github.com/feos-org/feos-uvtheory)|equation of state for Mie fluids and mixtures|✓|| -The list is being expanded continuously. Currently under development are implementations of ePC-SAFT, a Helmholtz energy functional for the UV theory, SAFT-VRQ-Mie. +The list is being expanded continuously. Currently under development are implementations of ePC-SAFT, a Helmholtz energy functional for the UV theory, and SAFT-VRQ-Mie. Other public repositories that implement models within the `FeOs` framework, but are currently not part of the `feos` Python package, are diff --git a/src/eos.rs b/src/eos.rs index ac5e1570f..e3b5bde04 100644 --- a/src/eos.rs +++ b/src/eos.rs @@ -75,6 +75,17 @@ impl EquationOfState for EosVariant { EosVariant::UVTheory(eos) => eos.residual(), } } + + fn ideal_gas(&self) -> &dyn IdealGasContribution { + match self { + EosVariant::PcSaft(eos) => eos.ideal_gas(), + EosVariant::GcPcSaft(eos) => eos.ideal_gas(), + EosVariant::PengRobinson(eos) => eos.ideal_gas(), + EosVariant::Python(eos) => eos.ideal_gas(), + EosVariant::Pets(eos) => eos.ideal_gas(), + EosVariant::UVTheory(eos) => eos.ideal_gas(), + } + } } impl MolarWeight for EosVariant {