Residual

Trait Residual 

Source
pub trait Residual<N: Dim = Dyn, D: DualNum<f64> + Copy = f64>: Clone{
    type Real: Residual<N>;
    type Lifted<D2: DualNum<f64, Inner = D> + Copy>: Residual<N, D2>;

Show 22 methods // Required methods fn components(&self) -> usize; fn re(&self) -> Self::Real; fn lift<D2: DualNum<f64, Inner = D> + Copy>(&self) -> Self::Lifted<D2>; fn compute_max_density(&self, molefracs: &OVector<D, N>) -> D; fn reduced_helmholtz_energy_density_contributions( &self, state: &StateHD<D, N>, ) -> Vec<(&'static str, D)>; // Provided methods fn pure_molefracs() -> OVector<D, N> { ... } fn reduced_residual_helmholtz_energy_density( &self, state: &StateHD<D, N>, ) -> D { ... } fn molar_helmholtz_energy_contributions( &self, temperature: D, molar_volume: D, molefracs: &OVector<D, N>, ) -> Vec<(&'static str, D)> { ... } fn residual_molar_helmholtz_energy( &self, temperature: D, molar_volume: D, molefracs: &OVector<D, N>, ) -> D { ... } fn residual_helmholtz_energy( &self, temperature: D, volume: D, moles: &OVector<D, N>, ) -> D { ... } fn residual_helmholtz_energy_unit( &self, temperature: Temperature<D>, volume: Volume<D>, moles: &Moles<OVector<D, N>>, ) -> Energy<D> { ... } fn validate_molefracs( &self, molefracs: &Option<OVector<D, N>>, ) -> FeosResult<OVector<D, N>> { ... } fn max_density( &self, molefracs: &Option<OVector<D, N>>, ) -> FeosResult<Density<D>> { ... } fn second_virial_coefficient( &self, temperature: Temperature<D>, molefracs: &Option<OVector<D, N>>, ) -> MolarVolume<D> { ... } fn third_virial_coefficient( &self, temperature: Temperature<D>, molefracs: &Option<OVector<D, N>>, ) -> Quot<MolarVolume<D>, Density<D>> { ... } fn second_virial_coefficient_temperature_derivative( &self, temperature: Temperature<D>, molefracs: &Option<OVector<D, N>>, ) -> Quot<MolarVolume<D>, Temperature<D>> { ... } fn third_virial_coefficient_temperature_derivative( &self, temperature: Temperature<D>, molefracs: &Option<OVector<D, N>>, ) -> Quot<Quot<MolarVolume<D>, Density<D>>, Temperature<D>> { ... } fn p_dpdrho( &self, temperature: D, density: D, molefracs: &OVector<D, N>, ) -> (D, D, D) { ... } fn p_dpdrho_d2pdrho2( &self, temperature: D, density: D, molefracs: &OVector<D, N>, ) -> (D, D, D) { ... } fn dmu_drho( &self, temperature: D, partial_density: &OVector<D, N>, ) -> (D, OVector<D, N>, OVector<D, N>, OMatrix<D, N, N>) where N: Gradients, DefaultAllocator: Allocator<N, N> { ... } fn dmu_dv( &self, temperature: D, molar_volume: D, molefracs: &OVector<D, N>, ) -> (D, OVector<D, N>, D, OVector<D, N>) where N: Gradients { ... } fn dmu_dt( &self, temperature: D, partial_density: &OVector<D, N>, ) -> (D, OVector<D, N>) where N: Gradients { ... }
}
Expand description

A residual Helmholtz energy model.

Required Associated Types§

Source

type Real: Residual<N>

The residual model with only the real parts of the model parameters.

Source

type Lifted<D2: DualNum<f64, Inner = D> + Copy>: Residual<N, D2>

The residual model with the model parameters lifted to a higher dual number.

Required Methods§

Source

fn components(&self) -> usize

Return the number of components in the system.

Source

fn re(&self) -> Self::Real

Return the real part of the residual model.

Source

fn lift<D2: DualNum<f64, Inner = D> + Copy>(&self) -> Self::Lifted<D2>

Return the lifted residual model.

Source

fn compute_max_density(&self, molefracs: &OVector<D, N>) -> 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( &self, state: &StateHD<D, N>, ) -> 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.

Provided Methods§

Source

fn pure_molefracs() -> OVector<D, N>

Return a generic composition vector for a pure component.

Panics if N is not Dyn(1) or Const<1>.

