pub struct GenericParameters<P, B, A, Bo, C, Data> {
pub pure: Vec<PureParameters<P, C>>,
pub binary: Vec<BinaryParameters<B, ()>>,
pub bonds: Vec<BinaryParameters<Bo, C>>,
pub association: AssociationParameters<A>,
pub molar_weight: MolarWeight<DVector<f64>>,
/* private fields */
}Fields§
§pure: Vec<PureParameters<P, C>>§binary: Vec<BinaryParameters<B, ()>>§bonds: Vec<BinaryParameters<Bo, C>>§association: AssociationParameters<A>§molar_weight: MolarWeight<DVector<f64>>Implementations§
Source§impl GenericParameters<PengRobinsonRecord, f64, (), (), (), (Vec<Record<Identifier, PengRobinsonRecord, ()>>, Vec<BinaryRecord<usize, f64, ()>>)>
impl GenericParameters<PengRobinsonRecord, f64, (), (), (), (Vec<Record<Identifier, PengRobinsonRecord, ()>>, Vec<BinaryRecord<usize, f64, ()>>)>
Sourcepub fn new_simple(
tc: &[f64],
pc: &[f64],
acentric_factor: &[f64],
molarweight: &[f64],
) -> FeosResult<Self>
pub fn new_simple( tc: &[f64], pc: &[f64], acentric_factor: &[f64], molarweight: &[f64], ) -> FeosResult<Self>
Build a simple parameter set without binary interaction parameters.
Source§impl<P, B, A, Bo, C, Data> GenericParameters<P, B, A, Bo, C, Data>
impl<P, B, A, Bo, C, Data> GenericParameters<P, B, A, Bo, C, Data>
pub fn collate<F, T: Scalar + Copy, const N: usize>( &self, f: F, ) -> [DVector<T>; N]
pub fn collate_binary<F, T: Scalar + Default + Copy, const N: usize>( &self, f: F, ) -> [DMatrix<T>; N]
pub fn collate_ab<F, T: Scalar + Copy, const N: usize>( &self, f: F, ) -> [DMatrix<Option<T>>; N]
pub fn collate_cc<F, T: Scalar + Copy, const N: usize>( &self, f: F, ) -> [DMatrix<Option<T>>; N]
Source§impl<P: Clone, B: Clone, A: CombiningRule<P> + Clone> GenericParameters<P, B, A, (), (), (Vec<Record<Identifier, P, A>>, Vec<BinaryRecord<usize, B, A>>)>
impl<P: Clone, B: Clone, A: CombiningRule<P> + Clone> GenericParameters<P, B, A, (), (), (Vec<Record<Identifier, P, A>>, Vec<BinaryRecord<usize, B, A>>)>
pub fn new( pure_records: Vec<PureRecord<P, A>>, binary_records: Vec<BinaryRecord<usize, B, A>>, ) -> FeosResult<Self>
Sourcepub fn new_pure(pure_record: PureRecord<P, A>) -> FeosResult<Self>
pub fn new_pure(pure_record: PureRecord<P, A>) -> FeosResult<Self>
Creates parameters for a pure component from a pure record.
Sourcepub fn new_binary(
pure_records: [PureRecord<P, A>; 2],
binary_record: Option<B>,
binary_association_records: Vec<BinaryAssociationRecord<A>>,
) -> FeosResult<Self>
pub fn new_binary( pure_records: [PureRecord<P, A>; 2], binary_record: Option<B>, binary_association_records: Vec<BinaryAssociationRecord<A>>, ) -> FeosResult<Self>
Creates parameters for a binary system from pure records and an optional binary interaction parameter.
Sourcepub fn from_records(
pure_records: Vec<PureRecord<P, A>>,
binary_records: Vec<BinaryRecord<Identifier, B, A>>,
identifier_option: IdentifierOption,
) -> FeosResult<Self>
pub fn from_records( pure_records: Vec<PureRecord<P, A>>, binary_records: Vec<BinaryRecord<Identifier, B, A>>, identifier_option: IdentifierOption, ) -> FeosResult<Self>
Creates parameters from records for pure substances and possibly binary parameters.
Sourcepub fn from_model_records(model_records: Vec<P>) -> FeosResult<Self>
pub fn from_model_records(model_records: Vec<P>) -> FeosResult<Self>
Creates parameters from model records with default values for the molar weight, identifiers, association sites, and binary interaction parameters.
Source§impl<P: Clone, B: Clone, A: Clone> GenericParameters<P, B, A, (), (), (Vec<Record<Identifier, P, A>>, Vec<BinaryRecord<usize, B, A>>)>
impl<P: Clone, B: Clone, A: Clone> GenericParameters<P, B, A, (), (), (Vec<Record<Identifier, P, A>>, Vec<BinaryRecord<usize, B, A>>)>
Sourcepub fn binary_matrix_from_records(
pure_records: &[PureRecord<P, A>],
binary_records: &[BinaryRecord<Identifier, B, A>],
identifier_option: IdentifierOption,
) -> FeosResult<Vec<BinaryRecord<usize, B, A>>>
pub fn binary_matrix_from_records( pure_records: &[PureRecord<P, A>], binary_records: &[BinaryRecord<Identifier, B, A>], identifier_option: IdentifierOption, ) -> FeosResult<Vec<BinaryRecord<usize, B, A>>>
Helper function to build matrix from list of records in correct order.
Source§impl<P: Clone, B: Clone, A: CombiningRule<P> + Clone> GenericParameters<P, B, A, (), (), (Vec<Record<Identifier, P, A>>, Vec<BinaryRecord<usize, B, A>>)>
impl<P: Clone, B: Clone, A: CombiningRule<P> + Clone> GenericParameters<P, B, A, (), (), (Vec<Record<Identifier, P, A>>, Vec<BinaryRecord<usize, B, A>>)>
Sourcepub fn from_json<F, S>(
substances: Vec<S>,
file_pure: F,
file_binary: Option<F>,
identifier_option: IdentifierOption,
) -> FeosResult<Self>where
F: AsRef<Path>,
S: Deref<Target = str>,
P: DeserializeOwned,
B: DeserializeOwned,
A: DeserializeOwned,
pub fn from_json<F, S>(
substances: Vec<S>,
file_pure: F,
file_binary: Option<F>,
identifier_option: IdentifierOption,
) -> FeosResult<Self>where
F: AsRef<Path>,
S: Deref<Target = str>,
P: DeserializeOwned,
B: DeserializeOwned,
A: DeserializeOwned,
Creates parameters from substance information stored in json files.
Sourcepub fn from_multiple_json<F, S>(
input: &[(Vec<S>, F)],
file_binary: Option<F>,
identifier_option: IdentifierOption,
) -> FeosResult<Self>where
F: AsRef<Path>,
S: Deref<Target = str>,
P: DeserializeOwned,
B: DeserializeOwned,
A: DeserializeOwned,
pub fn from_multiple_json<F, S>(
input: &[(Vec<S>, F)],
file_binary: Option<F>,
identifier_option: IdentifierOption,
) -> FeosResult<Self>where
F: AsRef<Path>,
S: Deref<Target = str>,
P: DeserializeOwned,
B: DeserializeOwned,
A: DeserializeOwned,
Creates parameters from substance information stored in multiple json files.
Sourcepub fn from_segments(
chemical_records: Vec<ChemicalRecord>,
segment_records: &[SegmentRecord<P, A>],
binary_segment_records: Option<&[BinarySegmentRecord<B, A>]>,
) -> FeosResult<Self>
pub fn from_segments( chemical_records: Vec<ChemicalRecord>, segment_records: &[SegmentRecord<P, A>], binary_segment_records: Option<&[BinarySegmentRecord<B, A>]>, ) -> FeosResult<Self>
Creates parameters from the molecular structure and segment information.
The FromSegments trait needs to be implemented for the model record and the binary interaction parameters.
Sourcepub fn from_json_segments<F>(
substances: &[&str],
file_pure: F,
file_segments: F,
file_binary: Option<F>,
identifier_option: IdentifierOption,
) -> FeosResult<Self>where
F: AsRef<Path>,
P: FromSegments + DeserializeOwned,
B: FromSegmentsBinary + DeserializeOwned + Default,
A: DeserializeOwned,
pub fn from_json_segments<F>(
substances: &[&str],
file_pure: F,
file_segments: F,
file_binary: Option<F>,
identifier_option: IdentifierOption,
) -> FeosResult<Self>where
F: AsRef<Path>,
P: FromSegments + DeserializeOwned,
B: FromSegmentsBinary + DeserializeOwned + Default,
A: DeserializeOwned,
Creates parameters from segment information stored in json files.
The FromSegments trait needs to be implemented for both the model record and the ideal gas record.
pub fn identifiers(&self) -> Vec<&Identifier>
Sourcepub fn subset(&self, component_list: &[usize]) -> Self
pub fn subset(&self, component_list: &[usize]) -> Self
Return a parameter set containing the subset of components specified in component_list.
§Panics
Panics if index in component_list is out of bounds
Sourcepub fn pure_parameters(&self) -> IndexMap<String, DVector<f64>>where
P: Serialize,
pub fn pure_parameters(&self) -> IndexMap<String, DVector<f64>>where
P: Serialize,
Return scalar pure parameters as map.
This function is not particularly efficient and mostly relevant in situations in which the type information is thrown away on purpose (i.e., FFI)
Sourcepub fn binary_parameters(&self) -> IndexMap<String, DMatrix<f64>>where
B: Serialize,
pub fn binary_parameters(&self) -> IndexMap<String, DMatrix<f64>>where
B: Serialize,
Return scalar binary interaction parameters as map.
This function is not particularly efficient and mostly relevant in situations in which the type information is thrown away on purpose (i.e., FFI)
Source§impl<P, B, A, Bo> GenericParameters<P, B, A, Bo, f64, (Vec<ChemicalRecord>, Vec<Record<String, P, A>>, Option<Vec<BinaryRecord<String, B, A>>>, Vec<BinaryRecord<String, Bo, ()>>)>
impl<P, B, A, Bo> GenericParameters<P, B, A, Bo, f64, (Vec<ChemicalRecord>, Vec<Record<String, P, A>>, Option<Vec<BinaryRecord<String, B, A>>>, Vec<BinaryRecord<String, Bo, ()>>)>
pub fn segment_counts(&self) -> DVector<f64>
Source§impl<P: Clone, B: Clone, A: CombiningRule<P> + Clone, Bo: Clone, C: GroupCount + Default> GenericParameters<P, B, A, Bo, C, (Vec<ChemicalRecord>, Vec<Record<String, P, A>>, Option<Vec<BinaryRecord<String, B, A>>>, Vec<BinaryRecord<String, Bo, ()>>)>
impl<P: Clone, B: Clone, A: CombiningRule<P> + Clone, Bo: Clone, C: GroupCount + Default> GenericParameters<P, B, A, Bo, C, (Vec<ChemicalRecord>, Vec<Record<String, P, A>>, Option<Vec<BinaryRecord<String, B, A>>>, Vec<BinaryRecord<String, Bo, ()>>)>
pub fn from_segments_hetero(
chemical_records: Vec<ChemicalRecord>,
segment_records: &[SegmentRecord<P, A>],
binary_segment_records: Option<&[BinarySegmentRecord<B, A>]>,
) -> FeosResult<Self>where
Bo: Default,
pub fn from_segments_with_bonds( chemical_records: Vec<ChemicalRecord>, segment_records: &[SegmentRecord<P, A>], binary_segment_records: Option<&[BinarySegmentRecord<B, A>]>, bond_records: &[BinarySegmentRecord<Bo, ()>], ) -> FeosResult<Self>
Sourcepub fn from_json_segments_hetero<F>(
substances: &[&str],
file_pure: F,
file_segments: F,
file_binary: Option<F>,
identifier_option: IdentifierOption,
) -> FeosResult<Self>where
F: AsRef<Path>,
P: DeserializeOwned,
B: DeserializeOwned + Default,
A: DeserializeOwned,
Bo: Default,
pub fn from_json_segments_hetero<F>(
substances: &[&str],
file_pure: F,
file_segments: F,
file_binary: Option<F>,
identifier_option: IdentifierOption,
) -> FeosResult<Self>where
F: AsRef<Path>,
P: DeserializeOwned,
B: DeserializeOwned + Default,
A: DeserializeOwned,
Bo: Default,
Creates parameters from segment information stored in json files.
The FromSegments trait needs to be implemented for both the model record and the ideal gas record.
Sourcepub fn from_json_segments_with_bonds<F>(
substances: &[&str],
file_pure: F,
file_segments: F,
file_binary: Option<F>,
file_bonds: F,
identifier_option: IdentifierOption,
) -> FeosResult<Self>where
F: AsRef<Path>,
P: DeserializeOwned,
B: DeserializeOwned + Default,
A: DeserializeOwned,
Bo: DeserializeOwned,
pub fn from_json_segments_with_bonds<F>(
substances: &[&str],
file_pure: F,
file_segments: F,
file_binary: Option<F>,
file_bonds: F,
identifier_option: IdentifierOption,
) -> FeosResult<Self>where
F: AsRef<Path>,
P: DeserializeOwned,
B: DeserializeOwned + Default,
A: DeserializeOwned,
Bo: DeserializeOwned,
Creates parameters from segment information stored in json files.
The FromSegments trait needs to be implemented for both the model record and the ideal gas record.
pub fn component_index(&self) -> Vec<usize>
pub fn identifiers(&self) -> Vec<&Identifier>
Auto Trait Implementations§
impl<P, B, A, Bo, C, Data> Freeze for GenericParameters<P, B, A, Bo, C, Data>where
Data: Freeze,
impl<P, B, A, Bo, C, Data> RefUnwindSafe for GenericParameters<P, B, A, Bo, C, Data>where
Data: RefUnwindSafe,
P: RefUnwindSafe,
C: RefUnwindSafe,
B: RefUnwindSafe,
Bo: RefUnwindSafe,
A: RefUnwindSafe,
impl<P, B, A, Bo, C, Data> Send for GenericParameters<P, B, A, Bo, C, Data>
impl<P, B, A, Bo, C, Data> Sync for GenericParameters<P, B, A, Bo, C, Data>
impl<P, B, A, Bo, C, Data> Unpin for GenericParameters<P, B, A, Bo, C, Data>
impl<P, B, A, Bo, C, Data> UnwindSafe for GenericParameters<P, B, A, Bo, C, Data>
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
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<T> PropertiesAD for T
impl<T> PropertiesAD for T
fn vapor_pressure<const P: usize>( &self, temperature: Temperature, ) -> FeosResult<Pressure<DualSVec<f64, f64, P>>>
fn equilibrium_liquid_density<const P: usize>( &self, temperature: Temperature, ) -> FeosResult<(Pressure<DualSVec<f64, f64, P>>, Density<DualSVec<f64, f64, P>>)>
fn liquid_density<const P: usize>( &self, temperature: Temperature, pressure: Pressure, ) -> FeosResult<Density<DualSVec<f64, f64, P>>>
fn vapor_pressure_parallel<const P: usize>(
parameter_names: [String; P],
parameters: ArrayView2<'_, f64>,
input: ArrayView2<'_, f64>,
) -> (Array1<f64>, Array2<f64>, Array1<bool>)where
Self: ParametersAD<1>,
fn liquid_density_parallel<const P: usize>(
parameter_names: [String; P],
parameters: ArrayView2<'_, f64>,
input: ArrayView2<'_, f64>,
) -> (Array1<f64>, Array2<f64>, Array1<bool>)where
Self: ParametersAD<1>,
fn equilibrium_liquid_density_parallel<const P: usize>(
parameter_names: [String; P],
parameters: ArrayView2<'_, f64>,
input: ArrayView2<'_, f64>,
) -> (Array1<f64>, Array2<f64>, Array1<bool>)where
Self: ParametersAD<1>,
fn bubble_point_pressure<const P: usize>( &self, temperature: Temperature, pressure: Option<Pressure>, liquid_molefracs: SVector<f64, 2>, ) -> FeosResult<Pressure<DualSVec<f64, f64, P>>>
fn dew_point_pressure<const P: usize>( &self, temperature: Temperature, pressure: Option<Pressure>, vapor_molefracs: SVector<f64, 2>, ) -> FeosResult<Pressure<DualSVec<f64, f64, P>>>
fn bubble_point_pressure_parallel<const P: usize>(
parameter_names: [String; P],
parameters: ArrayView2<'_, f64>,
input: ArrayView2<'_, f64>,
) -> (Array1<f64>, Array2<f64>, Array1<bool>)where
Self: ParametersAD<2>,
fn dew_point_pressure_parallel<const P: usize>(
parameter_names: [String; P],
parameters: ArrayView2<'_, f64>,
input: ArrayView2<'_, f64>,
) -> (Array1<f64>, Array2<f64>, Array1<bool>)where
Self: ParametersAD<2>,
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.