From a5e1cac63cdd7cb15aa10aacd291c22c2dec0dc3 Mon Sep 17 00:00:00 2001 From: Rolf Stierle Date: Tue, 7 Feb 2023 09:15:01 +0100 Subject: [PATCH 1/9] Missing argument binary critical point Fices missing documentation about "initial_temperature" in Python documentation. --- feos-core/src/python/state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feos-core/src/python/state.rs b/feos-core/src/python/state.rs index f033fbf2a..9e0045cea 100644 --- a/feos-core/src/python/state.rs +++ b/feos-core/src/python/state.rs @@ -204,7 +204,7 @@ macro_rules! impl_state { /// ------- /// State : State at critical conditions. #[staticmethod] - #[pyo3(text_signature = "(eos, temperature_or_pressure, initial_molefracs=None, max_iter=None, tol=None, verbosity=None)")] + #[pyo3(text_signature = "(eos, temperature_or_pressure, initial_temperature=None, initial_molefracs=None, max_iter=None, tol=None, verbosity=None)")] fn critical_point_binary( eos: $py_eos, temperature_or_pressure: PySINumber, From 23497519501bcf521e142c2eb71f086ab7927647 Mon Sep 17 00:00:00 2001 From: Rolf Stierle Date: Fri, 14 Apr 2023 15:25:50 +0200 Subject: [PATCH 2/9] Added isenthalpic compressibility, thermal expansivity, and ggrueneisen parameter. --- feos-core/CHANGELOG.md | 5 +++++ feos-core/src/python/state.rs | 27 +++++++++++++++++++++++++++ feos-core/src/state/properties.rs | 20 ++++++++++++++++++++ 3 files changed, 52 insertions(+) diff --git a/feos-core/CHANGELOG.md b/feos-core/CHANGELOG.md index b0e933596..967e049d0 100644 --- a/feos-core/CHANGELOG.md +++ b/feos-core/CHANGELOG.md @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +### Added +- Added the following properties to `State`: + - `isenthalpic_compressibility` the isenthalpic compressibility + - `thermal_expansivity` the thermal expansivity + - `grueneisen_parameter` the grueneisen parameter ## [0.4.2] - 2023-04-03 ### Fixed diff --git a/feos-core/src/python/state.rs b/feos-core/src/python/state.rs index 9e0045cea..8d6f67dd1 100644 --- a/feos-core/src/python/state.rs +++ b/feos-core/src/python/state.rs @@ -903,6 +903,33 @@ macro_rules! impl_state { PySINumber::from(self.0.isothermal_compressibility()) } + /// Return isothermal compressibility coefficient. + /// + /// Returns + /// ------- + /// SINumber + fn isenthalpic_compressibility(&self) -> PySINumber { + PySINumber::from(self.0.isenthalpic_compressibility()) + } + + /// Return isothermal compressibility coefficient. + /// + /// Returns + /// ------- + /// SINumber + fn thermal_expansivity(&self) -> PySINumber { + PySINumber::from(self.0.thermal_expansivity()) + } + + /// Return isothermal compressibility coefficient. + /// + /// Returns + /// ------- + /// SINumber + fn grueneisen_parameter(&self) -> f64 { + self.0.grueneisen_parameter() + } + /// Return structure factor. /// /// Returns diff --git a/feos-core/src/state/properties.rs b/feos-core/src/state/properties.rs index baf749718..56b7822d2 100644 --- a/feos-core/src/state/properties.rs +++ b/feos-core/src/state/properties.rs @@ -510,6 +510,26 @@ impl State { -1.0 / (self.dp_dv(c) * self.volume) } + /// Isenthalpic compressibility: $\kappa_H=-\frac{1}{V}\left(\frac{\partial V}{\partial p}\right)_{H,N_i}$ + pub fn isenthalpic_compressibility(&self) -> SINumber { + self.isentropic_compressibility() + + self.isentropic_compressibility() * self.grueneisen_parameter() + } + + /// Thermal expansivity: $\alpha_p=-\frac{1}{V}\left(\frac{\partial V}{\partial T}\right)_{p,N_i}$ + pub fn thermal_expansivity(&self) -> SINumber { + let c = Contributions::Total; + -self.dp_dt(c) / self.dp_dv(c) / self.volume + } + + /// Grueneisen parameter: $phi=V\left(\frac{\partial p}{\partial U}\right)_{V,N_i}=\frac{v}{c_v}\left(\frac{\partial p}{\partial T}\right)_{v,N_i}=\frac{\rho}{T}\frac{\partial T}{\partial \rho}_{s, N_i}$ + pub fn grueneisen_parameter(&self) -> f64 { + let c = Contributions::Total; + (self.volume / (self.total_moles * self.c_v(c)) * self.dp_dt(c)) + .into_value() + .unwrap() + } + /// Structure factor: $S(0)=k_BT\left(\frac{\partial\rho}{\partial p}\right)_{T,N_i}$ pub fn structure_factor(&self) -> f64 { -(SIUnit::gas_constant() * self.temperature * self.density) From 7981f3b0d1751a9dcde5812fd70d8732883e6374 Mon Sep 17 00:00:00 2001 From: Rolf Stierle Date: Fri, 14 Apr 2023 16:04:39 +0200 Subject: [PATCH 3/9] Isenthalpic compressibility easier. --- feos-core/src/state/properties.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/feos-core/src/state/properties.rs b/feos-core/src/state/properties.rs index 56b7822d2..22aa32635 100644 --- a/feos-core/src/state/properties.rs +++ b/feos-core/src/state/properties.rs @@ -512,8 +512,7 @@ impl State { /// Isenthalpic compressibility: $\kappa_H=-\frac{1}{V}\left(\frac{\partial V}{\partial p}\right)_{H,N_i}$ pub fn isenthalpic_compressibility(&self) -> SINumber { - self.isentropic_compressibility() - + self.isentropic_compressibility() * self.grueneisen_parameter() + self.isentropic_compressibility() * (1.0 + self.grueneisen_parameter()) } /// Thermal expansivity: $\alpha_p=-\frac{1}{V}\left(\frac{\partial V}{\partial T}\right)_{p,N_i}$ From 94dbaa03740f8c06bfaf7e891d62cb08d1767218 Mon Sep 17 00:00:00 2001 From: Rolf Stierle Date: Fri, 14 Apr 2023 17:27:03 +0200 Subject: [PATCH 4/9] Update state.rs --- feos-core/src/python/state.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/feos-core/src/python/state.rs b/feos-core/src/python/state.rs index 8d6f67dd1..2b85a797a 100644 --- a/feos-core/src/python/state.rs +++ b/feos-core/src/python/state.rs @@ -903,7 +903,7 @@ macro_rules! impl_state { PySINumber::from(self.0.isothermal_compressibility()) } - /// Return isothermal compressibility coefficient. + /// Return isenthalpic compressibility coefficient. /// /// Returns /// ------- @@ -912,7 +912,7 @@ macro_rules! impl_state { PySINumber::from(self.0.isenthalpic_compressibility()) } - /// Return isothermal compressibility coefficient. + /// Return thermal_expansivity coefficient. /// /// Returns /// ------- @@ -921,7 +921,7 @@ macro_rules! impl_state { PySINumber::from(self.0.thermal_expansivity()) } - /// Return isothermal compressibility coefficient. + /// Return Grueneisen parameter. /// /// Returns /// ------- From b9fdee26fb0b66239b4d5e4d0e933ed82abe87dc Mon Sep 17 00:00:00 2001 From: Rolf Stierle Date: Fri, 14 Apr 2023 17:27:44 +0200 Subject: [PATCH 5/9] Update state.rs --- feos-core/src/python/state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feos-core/src/python/state.rs b/feos-core/src/python/state.rs index 2b85a797a..366ae8f3c 100644 --- a/feos-core/src/python/state.rs +++ b/feos-core/src/python/state.rs @@ -912,7 +912,7 @@ macro_rules! impl_state { PySINumber::from(self.0.isenthalpic_compressibility()) } - /// Return thermal_expansivity coefficient. + /// Return thermal expansivity coefficient. /// /// Returns /// ------- From 61b2edb0e2971645fad0b3c20f66fcaf154a0fce Mon Sep 17 00:00:00 2001 From: Rolf Stierle Date: Thu, 20 Apr 2023 08:13:23 +0200 Subject: [PATCH 6/9] Properties added to documentation/guide. --- docs/theory/eos/properties.md | 3 +++ feos-core/src/state/properties.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/theory/eos/properties.md b/docs/theory/eos/properties.md index 5826c5db6..29f0332d2 100644 --- a/docs/theory/eos/properties.md +++ b/docs/theory/eos/properties.md @@ -92,6 +92,9 @@ The table below lists all properties that are available in $\text{FeO}_\text{s}$ | Joule Thomson coefficient $\mu_\mathrm{JT}$ | $\left(\frac{\partial T}{\partial p}\right)_{H,n_i}$ | no | | Isentropic compressibility $\kappa_s$ | $-\frac{1}{V}\left(\frac{\partial V}{\partial p}\right)_{S,n_i}$ | no | | Isothermal compressibility $\kappa_T$ | $-\frac{1}{V}\left(\frac{\partial V}{\partial p}\right)_{T,n_i}$ | no | +| Isenthalpic compressibility $\kappa_h$ | $-\frac{1}{V}\left(\frac{\partial V}{\partial p}\right)_{H,n_i}$ | no | +| Thermal expansivity $\alpha_p$ | $-\frac{1}{V}\left(\frac{\partial V}{\partial T}\right)_{p,n_i}$ | no | +| Grüneisen parameter $\phi$ | $V\left(\frac{\partial p}{\partial U}\right)_{V,n_i}=\frac{v}{c_v}\left(\frac{\partial p}{\partial T}\right)_{v,n_i}=\frac{\rho}{T}\left(\frac{\partial T}{\partial \rho}\right)_{s, n_i}$ | no | | (Static) structure factor $S(0)$ | $RT\left(\frac{\partial\rho}{\partial p}\right)_{T,n_i}$ | no | ## Additional properties for fluids with known molar weights diff --git a/feos-core/src/state/properties.rs b/feos-core/src/state/properties.rs index 22aa32635..773028d6e 100644 --- a/feos-core/src/state/properties.rs +++ b/feos-core/src/state/properties.rs @@ -521,7 +521,7 @@ impl State { -self.dp_dt(c) / self.dp_dv(c) / self.volume } - /// Grueneisen parameter: $phi=V\left(\frac{\partial p}{\partial U}\right)_{V,N_i}=\frac{v}{c_v}\left(\frac{\partial p}{\partial T}\right)_{v,N_i}=\frac{\rho}{T}\frac{\partial T}{\partial \rho}_{s, N_i}$ + /// Grueneisen parameter: $\phi=V\left(\frac{\partial p}{\partial U}\right)_{V,n_i}=\frac{v}{c_v}\left(\frac{\partial p}{\partial T}\right)_{v,n_i}=\frac{\rho}{T}\left(\frac{\partial T}{\partial \rho}\right)_{s, n_i}$ pub fn grueneisen_parameter(&self) -> f64 { let c = Contributions::Total; (self.volume / (self.total_moles * self.c_v(c)) * self.dp_dt(c)) From fb96fc8c30bae4ec12e43bc0fb08914d79b70bab Mon Sep 17 00:00:00 2001 From: Rolf Stierle Date: Thu, 20 Apr 2023 08:34:09 +0200 Subject: [PATCH 7/9] Reference corrected for entropy scaling parameters for pure substances. --- parameters/pcsaft/literature.bib | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/parameters/pcsaft/literature.bib b/parameters/pcsaft/literature.bib index 4501905d6..58b9f7e22 100644 --- a/parameters/pcsaft/literature.bib +++ b/parameters/pcsaft/literature.bib @@ -78,16 +78,16 @@ @article{loetgeringlin2015 } @article{loetgeringlin2018, - author = {Lötgering-Lin, Oliver and Gross, Joachim}, - title = {Group Contribution Method for Viscosities Based on Entropy Scaling Using the Perturbed-Chain Polar Statistical Associating Fluid Theory}, + author = {Lötgering-Lin, Oliver and Fischer, Matthias and Hopp, Madlen and Gross, Joachim}, + title = {Pure Substance and Mixture Viscosities Based on Entropy Scaling and an Analytic Equation of State}, journal = {Industrial \& Engineering Chemistry Research}, - volume = {54}, - number = {32}, - pages = {7942-7952}, - year = {2015}, - doi = {10.1021/acs.iecr.5b01698}, - url = {https://doi.org/10.1021/acs.iecr.5b01698}, - eprint = {https://doi.org/10.1021/acs.iecr.5b01698} + volume = {57}, + number = {11}, + pages = {4095-4114}, + year = {2018}, + doi = {10.1021/acs.iecr.7b04871}, + url = {https://doi.org/10.1021/acs.iecr.7b04871}, + eprint = {https://doi.org/10.1021/acs.iecr.7b04871} } @article{rehner2020, From 8514e0132d42f82be7d55d92fc36c3188585c93b Mon Sep 17 00:00:00 2001 From: Rolf Stierle Date: Thu, 20 Apr 2023 09:37:54 +0200 Subject: [PATCH 8/9] Update feos-core/src/python/state.rs Co-authored-by: Philipp Rehner <69816385+prehner@users.noreply.github.com> --- feos-core/src/python/state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feos-core/src/python/state.rs b/feos-core/src/python/state.rs index 366ae8f3c..dbc1bd330 100644 --- a/feos-core/src/python/state.rs +++ b/feos-core/src/python/state.rs @@ -925,7 +925,7 @@ macro_rules! impl_state { /// /// Returns /// ------- - /// SINumber + /// float fn grueneisen_parameter(&self) -> f64 { self.0.grueneisen_parameter() } From cdaa2da23aee1d0af23d740981f97d234148f91a Mon Sep 17 00:00:00 2001 From: Rolf Stierle Date: Thu, 20 Apr 2023 09:38:09 +0200 Subject: [PATCH 9/9] Update feos-core/CHANGELOG.md Co-authored-by: Philipp Rehner <69816385+prehner@users.noreply.github.com> --- feos-core/CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/feos-core/CHANGELOG.md b/feos-core/CHANGELOG.md index 967e049d0..b8275ec9a 100644 --- a/feos-core/CHANGELOG.md +++ b/feos-core/CHANGELOG.md @@ -6,10 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased ### Added -- Added the following properties to `State`: - - `isenthalpic_compressibility` the isenthalpic compressibility - - `thermal_expansivity` the thermal expansivity - - `grueneisen_parameter` the grueneisen parameter +- Added new functions `isenthalpic_compressibility`, `thermal_expansivity` and `grueneisen_parameter` to `State`. [#154](https://github.com/feos-org/feos/pull/154) ## [0.4.2] - 2023-04-03 ### Fixed