pub struct EquationOfState<I, R> {
pub ideal_gas: I,
pub residual: R,
}Expand description
An equation of state consisting of an ideal gas model and a residual Helmholtz energy model.
Fields§
§ideal_gas: I§residual: RImplementations§
Source§impl<I, R> EquationOfState<I, R>
impl<I, R> EquationOfState<I, R>
Sourcepub fn new(ideal_gas: I, residual: R) -> Self
pub fn new(ideal_gas: I, residual: R) -> Self
Return a new EquationOfState with the given ideal gas and residual models.
Source§impl<I> EquationOfState<Vec<I>, NoResidual>
impl<I> EquationOfState<Vec<I>, NoResidual>
Sourcepub fn ideal_gas(ideal_gas: Vec<I>) -> Self
pub fn ideal_gas(ideal_gas: Vec<I>) -> Self
Return a new EquationOfState that only consists of an ideal gas models.
Trait Implementations§
Source§impl<I: Clone, R: Clone> Clone for EquationOfState<I, R>
impl<I: Clone, R: Clone> Clone for EquationOfState<I, R>
Source§fn clone(&self) -> EquationOfState<I, R>
fn clone(&self) -> EquationOfState<I, R>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<I, R> Deref for EquationOfState<I, R>
impl<I, R> Deref for EquationOfState<I, R>
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>
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>
type Real = EquationOfState<[I; N], <R as Residual<Const<N>, D>>::Real>
The residual model with only the real parts of the model parameters.
Source§type Lifted<D2: DualNum<f64, Inner = D> + Copy> = EquationOfState<[I; N], <R as Residual<Const<N>, D>>::Lifted<D2>>
type Lifted<D2: DualNum<f64, Inner = D> + Copy> = EquationOfState<[I; N], <R as Residual<Const<N>, D>>::Lifted<D2>>
The residual model with the model parameters lifted to a higher dual number.
Source§fn components(&self) -> usize
fn components(&self) -> usize
Return the number of components in the system.
Source§fn 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.
Source§fn compute_max_density(&self, molefracs: &SVector<D, N>) -> D
fn compute_max_density(&self, molefracs: &SVector<D, N>) -> D
Return the maximum density in Angstrom^-3. Read more
Source§fn reduced_helmholtz_energy_density_contributions(
&self,
state: &StateHD<D, Const<N>>,
) -> Vec<(&'static str, D)>
fn reduced_helmholtz_energy_density_contributions( &self, state: &StateHD<D, Const<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.
Source§fn reduced_residual_helmholtz_energy_density(
&self,
state: &StateHD<D, Const<N>>,
) -> D
fn reduced_residual_helmholtz_energy_density( &self, state: &StateHD<D, Const<N>>, ) -> D
Evaluate the residual reduced Helmholtz energy density $\beta f^\mathrm{res}$.
Source§fn pure_molefracs() -> OVector<D, N>
fn pure_molefracs() -> OVector<D, N>
Return a generic composition vector for a pure component. Read more
Source§fn helmholtz_energy_contributions(
&self,
temperature: D,
volume: D,
moles: &OVector<D, N>,
) -> Vec<(&'static str, D)>
fn helmholtz_energy_contributions( &self, temperature: D, volume: D, moles: &OVector<D, N>, ) -> Vec<(&'static str, D)>
Evaluate the Helmholtz energy of each individual contribution and return them
together with a string representation of the contribution.
Source§fn 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}$.
Source§fn residual_molar_helmholtz_energy(
&self,
temperature: Temperature<D>,
molar_volume: MolarVolume<D>,
molefracs: &OVector<D, N>,
) -> MolarEnergy<D>
fn residual_molar_helmholtz_energy( &self, temperature: Temperature<D>, molar_volume: MolarVolume<D>, molefracs: &OVector<D, N>, ) -> MolarEnergy<D>
Evaluate the residual molar Helmholtz energy $a^\mathrm{res}$. Read more
Source§fn max_density<X: Composition<D, N>>(
&self,
composition: X,
) -> FeosResult<Density<D>>
fn max_density<X: Composition<D, N>>( &self, composition: X, ) -> FeosResult<Density<D>>
Calculate the maximum density. Read more
Source§fn second_virial_coefficient<X: Composition<D, N>>(
&self,
temperature: Temperature<D>,
composition: X,
) -> FeosResult<MolarVolume<D>>
fn second_virial_coefficient<X: Composition<D, N>>( &self, temperature: Temperature<D>, composition: X, ) -> FeosResult<MolarVolume<D>>
Calculate the second virial coefficient $B(T)$
Source§fn third_virial_coefficient<X: Composition<D, N>>(
&self,
temperature: Temperature<D>,
composition: X,
) -> FeosResult<<MolarVolume<D> as Div<Density<D>>>::Output>
fn third_virial_coefficient<X: Composition<D, N>>( &self, temperature: Temperature<D>, composition: X, ) -> FeosResult<<MolarVolume<D> as Div<Density<D>>>::Output>
Calculate the third virial coefficient $C(T)$
Source§fn second_virial_coefficient_temperature_derivative<X: Composition<D, N>>(
&self,
temperature: Temperature<D>,
composition: X,
) -> FeosResult<<MolarVolume<D> as Div<Temperature<D>>>::Output>
fn second_virial_coefficient_temperature_derivative<X: Composition<D, N>>( &self, temperature: Temperature<D>, composition: X, ) -> FeosResult<<MolarVolume<D> as Div<Temperature<D>>>::Output>
Calculate the temperature derivative of the second virial coefficient $B’(T)$
Source§fn third_virial_coefficient_temperature_derivative<X: Composition<D, N>>(
&self,
temperature: Temperature<D>,
composition: X,
) -> FeosResult<<<MolarVolume<D> as Div<Density<D>>>::Output as Div<Temperature<D>>>::Output>
fn third_virial_coefficient_temperature_derivative<X: Composition<D, N>>( &self, temperature: Temperature<D>, composition: X, ) -> FeosResult<<<MolarVolume<D> as Div<Density<D>>>::Output as Div<Temperature<D>>>::Output>
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)
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_dpdt(
&self,
temperature: D,
density: D,
molefracs: &OVector<D, N>,
) -> (D, D, D, D, D)
fn p_dpdrho_dpdt( &self, temperature: D, density: D, molefracs: &OVector<D, N>, ) -> (D, D, D, D, D)
calculates a_res, p, s_res, dp_drho, dp_dt
Source§fn 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
Source§fn 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
Source§impl<I, R: ResidualDyn> ResidualDyn for EquationOfState<Vec<I>, R>
impl<I, R: ResidualDyn> ResidualDyn for EquationOfState<Vec<I>, R>
Source§impl<I: IdealGasAD<D>, R: Residual<Const<N>, D>, D: DualNum<f64> + Copy, const N: usize> Total<Const<N>, D> for EquationOfState<[I; N], R>
impl<I: IdealGasAD<D>, R: Residual<Const<N>, D>, D: DualNum<f64> + Copy, const N: usize> Total<Const<N>, D> for EquationOfState<[I; N], R>
type RealTotal = EquationOfState<[<I as IdealGasAD<D>>::Real; N], <R as Residual<Const<N>, D>>::Real>
type LiftedTotal<D2: DualNum<f64, Inner = D> + Copy> = EquationOfState<[<I as IdealGasAD<D>>::Lifted<D2>; N], <R as Residual<Const<N>, D>>::Lifted<D2>>
fn re_total(&self) -> Self::RealTotal
fn lift_total<D2: DualNum<f64, Inner = D> + Copy>( &self, ) -> Self::LiftedTotal<D2>
fn ideal_gas_model(&self) -> &'static str
fn ln_lambda3(&self, temperature: D) -> SVector<D, N>
fn ideal_gas_molar_helmholtz_energy( &self, temperature: D, molar_volume: D, molefracs: &OVector<D, N>, ) -> D
fn ideal_gas_helmholtz_energy( &self, temperature: Temperature<D>, volume: MolarVolume<D>, moles: &OVector<D, N>, ) -> MolarEnergy<D>
Auto Trait Implementations§
impl<I, R> Freeze for EquationOfState<I, R>
impl<I, R> RefUnwindSafe for EquationOfState<I, R>where
I: RefUnwindSafe,
R: RefUnwindSafe,
impl<I, R> Send for EquationOfState<I, R>
impl<I, R> Sync for EquationOfState<I, R>
impl<I, R> Unpin for EquationOfState<I, R>
impl<I, R> UnsafeUnpin for EquationOfState<I, R>where
I: UnsafeUnpin,
R: UnsafeUnpin,
impl<I, R> UnwindSafe for EquationOfState<I, R>where
I: UnwindSafe,
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C, T, N, D> EntropyScaling<N, D> for Cwhere
C: Deref<Target = T>,
T: EntropyScaling<N, D>,
N: Dim,
D: DualNum<f64> + Copy,
DefaultAllocator: Allocator<N>,
impl<C, T, N, D> EntropyScaling<N, D> for Cwhere
C: Deref<Target = T>,
T: EntropyScaling<N, D>,
N: Dim,
D: DualNum<f64> + Copy,
DefaultAllocator: Allocator<N>,
fn viscosity_reference( &self, temperature: Quantity<D, SIUnit<0, 0, 0, 0, 1, 0, 0>>, molar_volume: Quantity<D, <<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Add>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<0, 0, 0, 0, 0, 1, 0>>>::Output>, molefracs: &Matrix<D, N, Const<1>, <DefaultAllocator as Allocator<N>>::Buffer<D>>, ) -> Quantity<D, <<<<SIUnit<0, 0, 1, 0, 0, 0, 0> as Add<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output>>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output as Sub<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Add>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output>>::Output as Add<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output>
fn viscosity_correlation( &self, s_res: D, x: &Matrix<D, N, Const<1>, <DefaultAllocator as Allocator<N>>::Buffer<D>>, ) -> D
fn diffusion_reference( &self, temperature: Quantity<D, SIUnit<0, 0, 0, 0, 1, 0, 0>>, molar_volume: Quantity<D, <<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Add>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<0, 0, 0, 0, 0, 1, 0>>>::Output>, molefracs: &Matrix<D, N, Const<1>, <DefaultAllocator as Allocator<N>>::Buffer<D>>, ) -> Quantity<D, <<SIUnit<0, 1, 0, 0, 0, 0, 0> as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output>
fn diffusion_correlation( &self, s_res: D, x: &Matrix<D, N, Const<1>, <DefaultAllocator as Allocator<N>>::Buffer<D>>, ) -> D
fn thermal_conductivity_reference( &self, temperature: Quantity<D, SIUnit<0, 0, 0, 0, 1, 0, 0>>, molar_volume: Quantity<D, <<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Add>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<0, 0, 0, 0, 0, 1, 0>>>::Output>, molefracs: &Matrix<D, N, Const<1>, <DefaultAllocator as Allocator<N>>::Buffer<D>>, ) -> Quantity<D, <<<<SIUnit<0, 0, 1, 0, 0, 0, 0> as Add<<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output>>::Output as Add<SIUnit<0, 1, 0, 0, 0, 0, 0>>>::Output as Sub<SIUnit<1, 0, 0, 0, 0, 0, 0>>>::Output as Sub<<SIUnit<0, 1, 0, 0, 0, 0, 0> as Add<SIUnit<0, 0, 0, 0, 1, 0, 0>>>::Output>>::Output>
fn thermal_conductivity_correlation( &self, s_res: D, x: &Matrix<D, N, Const<1>, <DefaultAllocator as Allocator<N>>::Buffer<D>>, ) -> D
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<C, T, N, D> Molarweight<N, D> for Cwhere
C: Deref<Target = T>,
T: Molarweight<N, D>,
N: Dim,
D: DualNum<f64> + Copy,
DefaultAllocator: Allocator<N>,
impl<C, T, N, D> Molarweight<N, D> for Cwhere
C: Deref<Target = T>,
T: Molarweight<N, D>,
N: Dim,
D: DualNum<f64> + Copy,
DefaultAllocator: Allocator<N>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<C, T, D> Residual<Dyn, D> for C
impl<C, T, D> Residual<Dyn, D> for C
Source§type Lifted<D2: DualNum<f64, Inner = D> + Copy> = C
type Lifted<D2: DualNum<f64, Inner = D> + Copy> = C
The residual model with the model parameters lifted to a higher dual number.
Source§fn components(&self) -> usize
fn components(&self) -> usize
Return the number of components in the system.
Source§fn compute_max_density(
&self,
molefracs: &Matrix<D, Dyn, Const<1>, VecStorage<D, Dyn, Const<1>>>,
) -> D
fn compute_max_density( &self, molefracs: &Matrix<D, Dyn, Const<1>, VecStorage<D, Dyn, Const<1>>>, ) -> D
Return the maximum density in Angstrom^-3. Read more
Source§fn reduced_helmholtz_energy_density_contributions(
&self,
state: &StateHD<D>,
) -> Vec<(&'static str, D)>
fn reduced_helmholtz_energy_density_contributions( &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.
Source§fn pure_molefracs() -> OVector<D, N>
fn pure_molefracs() -> OVector<D, N>
Return a generic composition vector for a pure component. Read more
Source§fn 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}$.
Source§fn helmholtz_energy_contributions(
&self,
temperature: D,
volume: D,
moles: &OVector<D, N>,
) -> Vec<(&'static str, D)>
fn helmholtz_energy_contributions( &self, temperature: D, volume: D, moles: &OVector<D, N>, ) -> Vec<(&'static str, D)>
Evaluate the Helmholtz energy of each individual contribution and return them
together with a string representation of the contribution.
Source§fn 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}$.
Source§fn residual_molar_helmholtz_energy(
&self,
temperature: Temperature<D>,
molar_volume: MolarVolume<D>,
molefracs: &OVector<D, N>,
) -> MolarEnergy<D>
fn residual_molar_helmholtz_energy( &self, temperature: Temperature<D>, molar_volume: MolarVolume<D>, molefracs: &OVector<D, N>, ) -> MolarEnergy<D>
Evaluate the residual molar Helmholtz energy $a^\mathrm{res}$. Read more
Source§fn max_density<X: Composition<D, N>>(
&self,
composition: X,
) -> FeosResult<Density<D>>
fn max_density<X: Composition<D, N>>( &self, composition: X, ) -> FeosResult<Density<D>>
Calculate the maximum density. Read more
Source§fn second_virial_coefficient<X: Composition<D, N>>(
&self,
temperature: Temperature<D>,
composition: X,
) -> FeosResult<MolarVolume<D>>
fn second_virial_coefficient<X: Composition<D, N>>( &self, temperature: Temperature<D>, composition: X, ) -> FeosResult<MolarVolume<D>>
Calculate the second virial coefficient $B(T)$
Source§fn third_virial_coefficient<X: Composition<D, N>>(
&self,
temperature: Temperature<D>,
composition: X,
) -> FeosResult<<MolarVolume<D> as Div<Density<D>>>::Output>
fn third_virial_coefficient<X: Composition<D, N>>( &self, temperature: Temperature<D>, composition: X, ) -> FeosResult<<MolarVolume<D> as Div<Density<D>>>::Output>
Calculate the third virial coefficient $C(T)$
Source§fn second_virial_coefficient_temperature_derivative<X: Composition<D, N>>(
&self,
temperature: Temperature<D>,
composition: X,
) -> FeosResult<<MolarVolume<D> as Div<Temperature<D>>>::Output>
fn second_virial_coefficient_temperature_derivative<X: Composition<D, N>>( &self, temperature: Temperature<D>, composition: X, ) -> FeosResult<<MolarVolume<D> as Div<Temperature<D>>>::Output>
Calculate the temperature derivative of the second virial coefficient $B’(T)$
Source§fn third_virial_coefficient_temperature_derivative<X: Composition<D, N>>(
&self,
temperature: Temperature<D>,
composition: X,
) -> FeosResult<<<MolarVolume<D> as Div<Density<D>>>::Output as Div<Temperature<D>>>::Output>
fn third_virial_coefficient_temperature_derivative<X: Composition<D, N>>( &self, temperature: Temperature<D>, composition: X, ) -> FeosResult<<<MolarVolume<D> as Div<Density<D>>>::Output as Div<Temperature<D>>>::Output>
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)
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_dpdt(
&self,
temperature: D,
density: D,
molefracs: &OVector<D, N>,
) -> (D, D, D, D, D)
fn p_dpdrho_dpdt( &self, temperature: D, density: D, molefracs: &OVector<D, N>, ) -> (D, D, D, D, D)
calculates a_res, p, s_res, dp_drho, dp_dt
Source§fn 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
Source§fn 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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.