chemmisol 0.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
chemmisol::ChemicalSpecies Class Referenceabstract

#include <species.h>

Inheritance diagram for chemmisol::ChemicalSpecies:
Inheritance graph
[legend]

Public Member Functions

const std::string & getName () const
 
std::size_t getIndex () const
 
virtual Phase getPhase () const =0
 
virtual void incrementConcentration (double extent)=0
 
virtual double concentration () const =0
 
virtual double concentration (double quantity) const =0
 
double activity () const
 
virtual double activity (double concentration) const =0
 
double quantity () const
 
virtual double quantity (double activity) const =0
 
virtual std::complex< double > quantity (std::complex< double > activity) const =0
 
virtual void setActivity (double activity)=0
 

Protected Member Functions

 ChemicalSpecies (const std::string &name, std::size_t index)
 

Detailed Description

Describes a chemical species contained in a chemical system. A quantity() is assigned to each chemical species in a system, typically in mole, and a concentration() and an activity() corresponding to this quantity is also defined, depending on the phase and type of the chemical species.

The methods activity(concentration) -> quantity(activity) -> concentration(quantity) form a triangle that allows to convert between concentrations, activities and quantities of species of any phase.

Constructor & Destructor Documentation

◆ ChemicalSpecies()

chemmisol::ChemicalSpecies::ChemicalSpecies ( const std::string &  name,
std::size_t  index 
)
inlineprotected

Defines a simple chemical species.

Parameters
nameName of the species.
indexIndex used to retrieve the species in data structures used internally by the ChemicalSystem. The index can also be used to uniquely identify each species of a system.

Member Function Documentation

◆ getName()

const std::string & chemmisol::ChemicalSpecies::getName ( ) const
inline

Name of the component.

◆ getIndex()

std::size_t chemmisol::ChemicalSpecies::getIndex ( ) const
inline

Index used to retrieve the species in data structures used internally by the ChemicalSystem. The index can also be used to uniquely identify each chemical species of a system.

◆ getPhase()

virtual Phase chemmisol::ChemicalSpecies::getPhase ( ) const
pure virtual

◆ incrementConcentration()

virtual void chemmisol::ChemicalSpecies::incrementConcentration ( double  extent)
pure virtual

Increments the concentration of the current component, considering that its absolute quantity is incremented by extent.

For components in solution, this is typically C = C + extent/V.

Parameters
extentQuantity of the current component added to the system

Implemented in chemmisol::AqueousSpecies, chemmisol::MineralSpecies, and chemmisol::FixedChemicalSpecies.

◆ concentration() [1/2]

virtual double chemmisol::ChemicalSpecies::concentration ( ) const
pure virtual

Returns the current concentration of the component.

The theoretical definition of the concentration might vary depending on the nature of the component (aqueous, gaz, mineral...).

Returns
Current concentration of the component

Implemented in chemmisol::FixedChemicalSpecies, chemmisol::AqueousSpecies, and chemmisol::MineralSpecies.

◆ concentration() [2/2]

virtual double chemmisol::ChemicalSpecies::concentration ( double  quantity) const
pure virtual

Computes the concentration of the current component corresponding to the specified quantity.

Notice that quantity might be different from quantity(), and that this call does not modify the concentration of the current component.

Parameters
quantityQuantity of the component
Returns
Computed concentration of the component

Implemented in chemmisol::AqueousSpecies, chemmisol::MineralSpecies, and chemmisol::FixedChemicalSpecies.

◆ activity() [1/2]

double chemmisol::ChemicalSpecies::activity ( ) const
inline

Returns the current activity of the component.

The theoretical definition of the activity might vary depending on the nature of the component (aqueous, gaz, mineral...).

The implementation is equivalent to a call to activity(concentration()), so that the implementation of the activity(double concentration) method defines the value returned by the activity() method.

Returns
Current activity of the component

◆ activity() [2/2]

virtual double chemmisol::ChemicalSpecies::activity ( double  concentration) const
pure virtual

Computes the activity of the current component corresponding to the specified concentration.

Notice that concentration might be different from concentration(), and that this call does not modify the activity of the current component.

Parameters
concentrationConcentration of the component
Returns
Computed activity of the component

Implemented in chemmisol::AqueousSpecies, chemmisol::MineralSpecies, and chemmisol::FixedChemicalSpecies.

◆ quantity() [1/2]

double chemmisol::ChemicalSpecies::quantity ( ) const
inline

Returns the current quantity of the chemical species.

The quantity must be understood as a count of items, for example the count of molecules corresponding to the chemical species in the system, typically expressed in mole.

The implementation is equivalent to a call to quantity(concentration()), so that the implementation of the quantity(double concentration) method defines the value returned by the quantity() method.

Returns
Quantity of the chemical species in the chemical system

◆ quantity() [2/2]

virtual double chemmisol::ChemicalSpecies::quantity ( double  activity) const
pure virtual

Computes the quantity of the current component corresponding to the specified concentration.

Notice that activity might be different from activity(), and that this call does not modify the quantity of the current component.

Parameters
activityActivity of the component
Returns
Computed quantity of the component

Implemented in chemmisol::AqueousSpecies, chemmisol::MineralSpecies, and chemmisol::FixedChemicalSpecies.

◆ setActivity()

virtual void chemmisol::ChemicalSpecies::setActivity ( double  activity)
pure virtual

Sets the activity of the chemical species. The quantity() and concentration() values are updated accordingly.

Implemented in chemmisol::AqueousSpecies, chemmisol::MineralSpecies, and chemmisol::FixedChemicalSpecies.


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