Skip to content

Conversation

@prehner
Copy link
Contributor

@prehner prehner commented Mar 13, 2025

This comes at the (very manageable) cost of having to implement

impl Residual for PcSaftFunctional {
    fn compute_max_density(&self, moles: &Array1<f64>) -> f64 {
        // moved from the implementation of `HelmholtzEnergyFunctional`
    }

    fn residual_helmholtz_energy_contributions<D: DualNum<f64> + Copy + ScalarOperand>(
        &self,
        state: &StateHD<D>,
    ) -> Vec<(String, D)> {
        self.evaluate_bulk(state)
    }
}

for every functional.

Benefits:

  • No more two State and PhaseEquilibrium Python classes!!
  • Could merge PC-SAFT and the PC-SAFT functional (or other models) into one single struct in the future. This would clear up the namespace even further, but would require the models to be identical.
  • Also, compile times are down 🥳

@prehner prehner force-pushed the remove_dft_wrapper branch from 729290c to 97d254c Compare March 13, 2025 11:23
@g-bauer
Copy link
Contributor

g-bauer commented Mar 13, 2025

That's a great change! 🥳

@prehner prehner merged commit c40259c into main Mar 14, 2025
15 checks passed
@prehner prehner deleted the remove_dft_wrapper branch March 14, 2025 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants