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 feos-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Made binary parameters in `from_records` Python routine an `Option`. [#35](https://github.com/feos-org/feos/pull/35)
- Added panic with message when parsing missing Identifiers variants. [#35](https://github.com/feos-org/feos/pull/35)
- Generalized the initialization routines for pure component VLEs at given temperature to multicomponent systems. [#23](https://github.com/feos-org/feos/pull/23)
- Increased the default number of maximum iterations for binary critical point calculations from 50 to 200. [#47](https://github.com/feos-org/feos/pull/47)

### Removed
- Removed the (internal) `SpinodalPoint` struct that was used within density iterations in favor of a simpler interface. [#23](https://github.com/feos-org/feos/pull/23)
Expand Down
1 change: 1 addition & 0 deletions feos-core/src/parameter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ where
///
/// If the identifiers in `binary_records` are not a subset of those in
/// `pure_records`, the `Default` implementation of Self::Binary is used.
#[allow(clippy::expect_fun_call)]
fn binary_matrix_from_records(
pure_records: &Vec<PureRecord<Self::Pure, Self::IdealGas>>,
binary_records: &[BinaryRecord<Identifier, Self::Binary>],
Expand Down
5 changes: 3 additions & 2 deletions feos-core/src/phase_equilibria/phase_diagram_binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ where
x.slice(s![1..])
};

let mut tp_old = Some(vle_0.vapor().tp(tp));
let tp_0 = Some(vle_0.vapor().tp(tp));
let mut tp_old = tp_0;
let mut y_old = None;
vle_vec.push(vle_0);
for xi in x {
Expand All @@ -232,7 +233,7 @@ where
vle_vec.push(vle.clone());
} else {
y_old = None;
tp_old = None;
tp_old = tp_0;
}
}
if let Some(vle_1) = vle_1 {
Expand Down
7 changes: 5 additions & 2 deletions feos-core/src/state/critical_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::convert::TryFrom;
use std::rc::Rc;

const MAX_ITER_CRIT_POINT: usize = 50;
const MAX_ITER_CRIT_POINT_BINARY: usize = 200;
const TOL_CRIT_POINT: f64 = 1e-8;

/// # Critical points
Expand Down Expand Up @@ -185,7 +186,8 @@ impl<U: EosUnit, E: EquationOfState> State<U, E> {
where
QuantityScalar<U>: std::fmt::Display,
{
let (max_iter, tol, verbosity) = options.unwrap_or(MAX_ITER_CRIT_POINT, TOL_CRIT_POINT);
let (max_iter, tol, verbosity) =
options.unwrap_or(MAX_ITER_CRIT_POINT_BINARY, TOL_CRIT_POINT);

let t = temperature.to_reduced(U::reference_temperature())?;
let x = StaticVec::new_vec(initial_molefracs.unwrap_or([0.5, 0.5]));
Expand Down Expand Up @@ -271,7 +273,8 @@ impl<U: EosUnit, E: EquationOfState> State<U, E> {
where
QuantityScalar<U>: std::fmt::Display,
{
let (max_iter, tol, verbosity) = options.unwrap_or(MAX_ITER_CRIT_POINT, TOL_CRIT_POINT);
let (max_iter, tol, verbosity) =
options.unwrap_or(MAX_ITER_CRIT_POINT_BINARY, TOL_CRIT_POINT);

let p = pressure.to_reduced(U::reference_pressure())?;
let mut t = initial_temperature
Expand Down