Source

fn reduced_residual_helmholtz_energy_density(&self, state: &StateHD<D, N>) -> D

Evaluate the residual reduced Helmholtz energy density $\beta f^\mathrm{res}$.

Source

fn molar_helmholtz_energy_contributions( &self, temperature: D, molar_volume: D, molefracs: &OVector<D, N>, ) -> Vec<(&'static str, D)>

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

Source

fn residual_molar_helmholtz_energy( &self, temperature: D, molar_volume: D, molefracs: &OVector<D, N>, ) -> D

Evaluate the residual molar Helmholtz energy $a^\mathrm{res}$.

Source

fn residual_helmholtz_energy( &self, temperature: D, volume: D, moles: &OVector<D, N>, ) -> D

Evaluate the residual Helmholtz energy $A^\mathrm{res}$.

Source

fn residual_helmholtz_energy_unit( &self, temperature: Temperature<D>, volume: Volume<D>, moles: &Moles<OVector<D, N>>, ) -> Energy<D>

Evaluate the residual Helmholtz energy $A^\mathrm{res}$.

Source

fn validate_molefracs( &self, molefracs: &Option<OVector<D, N>>, ) -> FeosResult<OVector<D, N>>

Check if the provided optional molar concentration is consistent with the equation of state.

In general, the number of elements in molefracs needs to match the number of components of the equation of state. For a pure component, however, no molefracs need to be provided.

Source

fn max_density( &self, molefracs: &Option<OVector<D, N>>, ) -> FeosResult<Density<D>>

Calculate the maximum density.

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 second_virial_coefficient( &self, temperature: Temperature<D>, molefracs: &Option<OVector<D, N>>, ) -> MolarVolume<D>

Calculate the second virial coefficient $B(T)$

Source

fn third_virial_coefficient( &self, temperature: Temperature<D>, molefracs: &Option<OVector<D, N>>, ) -> Quot<MolarVolume<D>, Density<D>>

Calculate the third virial coefficient $C(T)$

Source

fn second_virial_coefficient_temperature_derivative( &self, temperature: Temperature<D>, molefracs: &Option<OVector<D, N>>, ) -> Quot<MolarVolume<D>, Temperature<D>>

Calculate the temperature derivative of the second virial coefficient $B’(T)$

Source

fn third_virial_coefficient_temperature_derivative( &self, temperature: Temperature<D>, molefracs: &Option<OVector<D, N>>, ) -> Quot<Quot<MolarVolume<D>, Density<D>>, Temperature<D>>

Calculate the temperature derivative of the third virial coefficient $C’(T)$

Source

fn p_dpdrho( &self, temperature: D, density: D, molefracs: &OVector<D, N>, ) -> (D, D, D)

calculates a_res, p, dp_drho

Source

fn p_dpdrho_d2pdrho2( &self, temperature: D, density: D, molefracs: &OVector<D, N>, ) -> (D, D, D)

calculates p, dp_drho, d2p_drho2

Source

fn dmu_drho( &self, temperature: D, partial_density: &OVector<D, N>, ) -> (D, OVector<D, N>, OVector<D, N>, OMatrix<D, N, N>)

calculates p, mu_res, dp_drho, dmu_drho

Source

fn dmu_dv( &self, temperature: D, molar_volume: D, molefracs: &OVector<D, N>, ) -> (D, OVector<D, N>, D, OVector<D, N>)
where N: Gradients,

calculates p, mu_res, dp_dv, dmu_dv

Source

fn dmu_dt( &self, temperature: D, partial_density: &OVector<D, N>, ) -> (D, OVector<D, N>)
where N: Gradients,

calculates dp_dt, dmu_res_dt

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§

Source§

impl<C: Deref<Target = T> + Clone, T: ResidualDyn, D: DualNum<f64> + Copy> Residual<Dyn, D> for C

Source§

type Real = C

Source§

type Lifted<D2: DualNum<f64, Inner = D> + Copy> = C

Source§

impl<I: Clone, R: Residual<Const<N>, D>, D: DualNum<f64> + Copy, const N: usize> Residual<Const<N>, D> for EquationOfState<[I; N], R>

Source§

type Real = EquationOfState<[I; N], <R as Residual<Const<N>, D>>::Real>

Source§

type Lifted<D2: DualNum<f64, Inner = D> + Copy> = EquationOfState<[I; N], <R as Residual<Const<N>, D>>::Lifted<D2>>