chemmisol 0.1
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
chemmisol::AqueousSpecies Class Reference

#include <species.h>

Inheritance diagram for chemmisol::AqueousSpecies:
Inheritance graph
[legend]
Collaboration diagram for chemmisol::AqueousSpecies:
Collaboration graph
[legend]

Public Member Functions

 AqueousSpecies (const std::string &name, std::size_t id, double C)
 
Phase getPhase () const override
 
void incrementConcentration (double extent) override
 
double concentration () const override
 
double concentration (double quantity) const override
 
double quantity (double activity) const override
 
std::complex< double > quantity (std::complex< double > activity) const override
 
double activity (double concentration) const override
 
void setActivity (double activity) override
 
- Public Member Functions inherited from chemmisol::ChemicalSpecies
const std::string & getName () const
 
std::size_t getIndex () const
 
double activity () const
 
double quantity () const
 

Static Public Attributes

static const double V
 

Additional Inherited Members

- Protected Member Functions inherited from chemmisol::ChemicalSpecies
 ChemicalSpecies (const std::string &name, std::size_t index)
 

Detailed Description

Aqueous species implementation.

The concentration of an aqueous component is defined as C=n/V where n is the component quantity and V is the volume of the solution. A concentration is usually expressed in mol/L (molar).

The activity of an aqueous component is defined as C/C0 where C0 is the standard state concentration defined as 1mol/L.

Constructor & Destructor Documentation

◆ AqueousSpecies()

chemmisol::AqueousSpecies::AqueousSpecies ( const std::string &  name,
std::size_t  id,
double  C 
)
inline

Defines a new AqueousSpecies and initializes its concentration to C. It is the responsibility of the user to ensure unit consistency. Predefined units can be used for this purpose, for example:

using namespace mineral;
AqueousSpecies species("Na+", i, 0.1*mol/l);

Member Function Documentation

◆ getPhase()

Phase chemmisol::AqueousSpecies::getPhase ( ) const
inlineoverridevirtual

Phase of the chemical species.

Implements chemmisol::ChemicalSpecies.

◆ incrementConcentration()

void chemmisol::AqueousSpecies::incrementConcentration ( double  extent)
inlineoverridevirtual

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

Implements chemmisol::ChemicalSpecies.

◆ concentration() [1/2]

double chemmisol::AqueousSpecies::concentration ( ) const
inlineoverridevirtual

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

Implements chemmisol::ChemicalSpecies.

◆ concentration() [2/2]

double chemmisol::AqueousSpecies::concentration ( double  quantity) const
inlineoverridevirtual

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

Implements chemmisol::ChemicalSpecies.

◆ quantity() [1/2]

double chemmisol::AqueousSpecies::quantity ( double  activity) const
inlineoverridevirtual

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

Implements chemmisol::ChemicalSpecies.

◆ quantity() [2/2]

std::complex< double > chemmisol::AqueousSpecies::quantity ( std::complex< double >  activity) const
inlineoverridevirtual

◆ activity()

double chemmisol::AqueousSpecies::activity ( double  concentration) const
inlineoverridevirtual

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

Implements chemmisol::ChemicalSpecies.

◆ setActivity()

void chemmisol::AqueousSpecies::setActivity ( double  activity)
inlineoverridevirtual

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

Implements chemmisol::ChemicalSpecies.

Member Data Documentation

◆ V

const double chemmisol::AqueousSpecies::V
static

Solution volume. Currently fixed to 1 liter.

Notice that the concentration() and activity() of aqueous species do not depend on the volume.

If quantities for a different volume are required, it is currently recommend to use concentration() as output and to manually convert the result to a quantity with the formula n=C*V.

Notice that chemmisol currently does not handle reactions with a variable volume.


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