Struct EquationOfStateAD

Source
pub struct EquationOfStateAD<I, R, const N: usize> { /* private fields */ }
Expand description

An equation of state consisting of a residual model and an ideal gas model.

Implementations§

Source§

impl<I, R, const N: usize> EquationOfStateAD<I, R, N>

Source

pub fn new(ideal_gas: [I; N], residual: R) -> Self

Trait Implementations§

Source§

impl<I: ParametersAD, R: ParametersAD, const N: usize> ParametersAD for EquationOfStateAD<I, R, N>

Source§

type Parameters<D: DualNum<f64> + Copy> = ([<I as ParametersAD>::Parameters<D>; N], <R as ParametersAD>::Parameters<D>)

The type of the structure that stores the parameters internally.
Source§

fn params<D: DualNum<f64> + Copy>(&self) -> Self::Parameters<D>

Return the parameters in the given data type.
Source§

fn params_from_inner<D: DualNum<f64> + Copy, D2: DualNum<f64, Inner = D> + Copy>( (ideal_gas, residual): &([I::Parameters<D>; N], R::Parameters<D>), ) -> Self::Parameters<D2>

Lift the parameters to the given type of dual number.
Source§

fn wrap<const N: usize>(self) -> HelmholtzEnergyWrapper<Self, f64, N>

Wraps the model in the HelmholtzEnergyWrapper struct, so that it can be used as an argument to StateAD and PhaseEquilibriumAD constructors.
Source§

impl<I: ParametersAD, R: ResidualHelmholtzEnergy<N>, const N: usize> ResidualHelmholtzEnergy<N> for EquationOfStateAD<I, R, N>

Source§

const RESIDUAL: &str = R::RESIDUAL

The name of the model.
Source§

fn compute_max_density(&self, molefracs: &SVector<f64, N>) -> f64

Return a density (in reduced units) that corresponds to a dense liquid phase.
Source§

fn residual_helmholtz_energy_density<D: DualNum<f64> + Copy>( (_, residual): &([I::Parameters<D>; N], R::Parameters<D>), temperature: D, partial_density: &SVector<D, N>, ) -> D

Source§

fn residual_molar_helmholtz_energy<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> D

Source§

fn residual_chemical_potential<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> SVector<D, N>

Source§

fn pressure<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> D

Source§

fn residual_molar_entropy<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> D

Source§

fn residual_molar_enthalpy<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> D

Source§

fn dp_drho<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> (D, D, D)

Source§

fn dmu_drho<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, partial_density: &SVector<D, N>, ) -> (D, SVector<D, N>, SVector<D, N>, SMatrix<D, N, N>)

calculates p, mu_res, dp_drho, dmu_drho
Source§

fn dmu_dv<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> (D, SVector<D, N>, D, SVector<D, N>)

calculates p, mu_res, dp_dv, dmu_dv
Source§

impl<I: IdealGasAD, R: ResidualHelmholtzEnergy<N>, const N: usize> TotalHelmholtzEnergy<N> for EquationOfStateAD<I, R, N>

Source§

const IDEAL_GAS: &str = I::IDEAL_GAS

Source§

fn ln_lambda3<D: DualNum<f64> + Copy>( (ideal_gas, _): &([I::Parameters<D>; N], R::Parameters<D>), temperature: D, ) -> SVector<D, N>

Source§

fn helmholtz_energy_density<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, partial_density: &SVector<D, N>, ) -> D

Source§

fn molar_helmholtz_energy<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> D

Source§

fn chemical_potential<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> SVector<D, N>

Source§

fn molar_entropy<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> D

Source§

fn molar_enthalpy<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> D

Source§

fn molar_isochoric_heat_capacity<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> D

Source§

fn molar_isobaric_heat_capacity<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> D

Source§

fn pressure_entropy<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> SVector<D, 2>

Source§

fn pressure_enthalpy<D: DualNum<f64> + Copy>( parameters: &Self::Parameters<D>, temperature: D, molar_volume: D, molefracs: &SVector<D, N>, ) -> SVector<D, 2>

Auto Trait Implementations§

§

impl<I, R, const N: usize> Freeze for EquationOfStateAD<I, R, N>
where R: Freeze, I: Freeze,

§

impl<I, R, const N: usize> RefUnwindSafe for EquationOfStateAD<I, R, N>

§

impl<I, R, const N: usize> Send for EquationOfStateAD<I, R, N>
where R: Send, I: Send,

§

impl<I, R, const N: usize> Sync for EquationOfStateAD<I, R, N>
where R: Sync, I: Sync,

§

impl<I, R, const N: usize> Unpin for EquationOfStateAD<I, R, N>
where R: Unpin, I: Unpin,

§

impl<I, R, const N: usize> UnwindSafe for EquationOfStateAD<I, R, N>
where R: UnwindSafe, I: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
Source§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

Source§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
Source§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, Dst> ConvAsUtil<Dst> for T

Source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
Source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
Source§

impl<T> ConvUtil for T

Source§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
Source§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
Source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
Source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
Source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<Src> TryFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

Source§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<Src> ValueFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
Source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

Source§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.