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§
Sourcefn components(&self) -> usize
fn components(&self) -> usize
Return the number of components in the system.
Sourcefn compute_max_density<D: DualNum<f64> + Copy>(
&self,
molefracs: &DVector<D>,
) -> D
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).
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.