Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
Entropy scaling parameters for homo GC (#30)
Browse files Browse the repository at this point in the history
* Add segment based parameters for entropy scaling of viscosity

* Changes based on changes in core

* Added translation of GC parameter of viscosity

* Fixed wrong parameters and shift value

* refactored reference for thermal conductivity

* Removed unused references

* Added parameters of Loetgering-Lin 2015 paper to bibtex file and readme

* Updated changelog

* removed unused import

* Update dependencies in build_wheel to github

* Fix clippy lints (#37)

Co-authored-by: Philipp Rehner <69816385+prehner@users.noreply.github.com>
  • Loading branch information
g-bauer and prehner authored Apr 14, 2022
1 parent 04ff8f4 commit bfb408c
Show file tree
Hide file tree
Showing 16 changed files with 375 additions and 108 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- `PcSaftFunctional` now always uses `Joback` as ideal gas model if parameters are available. [#25](https://github.com/feos-org/feos-pcsaft/pull/25)
- Added entropy scaling correlation parameters of viscosity and thermal conductivity for the homo-segmented group contribution method in `PcSaftRecord::from_segments`. [#30](https://github.com/feos-org/feos-pcsaft/pull/30)
- Added parameters published by Loetgering-Lin et al. for entropy scaling of viscosity via homo GC method. [#30](https://github.com/feos-org/feos-pcsaft/pull/30)
- Added `pyproject.toml`. [#31]

### Changed
- Added optional arguments to the constructor of `PcSaftFunctional` in Python to make it more analogous to `PcSaft`. [#34](https://github.com/feos-org/feos-pcsaft/pull/34)
- Building Pc-SAFT parameters from segments does not check anymore, whether multiple polar or associating groups are present. [#33](https://github.com/feos-org/feos-pcsaft/pull/33)
- Moved the creation of the python module to the build_wheel auxilliary crate, so that only the relevant structs and macros are available for the dependents. [#29](https://github.com/feos-org/feos-pcsaft/pull/29)

### Packaging
- updated `feos-core` and `feos-dft` to `0.2`. [#30](https://github.com/feos-org/feos-pcsaft/pull/30)

## [0.1.0] - 2022-01-12
### Added
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ exclude = ["/.github/*", "*.ipynb", "/examples/*", "/parameters/*"]

[dependencies]
quantity = "0.5"
feos-core = { git = "https://github.com/feos-org/feos-core" }
feos-dft = { git = "https://github.com/feos-org/feos-dft", branch = "v0.2.0" }
feos-core = "0.2"
feos-dft = "0.2"
num-dual = "0.5"
num-traits = "0.2"
ndarray = { version = "0.15", features=["approx"] }
Expand Down
4 changes: 2 additions & 2 deletions build_wheel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ crate-type = ["cdylib"]

[dependencies]
quantity = "0.5"
feos-core = { git = "https://github.com/feos-org/feos-core" }
feos-dft = { git = "https://github.com/feos-org/feos-dft", branch = "v0.2.0" }
feos-core = "0.2"
feos-dft = "0.2"
feos-pcsaft = { path = "..", features = ["python"] }
pyo3 = { version = "0.16", features = ["extension-module", "abi3", "abi3-py37"] }
numpy = "0.16"
2 changes: 2 additions & 0 deletions parameters/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ The files named according to the pattern `NameYear.json` correspond to published
|-|-|:-:|
[`sauer2014_homo.json`](sauer2014_homo.json) | GC segment parameters for homo segmented PC-SAFT | [&#128279;](https://doi.org/10.1021/ie502203w) |
[`sauer2014_hetero.json`](sauer2014_hetero.json) | GC segment parameters for hetero segmented PC-SAFT | [&#128279;](https://doi.org/10.1021/ie502203w)
[`loetgeringlin2015_homo.json`](loetgeringlin2015_homo.json) | GC segment parameters for homo segmented PC-SAFT including parameters for viscosity for entropy scaling | [&#128279;](https://doi.org/10.1021/acs.iecr.5b01698)


13 changes: 12 additions & 1 deletion parameters/literature.bib
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,16 @@ @article{loetgeringlin2018
eprint = {https://doi.org/10.1021/acs.iecr.7b04871}
}


@article{loetgeringlin2015,
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},
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}
}

228 changes: 228 additions & 0 deletions parameters/loetgeringlin2015_homo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
[
{
"identifier": "CH3",
"model_record": {
"m": 0.61198,
"sigma": 3.7202,
"epsilon_k": 229.90,
"viscosity": [-8.6878e-3, -1.7951e-1, -12.2359e-2, -0.01245]
},
"molarweight": 15.0345
},
{
"identifier": "CH2",
"model_record": {
"m": 0.45606,
"sigma": 3.8900,
"epsilon_k": 239.01,
"viscosity": [-0.9194e-3, -1.3316e-1, -4.2657e-2, -0.01245]
},
"molarweight": 14.02658
},

{
"identifier": ">CH",
"model_record": {
"m": 0.14304,
"sigma": 4.8597,
"epsilon_k": 347.64,
"viscosity": [12.8159e-3, -0.3416e-1, 5.5752e-2, -0.01245]
},
"molarweight": 13.01854
},
{
"identifier": ">C<",
"model_record": {
"m": -0.66997,
"sigma": -1.7878,
"epsilon_k": 107.68,
"viscosity": [152.5629e-3, 12.3998e-1, 13.8406e-2, -0.01245]
},
"molarweight": 12.0107
},
{
"identifier": "=CH2",
"model_record": {
"m": 0.36939,
"sigma": 4.0264,
"epsilon_k": 289.49,
"viscosity": [-6.3736e-3, 42.4367e-1, -10.8726e-2, -0.01245]
},
"molarweight": 14.02658
},
{
"identifier": "=CH",
"model_record": {
"m": 0.56361,
"sigma": 3.5519,
"epsilon_k": 216.69,
"viscosity": [-5.0637e-3, -43.5678e-1, -5.4247e-2, -0.01245]
},
"molarweight": 13.01854
},
{
"identifier": "=C<",
"model_record": {
"m": 0.86367,
"sigma": 3.1815,
"epsilon_k": 156.31
},
"molarweight": 12.0107
},
{
"identifier": "C≡CH",
"model_record": {
"m": 1.3279,
"sigma": 2.9421,
"epsilon_k": 223.05
},
"molarweight": 25.02924
},
{
"identifier": "CH2_hex",
"model_record": {
"m": 0.39496,
"sigma": 3.9126,
"epsilon_k": 289.03,
"viscosity": [-3.7896e-3, -1.4796e-1, -4.5017e-2, -0.01245]
},
"molarweight": 14.02658
},
{
"identifier": "CH_hex",
"model_record": {
"m": 0.02880,
"sigma": 8.9779,
"epsilon_k": 1306.7
},
"molarweight": 13.01854
},
{
"identifier": "CH2_pent",
"model_record": {
"m": 0.46742,
"sigma": 3.7272,
"epsilon_k": 267.16,
"viscosity": [-3.8105e-3, -1.628e-1, -6.7905e-2, -0.01245]
},
"molarweight": 14.02658
},
{
"identifier": "CH_pent",
"model_record": {
"m": 0.03314,
"sigma": 7.7190,
"epsilon_k": 1297.7
},
"molarweight": 13.01854
},
{
"identifier": "CH_arom",
"model_record": {
"m": 0.42335,
"sigma": 3.7270,
"epsilon_k": 274.41,
"viscosity": [-4.7664e-3, -1.6842e-1, -6.5606e-2, -0.01245]
},
"molarweight": 13.01854
},
{
"identifier": "C_arom",
"model_record": {
"m": 0.15371,
"sigma": 3.9622,
"epsilon_k": 527.20,
"viscosity": [14.428e-3, 0.1104e-1, -0.0699e-2, -0.01245]
},
"molarweight": 12.0107
},
{
"identifier": "CH=O",
"model_record": {
"m": 1.5774,
"sigma": 2.8035,
"epsilon_k": 242.99,
"mu": 2.4556,
"viscosity": [8.8675e-3, -1.482e-1, -9.1325e-2, -0.01245]
},
"molarweight": 29.01754
},
{
"identifier": ">C=O",
"model_record": {
"m": 1.2230,
"sigma": 2.8124,
"epsilon_k": 249.04,
"mu": 3.2432
},
"molarweight": 28.0097
},
{
"identifier": "OCH3",
"model_record": {
"m": 1.6539,
"sigma": 3.0697,
"epsilon_k": 196.05,
"mu": 1.3866,
"viscosity": [-4.6001e-3, -1.6433e-1, -5.3118e-2, -0.01245]
},
"molarweight": 31.03322
},
{
"identifier": "OCH2",
"model_record": {
"m": 1.1349,
"sigma": 3.2037,
"epsilon_k": 187.13,
"mu": 2.7440,
"viscosity": [-5.5435e-3, -2.2345e-1, -9.9967e-2, -0.01245]
},
"molarweight": 30.02538
},
{
"identifier": "HCOO",
"model_record": {
"m": 1.7525,
"sigma": 2.9043,
"epsilon_k": 229.63,
"mu": 2.7916
},
"molarweight": 45.01654
},
{
"identifier": "COO",
"model_record": {
"m": 1.5063,
"sigma": 2.8166,
"epsilon_k": 222.52,
"mu": 3.1652,
"viscosity": [-0.3295e-3, -1.1893e-1, 6.9576e-2, -0.01245]
},
"molarweight": 44.0087
},
{
"identifier": "OH",
"model_record": {
"m": 0.40200,
"sigma": 3.2859,
"epsilon_k": 488.66,
"epsilon_k_ab": 2517.0,
"kappa_ab": 0.006825,
"viscosity": [-15.7583e-3, -2.5654e-1, -23.1537e-2, -0.01245]
},
"molarweight": 17.00734
},
{
"identifier": "NH2",
"model_record": {
"m": 0.40558,
"sigma": 3.6456,
"epsilon_k": 467.59,
"epsilon_k_ab": 1064.6,
"kappa_ab": 0.026662,
"viscosity": [-4.4048e-3, -0.6089e-1, -8.9017e-2, -0.01245]
},
"molarweight": 16.02238
}
]

4 changes: 2 additions & 2 deletions src/dft/association.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct AssociationFunctional {
impl AssociationFunctional {
pub fn new(parameters: Rc<PcSaftParameters>, max_iter: usize, tol: f64) -> Self {
Self {
parameters: parameters.clone(),
parameters,
max_iter,
tol,
}
Expand Down Expand Up @@ -54,7 +54,7 @@ where
.add(
WeightFunction {
prefactor: p.m.mapv(N::from),
kernel_radius: r.clone(),
kernel_radius: r,
shape: WeightFunctionShape::Theta,
},
true,
Expand Down
4 changes: 1 addition & 3 deletions src/dft/dispersion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ pub struct AttractiveFunctional {

impl AttractiveFunctional {
pub fn new(parameters: Rc<PcSaftParameters>) -> Self {
Self {
parameters: parameters.clone(),
}
Self { parameters }
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/dft/hard_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub(super) fn hard_chain_weight_functions<N: DualNum<f64> + ScalarOperand, P: FM
lambda: bool,
) -> WeightFunctionInfo<N> {
let d = p.hs_diameter(temperature);
let mut weight_functions = WeightFunctionInfo::new(p.component_index().clone(), true)
let mut weight_functions = WeightFunctionInfo::new(p.component_index(), true)
.add(
WeightFunction {
prefactor: p.chain_length().mapv(|m| m.into()) / (&d * 8.0),
Expand Down Expand Up @@ -48,9 +48,7 @@ pub struct ChainFunctional {

impl ChainFunctional {
pub fn new(parameters: Rc<PcSaftParameters>) -> Self {
Self {
parameters: parameters.clone(),
}
Self { parameters }
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/dft/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,27 @@ impl PcSaftFunctional {
) && parameters.m.len() == 1
{
let fmt_assoc = PureFMTAssocFunctional::new(parameters.clone(), fmt_version);
contributions.push(Box::new(fmt_assoc.clone()));
contributions.push(Box::new(fmt_assoc));
if parameters.m.iter().any(|&mi| mi > 1.0) {
let chain = PureChainFunctional::new(parameters.clone());
contributions.push(Box::new(chain.clone()));
contributions.push(Box::new(chain));
}
let att = PureAttFunctional::new(parameters.clone());
contributions.push(Box::new(att.clone()));
contributions.push(Box::new(att));
} else {
// Hard sphere contribution
let hs = FMTContribution::new(&parameters, fmt_version);
contributions.push(Box::new(hs.clone()));
contributions.push(Box::new(hs));

// Hard chains
if parameters.m.iter().any(|&mi| !mi.is_one()) {
let chain = ChainFunctional::new(parameters.clone());
contributions.push(Box::new(chain.clone()));
contributions.push(Box::new(chain));
}

// Dispersion
let att = AttractiveFunctional::new(parameters.clone());
contributions.push(Box::new(att.clone()));
contributions.push(Box::new(att));

// Association
if parameters.nassoc > 0 {
Expand All @@ -83,7 +83,7 @@ impl PcSaftFunctional {
saft_options.max_iter_cross_assoc,
saft_options.tol_cross_assoc,
);
contributions.push(Box::new(assoc.clone()));
contributions.push(Box::new(assoc));
}
}

Expand All @@ -93,7 +93,7 @@ impl PcSaftFunctional {
};

(Self {
parameters: parameters.clone(),
parameters,
fmt_version,
options: saft_options,
contributions,
Expand Down
Loading

0 comments on commit bfb408c

Please sign in to comment.