Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed off-by-one error for the convergence-check in `_density_iteration`. [#386](https://github.com/feos-org/feos/pull/386)
- Fixed erroneously transposed jacobian layout in binary association of `PcSaftBinary`. [#386](https://github.com/feos-org/feos/pull/386)
- Fixed parsing of binary group/group interaction parameters in gc-PC-SAFT. [#389](https://github.com/feos-org/feos/pull/389)

## [0.10.1] - 2026-07-24
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion crates/feos/src/gc_pcsaft/dft/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl GcPcSaftFunctionalParameters {
);

// Combining rules dispersion
let [k_ij] = parameters.collate_binary(|&br| [br]);
let [k_ij] = parameters.collate_binary(|&br| [br.k_ij]);
let sigma_ij =
DMatrix::from_fn(sigma.len(), sigma.len(), |i, j| 0.5 * (sigma[i] + sigma[j]));
let epsilon_k_ij = DMatrix::from_fn(epsilon_k.len(), epsilon_k.len(), |i, j| {
Expand Down
12 changes: 8 additions & 4 deletions crates/feos/src/gc_pcsaft/eos/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl GcPcSaftEosParameters {
}

// Combining rules dispersion
let [k_ij] = parameters.collate_binary(|&br| [br]);
let [k_ij] = parameters.collate_binary(|&br| [br.k_ij]);
let sigma_ij =
DMatrix::from_fn(sigma.len(), sigma.len(), |i, j| 0.5 * (sigma[i] + sigma[j]));
let epsilon_k_ij = DMatrix::from_fn(epsilon_k.len(), epsilon_k.len(), |i, j| {
Expand Down Expand Up @@ -142,13 +142,13 @@ impl AssociationStrength for GcPcSaftEosParameters {
#[cfg(test)]
pub mod test {
use super::*;
use crate::gc_pcsaft::GcPcSaftRecord;
use crate::gc_pcsaft::{GcPcSaftRecord, record::GcPcSaftBinaryRecord};
use feos_core::parameter::{
AssociationRecord, BinarySegmentRecord, ChemicalRecord, Identifier, SegmentRecord,
};

type Pure = SegmentRecord<GcPcSaftRecord, GcPcSaftAssociationRecord>;
type Binary = BinarySegmentRecord<f64, GcPcSaftAssociationRecord>;
type Binary = BinarySegmentRecord<GcPcSaftBinaryRecord, GcPcSaftAssociationRecord>;

fn ch3() -> Pure {
SegmentRecord::new(
Expand Down Expand Up @@ -181,7 +181,11 @@ pub mod test {
}

pub fn ch3_oh() -> Binary {
BinarySegmentRecord::new("CH3".to_string(), "OH".to_string(), Some(-0.0087))
BinarySegmentRecord::new(
"CH3".to_string(),
"OH".to_string(),
Some(GcPcSaftBinaryRecord::new(-0.0087)),
)
}

pub fn propane() -> GcPcSaftEosParameters {
Expand Down
15 changes: 14 additions & 1 deletion crates/feos/src/gc_pcsaft/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ impl CombiningRule<GcPcSaftRecord> for GcPcSaftAssociationRecord {
}
}

/// gc-PC-SAFT binary interaction parameters.
#[derive(Serialize, Deserialize, Clone, Copy, Default)]
pub struct GcPcSaftBinaryRecord {
/// Binary dispersion group-group interaction parameter
pub k_ij: f64,
}

impl GcPcSaftBinaryRecord {
pub fn new(k_ij: f64) -> Self {
Self { k_ij }
}
}

/// Parameter set required for the gc-PC-SAFT equation of state.
pub type GcPcSaftParameters<C> =
GcParameters<GcPcSaftRecord, f64, GcPcSaftAssociationRecord, (), C>;
GcParameters<GcPcSaftRecord, GcPcSaftBinaryRecord, GcPcSaftAssociationRecord, (), C>;
Loading