ResidualDyn

Trait ResidualDyn 

Source
pub trait ResidualDyn {
    // Required methods
    fn components(&self) -> usize;
    fn compute_max_density<D: DualNum<f64> + Copy>(
        &self,
        molefracs: &DVector<D>,
    ) -> D;
    fn reduced_helmholtz_energy_density_contributions<D: DualNum<f64> + Copy>(
        &self,
        state: &StateHD<D>,
    ) -> Vec<(&'static str, D)>;
}
Expand description

A simple residual Helmholtz energy model for arbitrary many components and no automatic differentiation of model parameters.

This is a shortcut to implementing Residual<Dyn, f64>. To avoid unnecessary cloning, Residual<Dyn, f64> is automatically implemented for all pointer types that deref to the struct implementing ResidualDyn and are Clone (i.e., Rc<T>, Arc<T>, &T, …).

Required Methods§

Source

fn components(&self) -> usize

Return the number of components in the system.

Source

fn compute_max_density<D: DualNum<f64> + Copy>( &self, molefracs: &DVector<D>, ) -> D

Return the maximum density in Angstrom^-3.

This value is used as an estimate for a liquid phase for phase equilibria and other iterations. It is not explicitly meant to be a mathematical limit for the density (if those exist in the equation of state anyways).

Source

fn reduced_helmholtz_energy_density_contributions<D: DualNum<f64> + Copy>( &self, state: &StateHD<D>, ) -> Vec<(&'static str, D)>

Evaluate the reduced Helmholtz energy density of each individual contribution and return them together with a string representation of the contribution.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§