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 @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]
### Fixed
- Fixed calculation of enthalpies of adsorption for mixtures. [#329](https://github.com/feos-org/feos/pull/329)
- Updated to `ndarray` 0.17 and `num-dual`0.13 to fix a broken dependency resolution. [#327](https://github.com/feos-org/feos/pull/327)
- Fixed calculation of parameter combination in entropy scaling for mixtures in `viscosity_correlation`, `diffusion_correlation`, `thermal_conductivity_correlation`. [#323](https://github.com/feos-org/feos/pull/323)

Expand Down
12 changes: 6 additions & 6 deletions crates/feos-core/src/phase_equilibria/tp_flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ impl<E: Residual> State<E> {
log_iter!(verbosity, "{:-<77}", "");
log_iter!(
verbosity,
" {:4} | | {:10.8} | {:10.8}",
" {:4} | | {:10.8?} | {:10.8?}",
0,
new_vle_state.vapor().molefracs,
new_vle_state.liquid().molefracs,
new_vle_state.vapor().molefracs.data.as_vec(),
new_vle_state.liquid().molefracs.data.as_vec(),
);

let mut iter = 0;
Expand Down Expand Up @@ -279,11 +279,11 @@ impl<E: Residual> PhaseEquilibrium<E, 2> {
let res = res_vec.norm();
log_iter!(
verbosity,
" {:4} | {:14.8e} | {:.8} | {:.8}",
" {:4} | {:14.8e} | {:.8?} | {:.8?}",
iter,
res,
self.vapor().molefracs,
self.liquid().molefracs,
self.vapor().molefracs.data.as_vec(),
self.liquid().molefracs.data.as_vec(),
);
if res < abs_tol {
return Ok(true);
Expand Down
6 changes: 3 additions & 3 deletions crates/feos-dft/src/adsorption/pore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ where
}

pub fn enthalpy_of_adsorption(&self) -> FeosResult<MolarEnergy> {
Ok((self.partial_molar_enthalpy_of_adsorption()?
* Dimensionless::new(&self.profile.bulk.molefracs))
.sum())
Ok(self
.partial_molar_enthalpy_of_adsorption()?
.dot(&Dimensionless::new(self.profile.bulk.molefracs.clone())))
}

fn _henry_coefficients<N: DualNum<f64> + Copy + DctNum>(&self, temperature: N) -> DVector<N> {
Expand Down
2 changes: 1 addition & 1 deletion crates/feos-dft/src/profile/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ where
let n = drho_dmu.shape()[0];
let mut dn_dmu = DMatrix::zeros(n, n);
dn_dmu
.row_iter_mut()
.column_iter_mut()
.zip(drho_dmu.outer_iter())
.for_each(|(mut dn, drho)| dn.add_assign(&self.integrate_reduced_segments(&drho)));
Ok(DnDmu::from_reduced(dn_dmu))
Expand Down
Loading