pub trait Residual<N: Dim = Dyn, D: DualNum<f64> + Copy = f64>: Clonewhere
DefaultAllocator: Allocator<N>,{
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§
Required Methods§
Sourcefn components(&self) -> usize
fn components(&self) -> usize
Return the number of components in the system.
Sourcefn lift<D2: DualNum<f64, Inner = D> + Copy>(&self) -> Self::Lifted<D2>
fn lift<D2: DualNum<f64, Inner = D> + Copy>(&self) -> Self::Lifted<D2>
Return the lifted residual model.
Sourcefn compute_max_density(&self, molefracs: &OVector<D, N>) -> D
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).
Sourcefn reduced_helmholtz_energy_density_contributions(
&self,
state: &StateHD<D, N>,
) -> Vec<(&'static str, D)>
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§
Sourcefn pure_molefracs() -> OVector<D, N>
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>.
Sourcefn reduced_residual_helmholtz_energy_density(&self, state: &StateHD<D, N>) -> D
fn reduced_residual_helmholtz_energy_density(&self, state: &StateHD<D, N>) -> D
Evaluate the residual reduced Helmholtz energy density $\beta f^\mathrm{res}$.
Sourcefn molar_helmholtz_energy_contributions(
&self,
temperature: D,
molar_volume: D,
molefracs: &OVector<D, N>,
) -> Vec<(&'static str, D)>
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.
Sourcefn residual_molar_helmholtz_energy(
&self,
temperature: D,
molar_volume: D,
molefracs: &OVector<D, N>,
) -> D
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}$.
Sourcefn residual_helmholtz_energy(
&self,
temperature: D,
volume: D,
moles: &OVector<D, N>,
) -> D
fn residual_helmholtz_energy( &self, temperature: D, volume: D, moles: &OVector<D, N>, ) -> D
Evaluate the residual Helmholtz energy $A^\mathrm{res}$.
Sourcefn residual_helmholtz_energy_unit(
&self,
temperature: Temperature<D>,
volume: Volume<D>,
moles: &Moles<OVector<D, N>>,
) -> Energy<D>
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}$.
Sourcefn validate_molefracs(
&self,
molefracs: &Option<OVector<D, N>>,
) -> FeosResult<OVector<D, N>>
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.
Sourcefn max_density(
&self,
molefracs: &Option<OVector<D, N>>,
) -> FeosResult<Density<D>>
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).
Sourcefn second_virial_coefficient(
&self,
temperature: Temperature<D>,
molefracs: &Option<OVector<D, N>>,
) -> MolarVolume<D>
fn second_virial_coefficient( &self, temperature: Temperature<D>, molefracs: &Option<OVector<D, N>>, ) -> MolarVolume<D>
Calculate the second virial coefficient $B(T)$
Sourcefn third_virial_coefficient(
&self,
temperature: Temperature<D>,
molefracs: &Option<OVector<D, N>>,
) -> Quot<MolarVolume<D>, Density<D>>
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)$
Sourcefn second_virial_coefficient_temperature_derivative(
&self,
temperature: Temperature<D>,
molefracs: &Option<OVector<D, N>>,
) -> Quot<MolarVolume<D>, Temperature<D>>
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)$
Sourcefn third_virial_coefficient_temperature_derivative(
&self,
temperature: Temperature<D>,
molefracs: &Option<OVector<D, N>>,
) -> Quot<Quot<MolarVolume<D>, Density<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>>
Calculate the temperature derivative of the third virial coefficient $C’(T)$
Sourcefn p_dpdrho(
&self,
temperature: D,
density: D,
molefracs: &OVector<D, N>,
) -> (D, D, D)
fn p_dpdrho( &self, temperature: D, density: D, molefracs: &OVector<D, N>, ) -> (D, D, D)
calculates a_res, p, dp_drho
Sourcefn p_dpdrho_d2pdrho2(
&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)
calculates p, dp_drho, d2p_drho2
Sourcefn dmu_drho(
&self,
temperature: D,
partial_density: &OVector<D, N>,
) -> (D, OVector<D, N>, OVector<D, N>, OMatrix<D, N, N>)
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
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.