pub struct FunctionalGroup {
pub id: u8,
pub subgroup: String,
pub main_id: u8,
pub nu: f64,
pub r: f64,
pub q: f64,
}
Expand description
Functional group as building block of a substance
Functional groups build substances and hold empirical data. Substance-related data is derived from aggregating functional groups as described be UNIFAC model.
Fields§
§id: u8
ID of the functional group (see FuncitonalGroup::from)
subgroup: String
The string representation of the group
main_id: u8
The ID of the main group (e.g. CH3, CH2, CH have the same group)
nu: f64
Number of these functional groups in the containing substance
r: f64
Model parameter
q: f64
Model parameter
Implementations§
Source§impl FunctionalGroup
impl FunctionalGroup
Sourcepub fn from(id: u8, amount: f64) -> Result<FunctionalGroup, &'static str>
pub fn from(id: u8, amount: f64) -> Result<FunctionalGroup, &'static str>
Create a functional group
This is the intended method to setup a substance by adding funcional groups.
§Arguments
id
- ID identifying the functional group. The IDs can be obtained from DDBST.amount
- Number of this functional group in the containing substance
§Example
use unifac::*;
let ch3 = FunctionalGroup::from(1, 2.0).unwrap();
Trait Implementations§
Source§impl Clone for FunctionalGroup
impl Clone for FunctionalGroup
Source§fn clone(&self) -> FunctionalGroup
fn clone(&self) -> FunctionalGroup
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FunctionalGroup
impl Debug for FunctionalGroup
Source§impl<'de> Deserialize<'de> for FunctionalGroup
impl<'de> Deserialize<'de> for FunctionalGroup
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FunctionalGroup
impl RefUnwindSafe for FunctionalGroup
impl Send for FunctionalGroup
impl Sync for FunctionalGroup
impl Unpin for FunctionalGroup
impl UnwindSafe for FunctionalGroup
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<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 more