Skip to main content

SmrReaction

Enum SmrReaction 

Source
pub enum SmrReaction {
    Reforming,
    WaterGasShift,
}
Expand description

Which of the two independent reactions.

Variants§

§

Reforming

CH4 + H2O <=> CO + 3 H2.

§

WaterGasShift

CO + H2O <=> CO2 + H2.

Implementations§

Source§

impl SmrReaction

Source

pub const BOTH: [SmrReaction; 2]

Both, in the order smr_reactions returns them.

Source

pub fn stoichiometry(self) -> [(Species, f64); 4]

Signed stoichiometry νᵢ — negative reactant, positive product.

Source

pub fn base_reactant(self) -> Species

The reaction’s base reactant — the species whose conversion normalises the extent.

Source

pub fn delta_h(self) -> f64

Standard reaction enthalpy ΔH° at 298.15 K [J/mol of extent], summed from crate::species formation enthalpies.

Positive is endothermic. Nothing here is a tabulated reaction enthalpy — it is Σ νᵢ ΔH°f,ᵢ, so it cannot disagree with the species table it is built from.

Source

pub fn delta_s(self) -> f64

Standard reaction entropy ΔS° at 298.15 K [J/(mol·K)], summed from absolute entropies as Σ νᵢ S°ᵢ.

Source

pub fn delta_g(self, temperature_k: f64) -> f64

Standard Gibbs energy of reaction at temperature_k [J/mol], on the constant-ΔH°/ΔS° (van ’t Hoff) approximation: ΔG° = ΔH° − T ΔS°.

This is the model’s main thermodynamic approximation. Treating ΔH° and ΔS° as temperature-independent ignores the ∫Cp dT and ∫Cp/T dT corrections, which over 298 K → 1200 K are not negligible. It is the approximation EquilibriumConstant::GibbsVantHoff embodies, and it is kept because the alternative — integrating heat capacities — needs Cp(T) polynomials this crate would have to source and catalogue. Stated so a reader does not mistake the equilibrium curve for an exact one.

Source

pub fn equilibrium_constant(self, temperature_k: f64) -> f64

Equilibrium constant Kp(T) [-] on the standard-state partial pressure basis: Kp = exp(−ΔG°(T)/(R T)), with each partial pressure referred to P° = 1 bar.

This is the thermodynamic equilibrium constant. It is not the one a concentration-basis rate law equilibrates to unless Δn = 0 — see SmrReaction::kc.

Source

pub fn delta_n(self) -> f64

Change in mole count, Δn = Σ νᵢ [-].

+2 for reforming (1 + 1 → 1 + 3) and 0 for the shift. It is the whole reason kc exists.

Source

pub fn kc(self, temperature_k: f64) -> f64

Equilibrium constant on the molar concentration basis, Kc = Π Cᵢ^νᵢ in (mol/m³)^Δn.

§Why this is not Kp, and why getting it wrong is expensive

Reaction::net_rate evaluates k_f·ΠC^d − k_r·ΠC^r in concentrations, so the composition its rate law settles at satisfies k_f/k_r = Kc, not Kp. For an ideal gas pᵢ = Cᵢ R T, so

  Kp = Kc · (R T / P°)^Δn      =>      Kc = Kp · (P° / (R T))^Δn

For the shift reaction Δn = 0 and the two coincide. For reforming Δn = +2, and at 1123 K the factor (R T / P°)² is about 115 — so using Kp where Kc belongs would put the reforming equilibrium out by two orders of magnitude, in the direction of far too little conversion. That is not a subtle error, but it is a silent one: the reactor still converges, and still returns a plausible-looking number.

P° is 1 bar = 100 kPa, the standard state the formation data in crate::species is tabulated at.

Trait Implementations§

Source§

impl Clone for SmrReaction

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SmrReaction

Source§

impl Debug for SmrReaction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for SmrReaction

Source§

impl PartialEq for SmrReaction

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SmrReaction

Auto Trait Implementations§

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<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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
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.