Species

ChemistryLab.SpeciesType
struct Species{T<:Number} <: AbstractSpecies

Standard chemical species representation using atomic composition.

Fields

  • name::String: human-readable name.
  • symbol::String: species symbol.
  • formula::Formula{T}: chemical formula with stoichiometric coefficients.
  • aggregate_state::AggregateState: physical state.
  • class::Class: chemical class.
  • properties::OrderedDict{Symbol,PropertyType}: thermodynamic and other properties.

Examples

julia> s = Species("H2O"; name="Water", aggregate_state=AS_AQUEOUS);

julia> atoms(s)
OrderedDict{Symbol, Int64} with 2 entries:
  :H => 2
  :O => 1
source
Base.isequalMethod
Base.isequal(s1::AbstractSpecies, s2::AbstractSpecies) -> Bool

Compare two species for equality based on formula, aggregate state, and class.

Examples

julia> s1 = Species("H2O"; aggregate_state=AS_AQUEOUS);

julia> s2 = Species("H₂O"; aggregate_state=AS_AQUEOUS);

julia> s1 == s2
true
source
ChemistryLab.chargeMethod
charge(s::AbstractSpecies) -> Int8

Return the formal charge of the species.

Examples

julia> s1 = Species("Ca(HSiO3)+");

julia> charge(s1) == 1
true
source
ChemistryLab.CemSpeciesType
struct CemSpecies{T<:Number,S<:Number} <: AbstractSpecies

Cement chemistry species representation using oxide notation.

Fields

  • name::String: human-readable name.
  • symbol::String: species symbol.
  • formula::Formula{T}: atomic composition formula.
  • cemformula::Formula{S}: oxide notation formula.
  • aggregate_state::AggregateState: physical state.
  • class::Class: chemical class.
  • properties::OrderedDict{Symbol,PropertyType}: thermodynamic and other properties.

Examples

julia> s = CemSpecies("C3A"; name="Tricalcium aluminate");

julia> oxides(s)
OrderedDict{Symbol, Int64} with 2 entries:
  :C => 3
  :A => 1
source
ChemistryLab.nameMethod
name(s::AbstractSpecies) -> String

Return the name of the species.

Examples

julia> s1 = Species("H2O"; aggregate_state=AS_AQUEOUS);

julia> s1.name == "H2O"
true
source
ChemistryLab.formulaMethod
formula(s::AbstractSpecies) -> Formula

Return the Formula object associated with the species.

Examples

julia> s1 = Species("H2O"; aggregate_state=AS_AQUEOUS);

julia> formula(s1) == Formula("H2O")
true
source
ChemistryLab.atomsMethod
atoms(s::AbstractSpecies) -> OrderedDict{Symbol,Number}

Return the atomic composition (element => coefficient) of the species.

source
ChemistryLab.atoms_chargeMethod
atoms_charge(s::AbstractSpecies) -> OrderedDict{Symbol,Number}

Return atomic composition including the charge as a :Zz key if non-zero.

Examples

julia> s = Species("Ca+2");

julia> atoms_charge(s)
OrderedDict{Symbol, Int64} with 2 entries:
  :Ca => 1
  :Zz => 2
source
ChemistryLab.oxidesFunction
oxides(s::CemSpecies) -> OrderedDict{Symbol,Number}

Return the oxide composition of the cement species.

source
ChemistryLab.oxides_chargeFunction
oxides_charge(s::CemSpecies) -> OrderedDict{Symbol,Number}

Return oxide composition including the charge as a :Zz key if non-zero.

source
ChemistryLab.componentsFunction
components(s::Species) -> OrderedDict{Symbol,Number}

Return the components of a Species (atomic composition with charge).

source
components(s::CemSpecies) -> OrderedDict{Symbol,Number}

Return the components of a CemSpecies (oxide composition with charge).

source
ChemistryLab.aggregate_stateMethod
aggregate_state(s::AbstractSpecies) -> AggregateState

Return the aggregate state of the species.

Examples

julia> s1 = Species("H2O"; aggregate_state=AS_AQUEOUS);

julia> aggregate_state(s1) == AS_AQUEOUS
true
source
ChemistryLab.propertiesMethod
properties(s::AbstractSpecies) -> OrderedDict{Symbol,PropertyType}

Return the properties dictionary of the species.

source