From 6c216657de7b13e8a27a1ee97d174a7b2473ac5b Mon Sep 17 00:00:00 2001 From: Philipp Rehner Date: Mon, 25 Jul 2022 12:14:40 +0200 Subject: [PATCH 1/3] Documentation for the hard-sphere eos and functional --- feos-saft/src/hard_sphere/dft.rs | 33 +++++++++++++++- feos-saft/src/hard_sphere/mod.rs | 67 +++++++++----------------------- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/feos-saft/src/hard_sphere/dft.rs b/feos-saft/src/hard_sphere/dft.rs index 6e346b810..573be76ca 100644 --- a/feos-saft/src/hard_sphere/dft.rs +++ b/feos-saft/src/hard_sphere/dft.rs @@ -1,4 +1,3 @@ -//! Helmholtz energy functionals from fundamental measure theory. use feos_core::EosResult; use feos_dft::adsorption::FluidParameters; use feos_dft::solvation::PairPotential; @@ -30,6 +29,38 @@ pub enum FMTVersion { } /// The [FunctionalContribution] for the hard sphere functional. +/// +/// The struct provides an implementation of different variants of fundamental measure theory ([Rosenfeld, 1989](https://doi.org/10.1103/PhysRevLett.63.980)). Currently, only variants that are consistent with the BMCSL equation of state for hard-sphere mixtures are considered (exluding, e.g., the original Rosenfeld and White-Bear II variants). +/// +/// The Helmholtz energy density is calculated according to +/// $$\beta f=-n_0\ln\left(1-n_3\right)+\frac{n_{12}}{1-n_3}+\frac{1}{36\pi}n_2n_{22}f_3(n_3)$$ +/// The expressions for $n_{12}$ and $n_{22}$ depend on the [FMTVersion]. +/// +/// |[FMTVersion]|$n_{12}$|$n_{22}$| +/// |-|:-:|:-:| +/// |WhiteBear|$n_1n_2-\vec n_1\cdot\vec n_2$|$n_2^2-3\vec n_2\cdot\vec n_2$| +/// |KierlikRosinberg|$n_1n_2$|$n_2^2$| +/// |AntiSymWhiteBear|$n_1n_2-\vec n_1\cdot\vec n_2$|$n_2^2\left(1-\frac{\vec n_2\cdot\vec n_2}{n_2^2}\right)^3$| +/// +/// The value of $f(n_3)$ numerically diverges for small $n_3$. Therefore, it is approximated with a Taylor expansion. +/// $$f_3=\begin{cases}\frac{n_3+\left(1-n_3\right)^2\ln\left(1-n_3\right)}{n_3^2\left(1-n_3\right)^2}&\text{if }n_3>10^{-5}\\\\ +/// \frac{3}{2}+\frac{8}{3}n_3+\frac{15}{4}n_3^2+\frac{24}{5}n_3^3+\frac{35}{6}n_3^4&\text{else}\end{cases}$$ +/// +/// The weighted densities $n_k(\mathbf{r})$ are calculated by concolving the density profiles $\rho_\alpha(\mathbf{r})$ with weight functions $\omega_k^\alpha(\mathbf{r})$ +/// $$n_k(\mathbf{r})=\sum_\alpha\int\rho_\alpha(\mathbf{r}\')\omega_k^\alpha(\mathbf{r}-\mathbf{r}\')\mathrm{d}\mathbf{r}\'$$ +/// +/// The weight functions differ between the different [FMTVersion]s. +/// +/// ||WhiteBear/AntiSymWhiteBear|KierlikRosinberg| +/// |-|:-:|:-:| +/// |$\omega_0^\alpha(\mathbf{r})$|$\frac{C_{0,\alpha}}{\pi\sigma_\alpha^2}\\,\delta\\!\left(\frac{d_\alpha}{2}-\|\mathbf{r}\|\right)$|$C_{0,\alpha}\left(-\frac{1}{8\pi}\\,\delta\'\'\\!\left(\frac{d_\alpha}{2}-\|\mathbf{r}\|\right)+\frac{1}{2\pi\|\mathbf{r}\|}\\,\delta\'\\!\left(\frac{d_\alpha}{2}-\|\mathbf{r}\|\right)\right)$| +/// |$\omega_1^\alpha(\mathbf{r})$|$\frac{C_{1,\alpha}}{2\pi\sigma_\alpha}\\,\delta\\!\left(\frac{d_\alpha}{2}-\|\mathbf{r}\|\right)$|$\frac{C_{1,\alpha}}{8\pi}\\,\delta\'\\!\left(\frac{d_\alpha}{2}-\|\mathbf{r}\|\right)$| +/// |$\omega_2^\alpha(\mathbf{r})$|$C_{2,\alpha}\\,\delta\\!\left(\frac{d_\alpha}{2}-\|\mathbf{r}\|\right)$|$C_{2,\alpha}\\,\delta\\!\left(\frac{d_\alpha}{2}-\|\mathbf{r}\|\right)$| +/// |$\omega_3^\alpha(\mathbf{r})$|$C_{3,\alpha}\\,\Theta\\!\left(\frac{d_\alpha}{2}-\|\mathbf{r}\|\right)$|$C_{3,\alpha}\\,\Theta\\!\left(\frac{d_\alpha}{2}-\|\mathbf{r}\|\right)$| +/// |$\vec\omega_1^\alpha(\mathbf{r})$|$C_{3,\alpha}\frac{\mathbf{r}}{2\pi\sigma_\alpha\|\mathbf{r}\|}\\,\delta\\!\left(\frac{d_\alpha}{2}-\|\mathbf{r}\|\right)$|-| +/// |$\vec\omega_2^\alpha(\mathbf{r})$|$C_{3,\alpha}\frac{\mathbf{r}}{\|\mathbf{r}\|}\\,\delta\\!\left(\frac{d_\alpha}{2}-\|\mathbf{r}\|\right)$|-| +/// +/// The geometry coefficients $C_{k,\alpha}$ and the segment diameters $d_\alpha$ are specified via the [HardSphereProperties] trait. pub struct FMTContribution

