pub struct PhaseDiagram<E, const N: usize> {
pub states: Vec<PhaseEquilibrium<E, N>>,
}
Expand description
Pure component and binary mixture phase diagrams.
Fields§
§states: Vec<PhaseEquilibrium<E, N>>
Implementations§
Source§impl<E: Residual> PhaseDiagram<E, 2>
impl<E: Residual> PhaseDiagram<E, 2>
Sourcepub fn binary_vle<TP: TemperatureOrPressure>(
eos: &Arc<E>,
temperature_or_pressure: TP,
npoints: Option<usize>,
x_lle: Option<(f64, f64)>,
bubble_dew_options: (SolverOptions, SolverOptions),
) -> EosResult<Self>
pub fn binary_vle<TP: TemperatureOrPressure>( eos: &Arc<E>, temperature_or_pressure: TP, npoints: Option<usize>, x_lle: Option<(f64, f64)>, bubble_dew_options: (SolverOptions, SolverOptions), ) -> EosResult<Self>
Create a new binary phase diagram exhibiting a vapor/liquid equilibrium.
If a heteroazeotrope occurs and the composition of the liquid
phases are known, they can be passed as x_lle
to avoid
the calculation of unstable branches.
Sourcepub fn lle<TP: TemperatureOrPressure>(
eos: &Arc<E>,
temperature_or_pressure: TP,
feed: &Moles<Array1<f64>>,
min_tp: TP::Other,
max_tp: TP::Other,
npoints: Option<usize>,
) -> EosResult<Self>
pub fn lle<TP: TemperatureOrPressure>( eos: &Arc<E>, temperature_or_pressure: TP, feed: &Moles<Array1<f64>>, min_tp: TP::Other, max_tp: TP::Other, npoints: Option<usize>, ) -> EosResult<Self>
Create a new phase diagram using Tp flash calculations.
The usual use case for this function is the calculation of liquid-liquid phase diagrams, but it can be used for vapor- liquid diagrams as well, as long as the feed composition is in a two phase region.
Source§impl<E: Residual> PhaseDiagram<E, 2>
impl<E: Residual> PhaseDiagram<E, 2>
Sourcepub fn binary_vlle<TP: TemperatureOrPressure>(
eos: &Arc<E>,
temperature_or_pressure: TP,
x_lle: (f64, f64),
tp_lim_lle: Option<TP::Other>,
tp_init_vlle: Option<TP::Other>,
npoints_vle: Option<usize>,
npoints_lle: Option<usize>,
bubble_dew_options: (SolverOptions, SolverOptions),
) -> EosResult<PhaseDiagramHetero<E>>
pub fn binary_vlle<TP: TemperatureOrPressure>( eos: &Arc<E>, temperature_or_pressure: TP, x_lle: (f64, f64), tp_lim_lle: Option<TP::Other>, tp_init_vlle: Option<TP::Other>, npoints_vle: Option<usize>, npoints_lle: Option<usize>, bubble_dew_options: (SolverOptions, SolverOptions), ) -> EosResult<PhaseDiagramHetero<E>>
Create a new binary phase diagram exhibiting a vapor/liquid/liquid equilibrium.
The x_lle
parameter is used as initial values for the calculation
of the heteroazeotrope.
Source§impl<E, const N: usize> PhaseDiagram<E, N>
impl<E, const N: usize> PhaseDiagram<E, N>
Sourcepub fn new(states: Vec<PhaseEquilibrium<E, N>>) -> Self
pub fn new(states: Vec<PhaseEquilibrium<E, N>>) -> Self
Create a phase diagram from a list of phase equilibria.
Source§impl<E: Residual> PhaseDiagram<E, 2>
impl<E: Residual> PhaseDiagram<E, 2>
Sourcepub fn pure(
eos: &Arc<E>,
min_temperature: Temperature,
npoints: usize,
critical_temperature: Option<Temperature>,
options: SolverOptions,
) -> EosResult<Self>
pub fn pure( eos: &Arc<E>, min_temperature: Temperature, npoints: usize, critical_temperature: Option<Temperature>, options: SolverOptions, ) -> EosResult<Self>
Calculate a phase diagram for a pure component.
Source§impl<E: Residual> PhaseDiagram<E, 2>
impl<E: Residual> PhaseDiagram<E, 2>
pub fn par_pure( eos: &Arc<E>, min_temperature: Temperature, npoints: usize, chunksize: usize, thread_pool: ThreadPool, critical_temperature: Option<Temperature>, options: SolverOptions, ) -> EosResult<Self>
Source§impl<E: Residual> PhaseDiagram<E, 2>
impl<E: Residual> PhaseDiagram<E, 2>
Sourcepub fn bubble_point_line(
eos: &Arc<E>,
moles: &Moles<Array1<f64>>,
min_temperature: Temperature,
npoints: usize,
critical_temperature: Option<Temperature>,
options: (SolverOptions, SolverOptions),
) -> EosResult<Self>
pub fn bubble_point_line( eos: &Arc<E>, moles: &Moles<Array1<f64>>, min_temperature: Temperature, npoints: usize, critical_temperature: Option<Temperature>, options: (SolverOptions, SolverOptions), ) -> EosResult<Self>
Calculate the bubble point line of a mixture with given composition.
Sourcepub fn dew_point_line(
eos: &Arc<E>,
moles: &Moles<Array1<f64>>,
min_temperature: Temperature,
npoints: usize,
critical_temperature: Option<Temperature>,
options: (SolverOptions, SolverOptions),
) -> EosResult<Self>
pub fn dew_point_line( eos: &Arc<E>, moles: &Moles<Array1<f64>>, min_temperature: Temperature, npoints: usize, critical_temperature: Option<Temperature>, options: (SolverOptions, SolverOptions), ) -> EosResult<Self>
Calculate the dew point line of a mixture with given composition.
Sourcepub fn spinodal(
eos: &Arc<E>,
moles: &Moles<Array1<f64>>,
min_temperature: Temperature,
npoints: usize,
critical_temperature: Option<Temperature>,
options: SolverOptions,
) -> EosResult<Self>
pub fn spinodal( eos: &Arc<E>, moles: &Moles<Array1<f64>>, min_temperature: Temperature, npoints: usize, critical_temperature: Option<Temperature>, options: SolverOptions, ) -> EosResult<Self>
Calculate the spinodal lines for a mixture with fixed composition.
Trait Implementations§
Auto Trait Implementations§
impl<E, const N: usize> Freeze for PhaseDiagram<E, N>
impl<E, const N: usize> RefUnwindSafe for PhaseDiagram<E, N>where
E: RefUnwindSafe,
impl<E, const N: usize> Send for PhaseDiagram<E, N>
impl<E, const N: usize> Sync for PhaseDiagram<E, N>
impl<E, const N: usize> Unpin for PhaseDiagram<E, N>
impl<E, const N: usize> UnwindSafe for PhaseDiagram<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.