pub struct PhaseEquilibrium<E, const N: usize>(/* private fields */);
Expand description
A thermodynamic equilibrium state.
The struct is parametrized over the number of phases with most features being implemented for the two phase vapor/liquid or liquid/liquid case.
§Contents
Implementations§
Source§impl<E: Residual> PhaseEquilibrium<E, 2>
§Bubble and dew point calculations
impl<E: Residual> PhaseEquilibrium<E, 2>
§Bubble and dew point calculations
Sourcepub fn bubble_point<TP: TemperatureOrPressure>(
eos: &Arc<E>,
temperature_or_pressure: TP,
liquid_molefracs: &Array1<f64>,
tp_init: Option<TP::Other>,
vapor_molefracs: Option<&Array1<f64>>,
options: (SolverOptions, SolverOptions),
) -> EosResult<Self>
pub fn bubble_point<TP: TemperatureOrPressure>( eos: &Arc<E>, temperature_or_pressure: TP, liquid_molefracs: &Array1<f64>, tp_init: Option<TP::Other>, vapor_molefracs: Option<&Array1<f64>>, options: (SolverOptions, SolverOptions), ) -> EosResult<Self>
Calculate a phase equilibrium for a given temperature or pressure and composition of the liquid phase.
Sourcepub fn dew_point<TP: TemperatureOrPressure>(
eos: &Arc<E>,
temperature_or_pressure: TP,
vapor_molefracs: &Array1<f64>,
tp_init: Option<TP::Other>,
liquid_molefracs: Option<&Array1<f64>>,
options: (SolverOptions, SolverOptions),
) -> EosResult<Self>
pub fn dew_point<TP: TemperatureOrPressure>( eos: &Arc<E>, temperature_or_pressure: TP, vapor_molefracs: &Array1<f64>, tp_init: Option<TP::Other>, liquid_molefracs: Option<&Array1<f64>>, options: (SolverOptions, SolverOptions), ) -> EosResult<Self>
Calculate a phase equilibrium for a given temperature or pressure and composition of the vapor phase.
Source§impl<E: Residual> PhaseEquilibrium<E, 3>
§Heteroazeotropes
impl<E: Residual> PhaseEquilibrium<E, 3>
§Heteroazeotropes
Sourcepub fn heteroazeotrope<TP: TemperatureOrPressure>(
eos: &Arc<E>,
temperature_or_pressure: TP,
x_init: (f64, f64),
tp_init: Option<TP::Other>,
options: SolverOptions,
bubble_dew_options: (SolverOptions, SolverOptions),
) -> EosResult<Self>
pub fn heteroazeotrope<TP: TemperatureOrPressure>( eos: &Arc<E>, temperature_or_pressure: TP, x_init: (f64, f64), tp_init: Option<TP::Other>, options: SolverOptions, bubble_dew_options: (SolverOptions, SolverOptions), ) -> EosResult<Self>
Calculate a heteroazeotrope (three phase equilbrium) for a binary system and given temperature or pressure.
Source§impl<E: Residual> PhaseEquilibrium<E, 2>
§Flash calculations
impl<E: Residual> PhaseEquilibrium<E, 2>
§Flash calculations
Sourcepub fn tp_flash(
eos: &Arc<E>,
temperature: Temperature,
pressure: Pressure,
feed: &Moles<Array1<f64>>,
initial_state: Option<&PhaseEquilibrium<E, 2>>,
options: SolverOptions,
non_volatile_components: Option<Vec<usize>>,
) -> EosResult<Self>
pub fn tp_flash( eos: &Arc<E>, temperature: Temperature, pressure: Pressure, feed: &Moles<Array1<f64>>, initial_state: Option<&PhaseEquilibrium<E, 2>>, options: SolverOptions, non_volatile_components: Option<Vec<usize>>, ) -> EosResult<Self>
Perform a Tp-flash calculation. If no initial values are given, the solution is initialized using a stability analysis.
The algorithm can be use to calculate phase equilibria of systems containing non-volatile components (e.g. ions).
Source§impl<E: Residual> PhaseEquilibrium<E, 2>
§Pure component phase equilibria
impl<E: Residual> PhaseEquilibrium<E, 2>
§Pure component phase equilibria
Sourcepub fn pure<TP: TemperatureOrPressure>(
eos: &Arc<E>,
temperature_or_pressure: TP,
initial_state: Option<&PhaseEquilibrium<E, 2>>,
options: SolverOptions,
) -> EosResult<Self>
pub fn pure<TP: TemperatureOrPressure>( eos: &Arc<E>, temperature_or_pressure: TP, initial_state: Option<&PhaseEquilibrium<E, 2>>, options: SolverOptions, ) -> EosResult<Self>
Calculate a phase equilibrium for a pure component.
Source§impl<E: Residual> PhaseEquilibrium<E, 2>
impl<E: Residual> PhaseEquilibrium<E, 2>
Sourcepub fn vapor_pressure(
eos: &Arc<E>,
temperature: Temperature,
) -> Vec<Option<Pressure>>
pub fn vapor_pressure( eos: &Arc<E>, temperature: Temperature, ) -> Vec<Option<Pressure>>
Calculate the pure component vapor pressures of all components in the system for the given temperature.
Sourcepub fn boiling_temperature(
eos: &Arc<E>,
pressure: Pressure,
) -> Vec<Option<Temperature>>
pub fn boiling_temperature( eos: &Arc<E>, pressure: Pressure, ) -> Vec<Option<Temperature>>
Calculate the pure component boiling temperatures of all components in the system for the given pressure.
Sourcepub fn vle_pure_comps<TP: TemperatureOrPressure>(
eos: &Arc<E>,
temperature_or_pressure: TP,
) -> Vec<Option<PhaseEquilibrium<E, 2>>>
pub fn vle_pure_comps<TP: TemperatureOrPressure>( eos: &Arc<E>, temperature_or_pressure: TP, ) -> Vec<Option<PhaseEquilibrium<E, 2>>>
Calculate the pure component phase equilibria of all components in the system.
Source§impl<E: Residual, const N: usize> PhaseEquilibrium<E, N>
impl<E: Residual, const N: usize> PhaseEquilibrium<E, N>
pub fn _repr_markdown_(&self) -> String
Source§impl<E> PhaseEquilibrium<E, 2>
impl<E> PhaseEquilibrium<E, 2>
Source§impl<E> PhaseEquilibrium<E, 3>
impl<E> PhaseEquilibrium<E, 3>
Source§impl<E: Residual> PhaseEquilibrium<E, 2>
impl<E: Residual> PhaseEquilibrium<E, 2>
Sourcepub fn new_npt(
eos: &Arc<E>,
temperature: Temperature,
pressure: Pressure,
vapor_moles: &Moles<Array1<f64>>,
liquid_moles: &Moles<Array1<f64>>,
) -> EosResult<Self>
pub fn new_npt( eos: &Arc<E>, temperature: Temperature, pressure: Pressure, vapor_moles: &Moles<Array1<f64>>, liquid_moles: &Moles<Array1<f64>>, ) -> EosResult<Self>
Creates a new PhaseEquilibrium that contains two states at the specified temperature, pressure and moles.
The constructor can be used in custom phase equilibrium solvers or, e.g., to generate initial guesses for an actual VLE solver. In general, the two states generated are NOT in an equilibrium.
Source§impl<E: Residual> PhaseEquilibrium<E, 2>
§Utility functions
impl<E: Residual> PhaseEquilibrium<E, 2>
§Utility functions
Sourcepub fn is_trivial_solution(state1: &State<E>, state2: &State<E>) -> bool
pub fn is_trivial_solution(state1: &State<E>, state2: &State<E>) -> bool
Check if the two states form a trivial solution
Trait Implementations§
Source§impl<E, const N: usize> Clone for PhaseEquilibrium<E, N>
impl<E, const N: usize> Clone for PhaseEquilibrium<E, N>
Auto Trait Implementations§
impl<E, const N: usize> !Freeze for PhaseEquilibrium<E, N>
impl<E, const N: usize> RefUnwindSafe for PhaseEquilibrium<E, N>where
E: RefUnwindSafe,
impl<E, const N: usize> Send for PhaseEquilibrium<E, N>
impl<E, const N: usize> Sync for PhaseEquilibrium<E, N>
impl<E, const N: usize> Unpin for PhaseEquilibrium<E, N>
impl<E, const N: usize> UnwindSafe for PhaseEquilibrium<E, N>where
E: RefUnwindSafe,
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
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>
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>
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<T> Pointable for T
impl<T> Pointable for T
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>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.