{ pub properties: Rc

, version: FMTVersion, diff --git a/feos-saft/src/hard_sphere/mod.rs b/feos-saft/src/hard_sphere/mod.rs index 283abc729..d90ba564b 100644 --- a/feos-saft/src/hard_sphere/mod.rs +++ b/feos-saft/src/hard_sphere/mod.rs @@ -11,7 +11,7 @@ mod dft; #[cfg(feature = "dft")] pub use dft::{FMTContribution, FMTFunctional, FMTVersion}; -/// Different monomer shapes for FMT. +/// Different monomer shapes for FMT and BMCSL. pub enum MonomerShape<'a, D> { /// For spherical monomers, the number of components. Spherical(usize), @@ -26,9 +26,13 @@ pub enum MonomerShape<'a, D> { /// Properties of (generalized) hard sphere systems. pub trait HardSphereProperties { + /// The [MonomerShape] used in the model. fn monomer_shape>(&self, temperature: D) -> MonomerShape; + + /// The temperature dependent hard-sphere diameters of every segment. fn hs_diameter>(&self, temperature: D) -> Array1; + /// For every segment, the index of the component that it is on. fn component_index(&self) -> Cow> { match self.monomer_shape(1.0) { MonomerShape::Spherical(n) => Cow::Owned(Array1::from_shape_fn(n, |i| i)), @@ -37,6 +41,7 @@ pub trait HardSphereProperties { } } + /// The geometry coefficients $C_{k,\alpha}$ for every segment. fn geometry_coefficients>(&self, temperature: D) -> [Array1; 4] { match self.monomer_shape(temperature) { MonomerShape::Spherical(n) => { @@ -48,6 +53,7 @@ pub trait HardSphereProperties { } } + /// The packing fractions $\zeta_k$. fn zeta, const N: usize>( &self, temperature: D, @@ -69,6 +75,7 @@ pub trait HardSphereProperties { zeta } + /// The fraction $\frac{\zeta_2}{\zeta_3}$ evaluated in a way to avoid a division by 0 when the density is 0. fn zeta_23>(&self, temperature: D, molefracs: &Array1) -> D { let component_index = self.component_index(); let geometry_coefficients = self.geometry_coefficients(temperature); @@ -86,6 +93,16 @@ pub trait HardSphereProperties { } } +/// Implementation of the BMCSL equation of state for hard-sphere mixtures. +/// +/// This structure provides an implementation of the Boublík-Mansoori-Carnahan-Starling-Leland (BMCSL) equation of state ([Boublík, 1970](https://doi.org/10.1063/1.1673824), [Mansoori et al., 1971](https://doi.org/10.1063/1.1675048)) that is often used as reference contribution in SAFT equations of state. The implementation is generalized to allow the description of non-sperical or fused-sphere reference fluids. +/// +/// The reduced Helmholtz energy is calculated according to +/// $$\frac{\beta A}{V}=\frac{6}{\pi}\left(\frac{3\zeta_1\zeta_2}{1-\zeta_3}+\frac{\zeta_2^3}{\zeta_3\left(1-\zeta_3\right)^2}+\left(\frac{\zeta_2^3}{\zeta_3^2}-\zeta_0\right)\ln\left(1-\zeta_3\right)\right)$$ +/// with the packing fractions +/// $$\zeta_k=\frac{\pi}{6}\sum_\alpha C_{k,\alpha}\rho_\alpha d_\alpha^k,~~~~~~~~k=0\ldots 3.$$ +/// +/// The geometry coefficients $C_{k,\alpha}$ and the segment diameters $d_\alpha$ are specified via the [HardSphereProperties] trait. pub struct HardSphere

{ parameters: Rc

, } @@ -116,51 +133,3 @@ impl

fmt::Display for HardSphere

{ write!(f, "Hard Sphere") } } - -// #[cfg(test)] -// mod tests { -// use super::*; -// use crate::pcsaft::parameters::utils::{ -// butane_parameters, propane_butane_parameters, propane_parameters, -// }; -// use approx::assert_relative_eq; -// use ndarray::arr1; - -// #[test] -// fn helmholtz_energy() { -// let hs = HardSphere { -// parameters: propane_parameters(), -// }; -// let t = 250.0; -// let v = 1000.0; -// let n = 1.0; -// let s = StateHD::new(t, v, arr1(&[n])); -// let a_rust = hs.helmholtz_energy(&s); -// assert_relative_eq!(a_rust, 0.410610492598808, epsilon = 1e-10); -// } - -// #[test] -// fn mix() { -// let c1 = HardSphere { -// parameters: propane_parameters(), -// }; -// let c2 = HardSphere { -// parameters: butane_parameters(), -// }; -// let c12 = HardSphere { -// parameters: propane_butane_parameters(), -// }; -// let t = 250.0; -// let v = 2.5e28; -// let n = 1.0; -// let s = StateHD::new(t, v, arr1(&[n])); -// let a1 = c1.helmholtz_energy(&s); -// let a2 = c2.helmholtz_energy(&s); -// let s1m = StateHD::new(t, v, arr1(&[n, 0.0])); -// let a1m = c12.helmholtz_energy(&s1m); -// let s2m = StateHD::new(t, v, arr1(&[0.0, n])); -// let a2m = c12.helmholtz_energy(&s2m); -// assert_relative_eq!(a1, a1m, epsilon = 1e-14); -// assert_relative_eq!(a2, a2m, epsilon = 1e-14); -// } -// } From 8b6cb5be048767912eebbb2ea5719150f693c215 Mon Sep 17 00:00:00 2001 From: Philipp Rehner Date: Wed, 27 Jul 2022 15:43:12 +0200 Subject: [PATCH 2/3] reintegrate feos-saft into feos --- Cargo.toml | 14 ++++---- .../docs-header.html => docs-header.html | 0 feos-saft/Cargo.toml | 32 ------------------- feos-saft/license-apache | 1 - feos-saft/license-mit | 1 - feos-saft/src/lib.rs | 11 ------- {feos-saft/src => src}/association/dft.rs | 2 +- {feos-saft/src => src}/association/mod.rs | 20 ++++++------ {feos-saft/src => src}/association/python.rs | 6 ++-- src/gc_pcsaft/dft/dispersion.rs | 2 +- src/gc_pcsaft/dft/hard_chain.rs | 2 +- src/gc_pcsaft/dft/mod.rs | 3 +- src/gc_pcsaft/dft/parameter.rs | 2 +- src/gc_pcsaft/eos/dispersion.rs | 2 +- src/gc_pcsaft/eos/hard_chain.rs | 2 +- src/gc_pcsaft/eos/mod.rs | 3 +- src/gc_pcsaft/eos/parameter.rs | 5 +-- src/gc_pcsaft/eos/polar.rs | 2 +- src/gc_pcsaft/python/mod.rs | 2 +- src/gc_pcsaft/record.rs | 2 +- {feos-saft/src => src}/hard_sphere/dft.rs | 6 ++-- {feos-saft/src => src}/hard_sphere/mod.rs | 2 ++ src/lib.rs | 4 +++ src/pcsaft/dft/dispersion.rs | 2 +- src/pcsaft/dft/hard_chain.rs | 2 +- src/pcsaft/dft/mod.rs | 3 +- src/pcsaft/dft/polar.rs | 2 +- src/pcsaft/dft/pure_saft_functional.rs | 4 +-- src/pcsaft/eos/dispersion.rs | 2 +- src/pcsaft/eos/hard_chain.rs | 2 +- src/pcsaft/eos/mod.rs | 3 +- src/pcsaft/eos/polar.rs | 2 +- src/pcsaft/parameters.rs | 3 +- src/pcsaft/python.rs | 2 +- src/pets/dft/mod.rs | 2 +- src/pets/dft/pure_pets_functional.rs | 2 +- src/python/dft.rs | 2 +- tests/pcsaft/dft.rs | 2 +- 38 files changed, 64 insertions(+), 97 deletions(-) rename feos-saft/docs-header.html => docs-header.html (100%) delete mode 100644 feos-saft/Cargo.toml delete mode 120000 feos-saft/license-apache delete mode 120000 feos-saft/license-mit delete mode 100644 feos-saft/src/lib.rs rename {feos-saft/src => src}/association/dft.rs (99%) rename {feos-saft/src => src}/association/mod.rs (95%) rename {feos-saft/src => src}/association/python.rs (78%) rename {feos-saft/src => src}/hard_sphere/dft.rs (96%) rename {feos-saft/src => src}/hard_sphere/mod.rs (98%) diff --git a/Cargo.toml b/Cargo.toml index fef9fef90..197dd095a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ categories = ["science"] features = ["all_models"] [workspace] -members = ["feos-core", "feos-dft", "feos-saft"] +members = ["feos-core", "feos-dft"] [lib] crate-type = ["rlib", "cdylib"] @@ -26,7 +26,6 @@ quantity = "0.5" num-dual = "0.5" feos-core = { version = "0.3", path = "feos-core" } feos-dft = { version = "0.3", path = "feos-dft", optional = true } -feos-saft = { version = "0.1", path = "feos-saft", optional = true } numpy = { version = "0.16", optional = true } ndarray = { version = "0.15", features = ["approx"] } petgraph = { version = "0.6", optional = true } @@ -48,11 +47,12 @@ approx = "0.4" [features] default = [] -dft = ["feos-dft", "petgraph", "feos-saft?/dft"] +dft = ["feos-dft", "petgraph"] estimator = [] -pcsaft = ["feos-saft/association"] -gc_pcsaft = ["feos-saft/association"] +association = [] +pcsaft = ["association"] +gc_pcsaft = ["association"] uvtheory = ["lazy_static"] -pets = ["feos-saft"] -python = ["pyo3", "numpy", "feos-core/python", "feos-dft?/python", "feos-saft?/python"] +pets = [] +python = ["pyo3", "numpy", "feos-core/python", "feos-dft?/python"] all_models = ["dft", "estimator", "pcsaft", "gc_pcsaft", "uvtheory", "pets"] diff --git a/feos-saft/docs-header.html b/docs-header.html similarity index 100% rename from feos-saft/docs-header.html rename to docs-header.html diff --git a/feos-saft/Cargo.toml b/feos-saft/Cargo.toml deleted file mode 100644 index c1bebf6ce..000000000 --- a/feos-saft/Cargo.toml +++ /dev/null @@ -1,32 +0,0 @@ -[package] -name = "feos-saft" -version = "0.1.0" -authors = ["Gernot Bauer ", - "Philipp Rehner SegmentRecord { SegmentRecord::new( diff --git a/src/gc_pcsaft/eos/polar.rs b/src/gc_pcsaft/eos/polar.rs index cce3d9c3d..301a12a8d 100644 --- a/src/gc_pcsaft/eos/polar.rs +++ b/src/gc_pcsaft/eos/polar.rs @@ -1,6 +1,6 @@ use super::GcPcSaftEosParameters; +use crate::hard_sphere::HardSphereProperties; use feos_core::{HelmholtzEnergyDual, StateHD}; -use feos_saft::HardSphereProperties; use ndarray::prelude::*; use num_dual::DualNum; use std::f64::consts::{FRAC_PI_3, PI}; diff --git a/src/gc_pcsaft/python/mod.rs b/src/gc_pcsaft/python/mod.rs index 5164eed57..28ba825cd 100644 --- a/src/gc_pcsaft/python/mod.rs +++ b/src/gc_pcsaft/python/mod.rs @@ -2,6 +2,7 @@ use super::dft::GcPcSaftFunctionalParameters; use super::eos::GcPcSaftEosParameters; use super::record::GcPcSaftRecord; +use crate::association::PyAssociationRecord; use feos_core::joback::JobackRecord; use feos_core::parameter::{ BinaryRecord, IdentifierOption, ParameterError, ParameterHetero, SegmentRecord, @@ -9,7 +10,6 @@ use feos_core::parameter::{ use feos_core::python::joback::PyJobackRecord; use feos_core::python::parameter::{PyBinarySegmentRecord, PyChemicalRecord, PyIdentifier}; use feos_core::{impl_json_handling, impl_parameter_from_segments, impl_segment_record}; -use feos_saft::PyAssociationRecord; #[cfg(feature = "dft")] use numpy::{PyArray2, ToPyArray}; use pyo3::prelude::*; diff --git a/src/gc_pcsaft/record.rs b/src/gc_pcsaft/record.rs index 6f0a849a0..56c920087 100644 --- a/src/gc_pcsaft/record.rs +++ b/src/gc_pcsaft/record.rs @@ -1,4 +1,4 @@ -use feos_saft::AssociationRecord; +use crate::association::AssociationRecord; use serde::{Deserialize, Serialize}; /// gc-PC-SAFT pure-component parameters. diff --git a/feos-saft/src/hard_sphere/dft.rs b/src/hard_sphere/dft.rs similarity index 96% rename from feos-saft/src/hard_sphere/dft.rs rename to src/hard_sphere/dft.rs index 573be76ca..50b275f8f 100644 --- a/feos-saft/src/hard_sphere/dft.rs +++ b/src/hard_sphere/dft.rs @@ -11,12 +11,12 @@ use std::f64::consts::PI; use std::fmt; use std::rc::Rc; -use crate::{HardSphereProperties, MonomerShape}; +use super::{HardSphereProperties, MonomerShape}; const PI36M1: f64 = 1.0 / (36.0 * PI); const N3_CUTOFF: f64 = 1e-5; -/// Different versions of fundamental measure theory +/// Different versions of fundamental measure theory. #[derive(Clone, Copy)] #[cfg_attr(feature = "python", pyo3::pyclass)] pub enum FMTVersion { @@ -46,7 +46,7 @@ pub enum FMTVersion { /// $$f_3=\begin{cases}\frac{n_3+\left(1-n_3\right)^2\ln\left(1-n_3\right)}{n_3^2\left(1-n_3\right)^2}&\text{if }n_3>10^{-5}\\\\ /// \frac{3}{2}+\frac{8}{3}n_3+\frac{15}{4}n_3^2+\frac{24}{5}n_3^3+\frac{35}{6}n_3^4&\text{else}\end{cases}$$ /// -/// The weighted densities $n_k(\mathbf{r})$ are calculated by concolving the density profiles $\rho_\alpha(\mathbf{r})$ with weight functions $\omega_k^\alpha(\mathbf{r})$ +/// The weighted densities $n_k(\mathbf{r})$ are calculated by convolving the density profiles $\rho_\alpha(\mathbf{r})$ with weight functions $\omega_k^\alpha(\mathbf{r})$ /// $$n_k(\mathbf{r})=\sum_\alpha\int\rho_\alpha(\mathbf{r}\')\omega_k^\alpha(\mathbf{r}-\mathbf{r}\')\mathrm{d}\mathbf{r}\'$$ /// /// The weight functions differ between the different [FMTVersion]s. diff --git a/feos-saft/src/hard_sphere/mod.rs b/src/hard_sphere/mod.rs similarity index 98% rename from feos-saft/src/hard_sphere/mod.rs rename to src/hard_sphere/mod.rs index d90ba564b..4926c24aa 100644 --- a/feos-saft/src/hard_sphere/mod.rs +++ b/src/hard_sphere/mod.rs @@ -1,3 +1,5 @@ +//! Generic implementation of the hard-sphere contribution +//! that can be used across models. use feos_core::{HelmholtzEnergyDual, StateHD}; use ndarray::*; use num_dual::DualNum; diff --git a/src/lib.rs b/src/lib.rs index 980f7b53b..6ed37c909 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,6 +4,10 @@ #[cfg(feature = "estimator")] pub mod estimator; +#[cfg(feature = "association")] +pub mod association; +pub mod hard_sphere; + // models #[cfg(feature = "gc_pcsaft")] pub mod gc_pcsaft; diff --git a/src/pcsaft/dft/dispersion.rs b/src/pcsaft/dft/dispersion.rs index eb741da5c..f368845e1 100644 --- a/src/pcsaft/dft/dispersion.rs +++ b/src/pcsaft/dft/dispersion.rs @@ -1,11 +1,11 @@ use super::polar::calculate_helmholtz_energy_density_polar; use super::PcSaftParameters; +use crate::hard_sphere::HardSphereProperties; use crate::pcsaft::eos::dispersion::{A0, A1, A2, B0, B1, B2}; use feos_core::EosError; use feos_dft::{ FunctionalContributionDual, WeightFunction, WeightFunctionInfo, WeightFunctionShape, }; -use feos_saft::HardSphereProperties; use ndarray::*; use num_dual::DualNum; use std::f64::consts::{FRAC_PI_3, PI}; diff --git a/src/pcsaft/dft/hard_chain.rs b/src/pcsaft/dft/hard_chain.rs index f2056b793..1a1ea8893 100644 --- a/src/pcsaft/dft/hard_chain.rs +++ b/src/pcsaft/dft/hard_chain.rs @@ -1,9 +1,9 @@ use super::PcSaftParameters; +use crate::hard_sphere::HardSphereProperties; use feos_core::EosError; use feos_dft::{ FunctionalContributionDual, WeightFunction, WeightFunctionInfo, WeightFunctionShape, }; -use feos_saft::HardSphereProperties; use ndarray::*; use num_dual::DualNum; use std::fmt; diff --git a/src/pcsaft/dft/mod.rs b/src/pcsaft/dft/mod.rs index 2a520ee8e..df6d18d34 100644 --- a/src/pcsaft/dft/mod.rs +++ b/src/pcsaft/dft/mod.rs @@ -1,4 +1,6 @@ use super::PcSaftParameters; +use crate::association::Association; +use crate::hard_sphere::{FMTContribution, FMTVersion}; use crate::pcsaft::eos::PcSaftOptions; use feos_core::joback::Joback; use feos_core::parameter::Parameter; @@ -6,7 +8,6 @@ use feos_core::{IdealGasContribution, MolarWeight}; use feos_dft::adsorption::FluidParameters; use feos_dft::solvation::PairPotential; use feos_dft::{FunctionalContribution, HelmholtzEnergyFunctional, MoleculeShape, DFT}; -use feos_saft::{Association, FMTContribution, FMTVersion}; use ndarray::{Array1, Array2}; use num_traits::One; use quantity::si::*; diff --git a/src/pcsaft/dft/polar.rs b/src/pcsaft/dft/polar.rs index 9534241f6..606e77c4d 100644 --- a/src/pcsaft/dft/polar.rs +++ b/src/pcsaft/dft/polar.rs @@ -1,9 +1,9 @@ use super::PcSaftParameters; +use crate::hard_sphere::HardSphereProperties; use crate::pcsaft::eos::polar::{ MeanSegmentNumbers, Multipole, AD, ADQ, ALPHA, AQ, BD, BDQ, BQ, CD, CDQ, CQ, PI_SQ_43, }; use feos_core::EosError; -use feos_saft::HardSphereProperties; use ndarray::*; use num_dual::DualNum; use std::f64::consts::{FRAC_PI_3, PI}; diff --git a/src/pcsaft/dft/pure_saft_functional.rs b/src/pcsaft/dft/pure_saft_functional.rs index 85098cff1..464eb672a 100644 --- a/src/pcsaft/dft/pure_saft_functional.rs +++ b/src/pcsaft/dft/pure_saft_functional.rs @@ -1,13 +1,13 @@ use super::polar::{pair_integral_ij, triplet_integral_ijk}; use super::PcSaftParameters; -// use crate::association::dft::N0_CUTOFF; +use crate::association::Association; +use crate::hard_sphere::{FMTVersion, HardSphereProperties}; use crate::pcsaft::eos::dispersion::{A0, A1, A2, B0, B1, B2}; use crate::pcsaft::eos::polar::{AD, AQ, BD, BQ, CD, CQ, PI_SQ_43}; use feos_core::{EosError, EosResult}; use feos_dft::{ FunctionalContributionDual, WeightFunction, WeightFunctionInfo, WeightFunctionShape, }; -use feos_saft::{Association, FMTVersion, HardSphereProperties}; use ndarray::*; use num_dual::*; use std::f64::consts::{FRAC_PI_6, PI}; diff --git a/src/pcsaft/eos/dispersion.rs b/src/pcsaft/eos/dispersion.rs index 2fe7b8d86..4a3c67c87 100644 --- a/src/pcsaft/eos/dispersion.rs +++ b/src/pcsaft/eos/dispersion.rs @@ -1,6 +1,6 @@ use super::PcSaftParameters; +use crate::hard_sphere::HardSphereProperties; use feos_core::{HelmholtzEnergyDual, StateHD}; -use feos_saft::HardSphereProperties; use num_dual::DualNum; use std::f64::consts::{FRAC_PI_3, PI}; use std::fmt; diff --git a/src/pcsaft/eos/hard_chain.rs b/src/pcsaft/eos/hard_chain.rs index f3f5620da..f4da72970 100644 --- a/src/pcsaft/eos/hard_chain.rs +++ b/src/pcsaft/eos/hard_chain.rs @@ -1,6 +1,6 @@ use super::PcSaftParameters; +use crate::hard_sphere::HardSphereProperties; use feos_core::{HelmholtzEnergyDual, StateHD}; -use feos_saft::HardSphereProperties; use ndarray::Array; use num_dual::*; use std::fmt; diff --git a/src/pcsaft/eos/mod.rs b/src/pcsaft/eos/mod.rs index a8b36d1a8..a10476d3d 100644 --- a/src/pcsaft/eos/mod.rs +++ b/src/pcsaft/eos/mod.rs @@ -1,11 +1,12 @@ use super::parameters::PcSaftParameters; +use crate::association::Association; +use crate::hard_sphere::HardSphere; use feos_core::joback::Joback; use feos_core::parameter::Parameter; use feos_core::{ Contributions, EntropyScaling, EosError, EosResult, EquationOfState, HelmholtzEnergy, IdealGasContribution, MolarWeight, State, }; -use feos_saft::{Association, HardSphere}; use ndarray::Array1; use quantity::si::*; use std::f64::consts::{FRAC_PI_6, PI}; diff --git a/src/pcsaft/eos/polar.rs b/src/pcsaft/eos/polar.rs index e0946c7b3..501fd189a 100644 --- a/src/pcsaft/eos/polar.rs +++ b/src/pcsaft/eos/polar.rs @@ -1,6 +1,6 @@ use super::PcSaftParameters; +use crate::hard_sphere::HardSphereProperties; use feos_core::{HelmholtzEnergyDual, StateHD}; -use feos_saft::HardSphereProperties; use ndarray::prelude::*; use num_dual::DualNum; use std::f64::consts::{FRAC_PI_3, PI}; diff --git a/src/pcsaft/parameters.rs b/src/pcsaft/parameters.rs index b22025233..8aa8856d3 100644 --- a/src/pcsaft/parameters.rs +++ b/src/pcsaft/parameters.rs @@ -1,9 +1,10 @@ +use crate::association::{AssociationParameters, AssociationRecord}; +use crate::hard_sphere::{HardSphereProperties, MonomerShape}; use conv::ValueInto; use feos_core::joback::JobackRecord; use feos_core::parameter::{ FromSegments, FromSegmentsBinary, Parameter, ParameterError, PureRecord, }; -use feos_saft::{AssociationParameters, AssociationRecord, HardSphereProperties, MonomerShape}; use ndarray::{Array, Array1, Array2}; use num_dual::DualNum; use num_traits::Zero; diff --git a/src/pcsaft/python.rs b/src/pcsaft/python.rs index 66d83a46e..875be318f 100644 --- a/src/pcsaft/python.rs +++ b/src/pcsaft/python.rs @@ -1,4 +1,5 @@ use super::parameters::{PcSaftBinaryRecord, PcSaftParameters, PcSaftRecord}; +use crate::association::PyAssociationRecord; use feos_core::joback::JobackRecord; use feos_core::parameter::{ BinaryRecord, Identifier, IdentifierOption, Parameter, ParameterError, PureRecord, @@ -7,7 +8,6 @@ use feos_core::parameter::{ use feos_core::python::joback::PyJobackRecord; use feos_core::python::parameter::*; use feos_core::*; -use feos_saft::PyAssociationRecord; use numpy::{PyArray2, PyReadonlyArray2, ToPyArray}; use pyo3::exceptions::PyTypeError; use pyo3::prelude::*; diff --git a/src/pets/dft/mod.rs b/src/pets/dft/mod.rs index 9ed66588e..66f487089 100644 --- a/src/pets/dft/mod.rs +++ b/src/pets/dft/mod.rs @@ -1,5 +1,6 @@ use super::eos::PetsOptions; use super::parameters::PetsParameters; +use crate::hard_sphere::{FMTContribution, FMTVersion, HardSphereProperties, MonomerShape}; use dispersion::AttractiveFunctional; use feos_core::joback::Joback; use feos_core::parameter::Parameter; @@ -7,7 +8,6 @@ use feos_core::{IdealGasContribution, MolarWeight}; use feos_dft::adsorption::FluidParameters; use feos_dft::solvation::PairPotential; use feos_dft::{FunctionalContribution, HelmholtzEnergyFunctional, MoleculeShape, DFT}; -use feos_saft::{FMTContribution, FMTVersion, HardSphereProperties, MonomerShape}; use ndarray::{Array1, Array2}; use num_dual::DualNum; use pure_pets_functional::*; diff --git a/src/pets/dft/pure_pets_functional.rs b/src/pets/dft/pure_pets_functional.rs index c88fc9e9e..b07e01f5f 100644 --- a/src/pets/dft/pure_pets_functional.rs +++ b/src/pets/dft/pure_pets_functional.rs @@ -1,10 +1,10 @@ +use crate::hard_sphere::FMTVersion; use crate::pets::eos::dispersion::{A, B}; use crate::pets::parameters::PetsParameters; use feos_core::{EosError, EosResult}; use feos_dft::{ FunctionalContributionDual, WeightFunction, WeightFunctionInfo, WeightFunctionShape, }; -use feos_saft::FMTVersion; use ndarray::*; use num_dual::*; use std::f64::consts::{FRAC_PI_6, PI}; diff --git a/src/python/dft.rs b/src/python/dft.rs index aae0f7493..9aa2a36f6 100644 --- a/src/python/dft.rs +++ b/src/python/dft.rs @@ -4,6 +4,7 @@ use crate::estimator::*; use crate::gc_pcsaft::python::PyGcPcSaftFunctionalParameters; #[cfg(feature = "gc_pcsaft")] use crate::gc_pcsaft::{GcPcSaftFunctional, GcPcSaftOptions}; +use crate::hard_sphere::{FMTFunctional, FMTVersion}; #[cfg(feature = "estimator")] use crate::impl_estimator; #[cfg(feature = "pcsaft")] @@ -20,7 +21,6 @@ use feos_dft::interface::*; use feos_dft::python::*; use feos_dft::solvation::*; use feos_dft::*; -use feos_saft::{FMTFunctional, FMTVersion}; use ndarray::{Array1, Array2}; use numpy::convert::ToPyArray; use numpy::{PyArray1, PyArray2, PyArray4}; diff --git a/tests/pcsaft/dft.rs b/tests/pcsaft/dft.rs index 7f21f7a94..7ffafed65 100644 --- a/tests/pcsaft/dft.rs +++ b/tests/pcsaft/dft.rs @@ -1,11 +1,11 @@ #![allow(clippy::excessive_precision)] #![cfg(feature = "dft")] use approx::assert_relative_eq; +use feos::hard_sphere::FMTVersion; use feos::pcsaft::{PcSaft, PcSaftFunctional, PcSaftParameters}; use feos_core::parameter::{IdentifierOption, Parameter}; use feos_core::{Contributions, PhaseEquilibrium, State}; use feos_dft::interface::PlanarInterface; -use feos_saft::FMTVersion; use ndarray::{arr1, Axis}; use quantity::si::*; use std::error::Error; From f4de822d4411e0e9e05d13ac6caca3084b84c6c4 Mon Sep 17 00:00:00 2001 From: Philipp Rehner Date: Wed, 27 Jul 2022 15:47:13 +0200 Subject: [PATCH 3/3] remove obsolete workflows --- .github/workflows/release_saft.yml | 21 --------------------- .github/workflows/test.yml | 2 +- 2 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 .github/workflows/release_saft.yml diff --git a/.github/workflows/release_saft.yml b/.github/workflows/release_saft.yml deleted file mode 100644 index 49e11cb1e..000000000 --- a/.github/workflows/release_saft.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Release feos-saft - -on: - push: - tags: ["feos-saft-v*"] - -jobs: - release-crates-io: - name: Release crates.io - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: katyo/publish-crates@v1 - with: - registry-token: ${{ secrets.CRATES_IO_TOKEN }} - path: './feos-saft' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4170e477e..2ddd0138d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - crate: [feos-core, feos-dft, feos-saft] + crate: [feos-core, feos-dft] steps: - uses: actions/checkout@v3 - name: Build