Reaktoro  v2.0.0
A unified framework for modeling chemically reactive systems

A type used to represent a chemical species and its attributes. More...

#include <Species.hpp>

Classes

struct  Attribs
 The attributes of a Species object. More...
 

Public Member Functions

 Species ()
 Construct a default Species object.
 
 Species (const String &formula)
 Construct a Species object with given chemical formula (e.g., H2O, CaCO3, CO3--, CO3-2).
 
 Species (const Attribs &attribs)
 Construct a Species object with given attributes.
 
auto clone () const -> Species
 Return a deep copy of this Species object.
 
auto withName (String name) const -> Species
 Return a duplicate of this Species object with new name that uniquely identifies this species.
 
auto withFormula (String formula) const -> Species
 Return a duplicate of this Species object with new formula (e.g., H2O, CaCO3, CO3--, CO3-2).
 
auto withSubstance (String substance) const -> Species
 Return a duplicate of this Species object with new case insensitive substance name (e.g. WATER, CARBON-MONOXIDE).
 
auto withElements (ElementalComposition elements) const -> Species
 Return a duplicate of this Species object with new elemental composition.
 
auto withCharge (double charge) const -> Species
 Return a duplicate of this Species object with new electric charge attribute.
 
auto withAggregateState (AggregateState option) const -> Species
 Return a duplicate of this Species object with new aggregate state.
 
auto withFormationReaction (const FormationReaction &reaction) const -> Species
 Return a duplicate of this Species object with new formation reaction and new standard thermodynamic model. More...
 
auto withStandardGibbsEnergy (const Param &G0) const -> Species
 Return a duplicate of this Species object with new standard thermodynamic model. More...
 
auto withStandardThermoModel (const StandardThermoModel &model) const -> Species
 Return a duplicate of this Species object with new standard thermodynamic model. More...
 
auto withTags (const StringList &tags) const -> Species
 Return a duplicate of this Species object with new tags attribute.
 
auto withAttachedData (Any data) const -> Species
 Return a duplicate of this Species object with new attached data whose type is known at runtime only.
 
auto name () const -> String
 Return the name that uniquely identifies this species if provided, otherwise, its formula.
 
auto formula () const -> ChemicalFormula
 Return the chemical formula of the species.
 
auto substance () const -> String
 Return the name of the underlying substance of the species if provided, otherwise, its formula without any suffix.
 
auto elements () const -> const ElementalComposition &
 Return the elements that compose the species and their coefficients.
 
auto charge () const -> double
 Return the electric charge of the species.
 
auto aggregateState () const -> AggregateState
 Return the aggregate state of the species.
 
auto reaction () const -> const FormationReaction &
 Return the formation reaction of the species.
 
auto standardThermoModel () const -> const StandardThermoModel &
 Return the function that computes the standard thermodynamic properties of the species.
 
auto tags () const -> const Strings &
 Return the tags of the species (e.g., organic, mineral).
 
auto attachedData () const -> const Any &
 Return the attached data of the species whose type is known at runtime only.
 
auto molarMass () const -> double
 Return the molar mass of the species (in kg/mol).
 
auto standardThermoProps (real T, real P) const -> StandardThermoProps
 Calculate the primary standard thermodynamic properties of the species. More...
 
auto props (real T, real P) const -> SpeciesThermoProps
 Calculate the complete set of standard thermodynamic properties of the species. More...
 
auto props (real T, Chars unitT, real P, Chars unitP) const -> SpeciesThermoProps
 Calculate the complete set of standard thermodynamic properties of the species. More...
 

Detailed Description

A type used to represent a chemical species and its attributes.

Member Function Documentation

◆ withFormationReaction()

auto withFormationReaction ( const FormationReaction reaction) const -> Species

Return a duplicate of this Species object with new formation reaction and new standard thermodynamic model.

This method will also set the standard thermodynamic model of the species using the standard thermodynamic model assigned to the formation reaction. Use this method thus to assign a standard thermodynamic model to the Species object instead of using method withStandardThermoModel.

◆ withStandardGibbsEnergy()

auto withStandardGibbsEnergy ( const Param G0) const -> Species

Return a duplicate of this Species object with new standard thermodynamic model.

This method exists for convenience only. Its use results in a standard thermodynamic model for this species in which its standard Gibbs energy is constant. All other standard thermodynamic properties are set to zero. For a more complete standard thermodynamic model, use method withStandardThermoModel or withFormationReaction, in case the thermodynamic model is based on reaction properties.

Parameters
G0The constant standard Gibbs energy of the species (in J/mol).

◆ withStandardThermoModel()

auto withStandardThermoModel ( const StandardThermoModel model) const -> Species

Return a duplicate of this Species object with new standard thermodynamic model.

This method assigns a standard thermodynamic model for the computation of standard thermodynamic properties of the species at given temperature and pressure. Alternatively, methods withStandardGibbsEnergy and withFormationReaction can be used to indirectly assign a standard thermodynamic model to this species.

◆ standardThermoProps()

auto standardThermoProps ( real  T,
real  P 
) const -> StandardThermoProps

Calculate the primary standard thermodynamic properties of the species.

Parameters
TThe temperature for the calculation (in K)
PThe pressure for the calculation (in Pa)
Returns
The primary set of standard thermodynamic properties of the species.

◆ props() [1/2]

auto props ( real  T,
real  P 
) const -> SpeciesThermoProps

Calculate the complete set of standard thermodynamic properties of the species.

Parameters
TThe temperature for the calculation (in K)
PThe pressure for the calculation (in Pa)
Returns
The complete set of standard thermodynamic properties of the species.

◆ props() [2/2]

auto props ( real  T,
Chars  unitT,
real  P,
Chars  unitP 
) const -> SpeciesThermoProps

Calculate the complete set of standard thermodynamic properties of the species.

Parameters
TThe temperature for the calculation
unitTThe temperature unit for the calculation
PThe pressure for the calculation
unitPThe pressure unit for the calculation
Returns
The complete set of standard thermodynamic properties of the species.

The documentation for this class was generated from the following file: