Reaktoro  A unified framework for modeling chemically reactive systems
Reaktoro::GeneralMixture< SpeciesType > Class Template Reference

## Detailed Description

### template<class SpeciesType> class Reaktoro::GeneralMixture< SpeciesType >

Provide a base of implementation for the mixture classes.

#include <GeneralMixture.hpp>

## Public Member Functions

GeneralMixture ()
Construct a default GeneralMixture instance.

GeneralMixture (const std::vector< SpeciesType > &species)
Construct a GeneralMixture instance with given species. More...

virtual ~GeneralMixture ()
Destroy the instance.

auto setName (std::string name) -> void
Set the name of the mixture.

auto numSpecies () const -> unsigned
Return the number of species in the mixture.

auto name () const -> std::string
Return the name of the mixture.

auto species () const -> const std::vector< SpeciesType > &
Return the species that compose the mixture. More...

auto species (const Index &index) const -> const SpeciesType &
Return a species in the mixture. More...

auto indexSpecies (const std::string &name) const -> Index
Return the index of a species in the mixture. More...

auto indexSpeciesAny (const std::vector< std::string > &names) const -> Index
Return the index of the first species in the mixture with any of the given names. More...

auto namesSpecies () const -> std::vector< std::string >
Return the names of the species in the mixture.

auto chargesSpecies () const -> Vector
Return the charges of the species in the mixture.

auto molarFractions (const Vector &n) const -> ChemicalVector
Calculates the molar fractions of the species and their partial derivatives. More...

auto state (double T, double P, const Vector &n) const -> MixtureState
Calculate the state of the mixture. More...

## Constructor & Destructor Documentation

template<class SpeciesType>
 Reaktoro::GeneralMixture< SpeciesType >::GeneralMixture ( const std::vector< SpeciesType > & species )
explicit

Construct a GeneralMixture instance with given species.

Parameters
 species The names of the species in the mixture

## Member Function Documentation

template<class SpeciesType>
 auto Reaktoro::GeneralMixture< SpeciesType >::species ( ) const -> const std::vector&

Return the species that compose the mixture.

Returns
The species that compose the mixture
template<class SpeciesType>
 auto Reaktoro::GeneralMixture< SpeciesType >::species ( const Index & index ) const -> const SpeciesType&

Return a species in the mixture.

Parameters
 index The index of the species
Returns
The species with given index
template<class SpeciesType >
 auto Reaktoro::GeneralMixture< SpeciesType >::indexSpecies ( const std::string & name ) const -> Index

Return the index of a species in the mixture.

Parameters
 name The name of the species in the mixture
Returns
The index of the species if found, or the number of species otherwise
template<class SpeciesType >
 auto Reaktoro::GeneralMixture< SpeciesType >::indexSpeciesAny ( const std::vector< std::string > & names ) const -> Index

Return the index of the first species in the mixture with any of the given names.

Parameters
 names The tentative names of the species in the mixture.
Returns
The index of the species if found, or the number of species otherwise.
template<class SpeciesType >
 auto Reaktoro::GeneralMixture< SpeciesType >::molarFractions ( const Vector & n ) const -> ChemicalVector

Calculates the molar fractions of the species and their partial derivatives.

Parameters
 n The molar abundance of the species (in units of mol)
Returns
The molar fractions and their partial derivatives
template<class SpeciesType >
 auto Reaktoro::GeneralMixture< SpeciesType >::state ( double T, double P, const Vector & n ) const -> MixtureState

Calculate the state of the mixture.

Parameters
 T The temperature (in units of K) P The pressure (in units of Pa) n The molar amounts of the species in the mixture (in units of mol)

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