Reaktoro 
A unified framework for modeling chemically reactive systems
Reaktoro Namespace Reference

The namespace containing all components of the Reaktoro library. More...

Classes

class  AqueousMixture
 A type used to describe an aqueous mixture. More...
 
struct  AqueousMixtureState
 A type used to describe the state of an aqueous mixture. More...
 
class  AqueousPhase
 A type used to describe an aqueous phase. More...
 
class  AqueousSpecies
 A type to represent an aqueous species. More...
 
struct  AqueousSpeciesThermoData
 A type for storing the thermodynamic data of an aqueous species. More...
 
struct  AqueousSpeciesThermoParamsHKF
 A type for storing the parameters of the HKF equation of state for a aqueous species. More...
 
class  BilinearInterpolator
 A class used to calculate bilinear interpolation of data in two dimensions. More...
 
class  ChemicalEditor
 Provides convenient operations to initialize ChemicalSystem and ReactionSystem instances. More...
 
class  ChemicalField
 A type that contains the values of a scalar field and its derivatives. More...
 
class  ChemicalOutput
 A type used to output sequence of chemical states to a file or terminal. More...
 
class  ChemicalPlot
 A class used to create plots from sequence of chemical states. More...
 
class  ChemicalProperties
 A class for querying thermodynamic and chemical properties of a chemical system. More...
 
class  ChemicalPropertiesAqueousPhase
 A class for querying aqueous thermodynamic and chemical properties in a chemical system. More...
 
class  ChemicalQuantity
 A class that provides a convenient way to retrieve chemical quantities. More...
 
class  ChemicalScalarBase
 A template base class to represent a chemical scalar and its partial derivatives. More...
 
class  ChemicalSolver
 A type that describes a solver for many chemical calculations. More...
 
class  ChemicalState
 Provides a computational representation of the state of a multiphase chemical system. More...
 
class  ChemicalSystem
 A class to represent a system and its attributes and properties. More...
 
class  ChemicalVectorBase
 A template base class to represent a vector of chemical scalars and their partial derivatives. More...
 
class  Composition
 A type that describes temperature in units of K. More...
 
class  Connectivity
 A type to describe the connectivity of elements, species, and phases in a chemical system. More...
 
class  CubicEOS
 Defines a cubic equation of state and calculates thermodynamic properties of a fluid phase. More...
 
struct  DaeOptions
 A struct that defines the options for the DaeSolver. More...
 
class  DaeProblem
 A class that defines a system of differential-algebraic equations (DAE) problem. More...
 
class  DaeSolver
 A class for solving differential-algebraic equations (DAE). More...
 
class  Database
 Provides operations to retrive physical and thermodynamic data of chemical species. More...
 
class  DebyeHuckelParams
 A class used to define the parameters in the Debye–Hückel activity model for aqueous mixtures. More...
 
class  Element
 A type used to define a chemical element and its attributes. More...
 
struct  EosParamsPitzer
 A struct that defines the interaction parameters for the Pitzer model described in Harvie, Møller, and Weare (1984). More...
 
class  EquilibriumBalance
 A class that defines the mass balance conditions for equilibrium calculations. More...
 
class  EquilibriumCompositionProblem
 A type that contains the values of a scalar field and its derivatives. More...
 
class  EquilibriumInverseProblem
 A class used for defining an inverse equilibrium problem. More...
 
class  EquilibriumInverseSolver
 A class used for solving inverse equilibrium problems. More...
 
struct  EquilibriumOptions
 The options for the equilibrium calculations. More...
 
class  EquilibriumPath
 A class that describes a path of equilibrium states. More...
 
struct  EquilibriumPathOptions
 A struct that describes the options from an equilibrium path calculation. More...
 
struct  EquilibriumPathResult
 A struct that describes the result of an equilibrium path calculation. More...
 
class  EquilibriumProblem
 A type that defines an equilibrium problem. More...
 
class  EquilibriumReactions
 A class that generates a system of equilibrium reactions written in terms of master and secondary species. More...
 
struct  EquilibriumResult
 A type used to describe the result of an equilibrium calculation. More...
 
struct  EquilibriumSensitivity
 A type that contains the sensitivity data of the equilibrium state. More...
 
class  EquilibriumSolver
 A solver class for solving chemical equilibrium calculations. More...
 
struct  Exception
 Provides a convenient way to initialized an exception with helpful error messages. More...
 
class  Filter
 A type that describes an optimisation filter. More...
 
struct  FunctionG
 A type used to describe the function g of the HKF model and its partial temperature and pressure derivatives. More...
 
class  GaseousMixture
 Provides a computational representation of a gaseous mixture. More...
 
struct  GaseousMixtureState
 A type used to describe the state of a gaseous mixture. More...
 
class  GaseousPhase
 Class that defines a gaseous phase. More...
 
class  GaseousSpecies
 A type to describe the attributes of a gaseous species. More...
 
struct  GaseousSpeciesThermoData
 A type for storing the thermodynamic data of a gaseous species. More...
 
struct  GaseousSpeciesThermoParamsHKF
 A type for storing the parameters of the HKF equation of state for a gaseous species. More...
 
class  Gems
 A wrapper class for Gems code. More...
 
struct  GemsOptions
 A type that describes the options for Gems. More...
 
class  GeneralMixture
 Provide a base of implementation for the mixture classes. More...
 
class  Gnuplot
 
struct  Hessian
 A type to describe the Hessian of an objective function. More...
 
class  Interface
 A class used to interface other codes with Reaktoro. More...
 
struct  Jacobian
 A type to describe the Jacobian of an equality constraint function. More...
 
struct  KineticOptions
 A struct to describe the options for a chemical kinetics calculation. More...
 
struct  KineticOutputOptions
 
class  KineticPath
 A class that conveniently solves kinetic path calculations. More...
 
class  KineticProblem
 A type that defines a kinetic problem. More...
 
class  KineticResult
 
class  KineticSolver
 A class that represents a solver for chemical kinetics problems. More...
 
struct  KktMatrix
 A type to represent the left-hand side matrix of a KKT equation. More...
 
struct  KktOptions
 A type to describe the options for the KKT calculation. More...
 
struct  KktResult
 A type to describe the result of a KKT calculation. More...
 
struct  KktSolution
 A type to represent the solution vector of a KKT equation. More...
 
class  KktSolver
 A type to describe a solver for a KKT equation. More...
 
struct  KktVector
 A type to represent the right-hand side vector of a KKT equation. More...
 
class  LagrangeInterpolator
 A class used to calculate interpolation of data in one dimension in any order. More...
 
struct  LU
 The class that computes the full pivoting Auxiliary struct for storing the LU decomposition of a matrix A. More...
 
struct  MineralCatalyst
 
struct  MineralMechanism
 
class  MineralMixture
 Provide a computational representation of a mineral mixture. More...
 
struct  MineralMixtureState
 A type used to describe the state of a mineral mixture. More...
 
class  MineralPhase
 Class that defines an mineral phase. More...
 
class  MineralReaction
 
class  MineralSpecies
 A type to describe the attributes of a mineral species. More...
 
struct  MineralSpeciesThermoData
 A type for storing the thermodynamic data of a mineral species. More...
 
struct  MineralSpeciesThermoParamsHKF
 A type for storing the parameters of the HKF equation of state for a mineral species. More...
 
struct  MixtureState
 A type used to describe the state of a mixture. More...
 
struct  NonlinearOptions
 A type that describes the options for the solution of a non-linear problem. More...
 
struct  NonlinearOutput
 A type that describes the options for the output of a non-linear problem calculation. More...
 
struct  NonlinearProblem
 A type that describes the non-linear problem. More...
 
struct  NonlinearResidual
 A type that describes the evaluation result of a non-linear residual function. More...
 
struct  NonlinearResult
 A type that describes the result of a non-linear problem calculation. More...
 
class  NonlinearSolver
 A type that implements the Newton algorithm for solving non-linear problems. More...
 
struct  ObjectiveResult
 A type that describes the result of the evaluation of an objective function. More...
 
struct  ODEOptions
 A struct that defines the options for the ODESolver. More...
 
class  ODEProblem
 A class that defines a system of ordinary differential equations (ODE) problem. More...
 
class  ODESolver
 A wrapper class for CVODE, a library for solving ordinary differential equations. More...
 
struct  OptimumOptions
 A type that describes the options of a optimisation calculation. More...
 
struct  OptimumOutputOptions
 A type that describes the options for the output of a optimisation calculation. More...
 
struct  OptimumParamsActNewton
 
struct  OptimumParamsIpAction
 
struct  OptimumParamsIpActive
 
struct  OptimumParamsIpNewton
 
struct  OptimumParamsIpOpt
 
struct  OptimumParamsKarpov
 
struct  OptimumParamsRefiner
 
struct  OptimumParamsRegularization
 A type that describes the regularization options for the optimisation calculation. More...
 
struct  OptimumProblem
 A type that describes the non-linear constrained optimisation problem. More...
 
struct  OptimumResult
 A type that describes the result of an optimisation calculation. More...
 
class  OptimumSolver
 The friendly interface to all optimisation algorithms. More...
 
class  OptimumSolverActNewton
 The class that implements the ActNewton algorithm using an active-set strategy. More...
 
class  OptimumSolverBase
 The base class for all optimization algorithms. More...
 
class  OptimumSolverIpAction
 The class that implements the IpAction algorithm using an interior-point method with a null-space KKT formulation. More...
 
class  OptimumSolverIpActive
 The class that implements the IpActive algorithm using an interior-point method combined with an active-set strategy. More...
 
class  OptimumSolverIpBounds
 The class that implements the IpBounds algorithm using an interior-point method. More...
 
class  OptimumSolverIpFeasible
 The class that implements the IpFeasible algorithm using an interior-point method. More...
 
class  OptimumSolverIpNewton
 The class that implements the IpNewton algorithm using an interior-point method. More...
 
class  OptimumSolverIpOpt
 The class that implements the IpOpt algorithm using an interior-point method. More...
 
class  OptimumSolverKarpov
 The class that implements an optimization algorithm based on Karpov's method. More...
 
class  OptimumSolverRefiner
 The class that implements a refinement operation of the optimal solution. More...
 
class  OptimumSolverSimplex
 The class that implements the simplex algorithm for linear programming problems. More...
 
struct  OptimumState
 A type that describes the state of an optimum solution. More...
 
class  Optional
 A type for defining an optional instance. More...
 
class  Outputter
 A utility class for printing the progress of iterative calculations. More...
 
struct  OutputterOptions
 
class  Partition
 Provide a computational representation of the Partition of a chemical system. More...
 
class  Phase
 A type used to define a phase and its attributes. More...
 
struct  PhaseChemicalModelResult
 The result of the chemical model function that calculates the chemical properties of a phase. More...
 
class  PhaseChemicalProperties
 Defines a class for querying thermodynamic and chemical properties of a phase. More...
 
struct  PhaseThermoModelResult
 The result of the thermodynamic model function that calculates the standard thermodynamic properties of a phase. More...
 
class  PhaseThermoProperties
 Defines a class for querying thermodynamic and chemical properties of a phase. More...
 
class  Phreeqc
 
class  PhreeqcDatabase
 
class  PhreeqcEditor
 
class  Pressure
 A type that describes pressure in units of Pa. More...
 
class  Reaction
 Provide a computational representation of a chemical reaction. More...
 
class  ReactionEquation
 Define a type that describes the equation of a reaction. More...
 
class  ReactionSystem
 A class that represents a system of chemical reactions. More...
 
struct  ReactionThermoInterpolatedProperties
 A type for storing thermodynamic properties of a reaction over a range of temperatures and pressures. More...
 
class  Regularizer
 A type that represents a regularized optimization problem. More...
 
struct  RegularizerOptions
 A type that describes the options for regularizing linear constraints. More...
 
struct  ResidualEquilibriumConstraints
 A type used to define the result of the evaluation of a system of equilibrium constraints. More...
 
class  Species
 A type used to describe a species and its attributes. More...
 
struct  SpeciesElectroState
 
struct  SpeciesThermoInterpolatedProperties
 A type for storing thermodynamic properties of a species over a range of temperatures and pressures. More...
 
struct  SpeciesThermoParamsPhreeqc
 A type for storing Phreeqc parameters of a species. More...
 
struct  SpeciesThermoState
 Describe the thermodynamic state of a species. More...
 
class  StringList
 A class for representing a list of strings with special constructors. More...
 
class  Temperature
 A type that describes temperature in units of K. More...
 
class  Thermo
 A type to calculate thermodynamic properties of chemical species. More...
 
class  ThermoProperties
 A class used for calculating standard thermodynamic properties of species in a chemical system. More...
 
class  ThermoScalarBase
 A template base class to represent a thermodynamic scalar and its partial derivatives. More...
 
class  ThermoVectorBase
 A template base class to represent a vector of thermodynamic scalars and their partial derivatives. More...
 
struct  WaterElectroState
 
struct  WaterHelmholtzState
 
struct  WaterThermoState
 

Typedefs

using ChemicalScalar = ChemicalScalarBase< double, Vector >
 A type that represents a chemical scalar and its derivatives. More...
 
using ChemicalVector = ChemicalVectorBase< Vector, Vector, Vector, Matrix >
 A type that represents a vector of chemical scalars and their derivatives. More...
 
using Index = std::size_t
 Define a type that represents an index.
 
using Indices = std::vector< Index >
 Define a type that represents a collection of indices.
 
using ThermoScalar = ThermoScalarBase< double >
 A type that defines a scalar thermo property. More...
 
using ThermoVector = ThermoVectorBase< Vector, Vector, Vector >
 A type that defines a vector thermo property. More...
 
using ThermoScalarFunction = std::function< ThermoScalar(double, double)>
 
using ThermoVectorFunction = std::function< ThermoVector(double, double)>
 
using ChemicalScalarFunction = std::function< ChemicalScalar(double, double, const Vector &)>
 
using ChemicalVectorFunction = std::function< ChemicalVector(double, double, const Vector &)>
 
template<typename T >
using Table1D = std::vector< T >
 
template<typename T >
using Table2D = std::vector< std::vector< T >>
 
template<typename T >
using Table3D = std::vector< std::vector< std::vector< T >>>
 
using Time = std::chrono::time_point< std::chrono::high_resolution_clock >
 
using Duration = std::chrono::duration< double >
 
template<typename Condition >
using EnableIf = typename std::enable_if< Condition::value, void >::type
 
template<typename Type >
using IsScalar = std::is_scalar< Type >
 
template<typename Type >
using EnableIfScalar = EnableIf< IsScalar< Type >>
 
using ThermoModelResult = std::vector< PhaseThermoModelResult >
 The result of the thermodynamic model function that calculates the standard thermodynamic properties of all phases in a system.
 
using ChemicalModelResult = std::vector< PhaseChemicalModelResult >
 The result of the chemical model function that calculates the chemical properties of all phases in a system.
 
using ThermoModel = std::function< ThermoModelResult(double, double)>
 The signature of the chemical model function that calculates the thermodynamic properties of a system.
 
using ChemicalModel = std::function< ChemicalModelResult(double, double, const Vector &)>
 The signature of the chemical model function that calculates the chemical properties of a system.
 
using ReactionRateFunction = std::function< ChemicalScalar(const ChemicalProperties &)>
 The function signature of the rate of a reaction (in units of mol/s). More...
 
using ReactionRateVectorFunction = std::function< ChemicalVector(const ChemicalProperties &)>
 The function signature of the rates of a collection of reactions (in units of mol/s). More...
 
using DaeFunction = std::function< int(double t, const Vector &u, const Vector &udot, Vector &F)>
 The function signature of the right-hand side function of a system of ordinary differential equations.
 
using DaeJacobian = std::function< int(double t, const Vector &u, const Vector &udot, Matrix &J)>
 The function signature of the Jacobian of the right-hand side function of a system of ordinary differential equations.
 
using ScalarFunction = std::function< double(const Vector &)>
 Define a scalar function type.
 
using VectorFunction = std::function< Vector(const Vector &)>
 Define a vector function type.
 
using Vector = Eigen::VectorXd
 Define an alias to the vector type of the Eigen library.
 
using Matrix = Eigen::MatrixXd
 Define an alias to the matrix type of the Eigen library.
 
using PermutationMatrix = Eigen::PermutationMatrix< Eigen::Dynamic, Eigen::Dynamic >
 Define an alias to a permutation matrix type of the Eigen library.
 
using N_Vector = struct _generic_N_Vector *
 
using ODEFunction = std::function< int(double, const Vector &, Vector &)>
 The function signature of the right-hand side function of a system of ordinary differential equations.
 
using ODEJacobian = std::function< int(double, const Vector &, Matrix &)>
 The function signature of the Jacobian of the right-hand side function of a system of ordinary differential equations.
 
using CubicRoots = std::tuple< std::complex< double >, std::complex< double >, std::complex< double >>
 Define a type that describes the roots of a cubic equation.
 
using NonlinearFunction = std::function< NonlinearResidual(const Vector &x)>
 A type that describes the functional signature of a non-linear residual function. More...
 
using ObjectiveFunction = std::function< ObjectiveResult(const Vector &x)>
 A type that describes the functional signature of an objective function. More...
 
using AqueousActivityModel = std::function< ChemicalScalar(const AqueousMixtureState &)>
 The signature of a function that calculates the ln activity coefficient of a neutral aqueous species. More...
 
using PhaseChemicalModel = std::function< PhaseChemicalModelResult(double, double, const Vector &)>
 The signature of the chemical model function that calculates the chemical properties of a phase.
 
using PhaseThermoModel = std::function< PhaseThermoModelResult(double, double)>
 The signature of the thermodynamic model function that calculates the standard thermodynamic properties of a phase.
 

Enumerations

enum  PhaseType { Solid, Liquid, Gas, Plasma }
 A type to define the possible state of matter of a phase.
 
enum  GibbsHessian { GibbsHessian::Exact, GibbsHessian::ExactDiagonal, GibbsHessian::Approximation, GibbsHessian::ApproximationDiagonal }
 The options for the description of the Hessian of the Gibbs energy function. More...
 
enum  ODEStepMode { Adams, BDF }
 The linear multistep method to be used in ODESolver.
 
enum  ODEIterationMode { Functional, Newton }
 The type of nonlinear solver iteration to be used in ODESolver.
 
enum  KktMethod {
  KktMethod::PartialPivLU, KktMethod::FullPivLU, KktMethod::Nullspace, KktMethod::Rangespace,
  KktMethod::Automatic
}
 An enumeration of possible methods for the solution of a KKT equation. More...
 
enum  OptimumMethod {
  IpAction, IpActive, IpNewton, IpOpt,
  Karpov, Refiner, Simplex, ActNewton
}
 The method used for the optimisation calculationss.
 
enum  StepMode { Conservative, Aggressive }
 The available stepping modes for some optimization algorithms. More...
 

Functions

auto amount (double value, Index size, Index index) -> ChemicalScalarBase< double, decltype(unit(size, index))>
 Return a ChemicalScalar representation of a mole amount of a species. More...
 
template<typename V , typename N >
auto operator+ (const ChemicalScalarBase< V, N > &l) -> ChemicalScalarBase< V, N >
 
template<typename V , typename N >
auto operator- (const ChemicalScalarBase< V, N > &l) -> ChemicalScalarBase< double, decltype(-l.ddn)>
 
template<typename VL , typename NL , typename VR , typename NR >
auto operator+ (const ChemicalScalarBase< VL, NL > &l, const ChemicalScalarBase< VR, NR > &r) -> ChemicalScalarBase< double, decltype(l.ddn+r.ddn)>
 
template<typename VL , typename NL , typename VR >
auto operator+ (const ChemicalScalarBase< VL, NL > &l, const ThermoScalarBase< VR > &r) -> ChemicalScalarBase< double, decltype(l.ddn)>
 
template<typename VL , typename VR , typename NR >
auto operator+ (const ThermoScalarBase< VL > &l, const ChemicalScalarBase< VR, NR > &r) -> decltype(r+l)
 
template<typename V , typename N >
auto operator+ (const ChemicalScalarBase< V, N > &l, double r) -> ChemicalScalarBase< double, decltype(l.ddn)>
 
template<typename V , typename N >
auto operator+ (double l, const ChemicalScalarBase< V, N > &r) -> decltype(r+l)
 
template<typename VL , typename NL , typename VR , typename NR >
auto operator- (const ChemicalScalarBase< VL, NL > &l, const ChemicalScalarBase< VR, NR > &r) -> ChemicalScalarBase< double, decltype(l.ddn-r.ddn)>
 
template<typename VL , typename NL , typename VR >
auto operator- (const ChemicalScalarBase< VL, NL > &l, const ThermoScalarBase< VR > &r) -> ChemicalScalarBase< double, decltype(l.ddn)>
 
template<typename VL , typename VR , typename NR >
auto operator- (const ThermoScalarBase< VL > &l, const ChemicalScalarBase< VR, NR > &r) -> ChemicalScalarBase< double, decltype(-r.ddn)>
 
template<typename V , typename N >
auto operator- (const ChemicalScalarBase< V, N > &l, double r) -> ChemicalScalarBase< double, decltype(l.ddn)>
 
template<typename V , typename N >
auto operator- (double l, const ChemicalScalarBase< V, N > &r) -> ChemicalScalarBase< double, decltype(-r.ddn)>
 
template<typename V , typename N >
auto operator* (double l, const ChemicalScalarBase< V, N > &r) -> ChemicalScalarBase< double, decltype(l *r.ddn)>
 
template<typename V , typename N >
auto operator* (const ChemicalScalarBase< V, N > &l, double r) -> decltype(r *l)
 
template<typename VL , typename VR , typename NR >
auto operator* (const ThermoScalarBase< VL > &l, const ChemicalScalarBase< VR, NR > &r) -> ChemicalScalarBase< double, decltype(l.val *r.ddn)>
 
template<typename VL , typename NL , typename VR >
auto operator* (const ChemicalScalarBase< VL, NL > &l, const ThermoScalarBase< VR > &r) -> decltype(r *l)
 
template<typename VL , typename NL , typename VR , typename NR >
auto operator* (const ChemicalScalarBase< VL, NL > &l, const ChemicalScalarBase< VR, NR > &r) -> ChemicalScalarBase< double, decltype(l.val *r.ddn+l.ddn *r.val)>
 
template<typename V , typename N >
auto operator/ (double l, const ChemicalScalarBase< V, N > &r) -> ChemicalScalarBase< double, decltype(double()*r.ddn)>
 
template<typename V , typename N >
auto operator/ (const ChemicalScalarBase< V, N > &l, double r) -> decltype((1.0/r)*l)
 
template<typename VL , typename VR , typename NR >
auto operator/ (const ThermoScalarBase< VL > &l, const ChemicalScalarBase< VR, NR > &r) -> ChemicalScalarBase< double, decltype(-(l.val *r.ddn)*double())>
 
template<typename VL , typename NL , typename VR >
auto operator/ (const ChemicalScalarBase< VL, NL > &l, const ThermoScalarBase< VR > &r) -> ChemicalScalarBase< double, decltype(l.ddn/r.val)>
 
template<typename VL , typename NL , typename VR , typename NR >
auto operator/ (const ChemicalScalarBase< VL, NL > &l, const ChemicalScalarBase< VR, NR > &r) -> ChemicalScalarBase< double, decltype((l.ddn *r.val-l.val *r.ddn)*double())>
 
template<typename VL , typename NL , typename VR , typename NR >
auto operator< (const ChemicalScalarBase< VL, NL > &l, const ChemicalScalarBase< VR, NR > &r) -> bool
 
template<typename V , typename N >
auto operator< (const ChemicalScalarBase< V, N > &l, double r) -> bool
 
template<typename V , typename N >
auto operator< (double l, const ChemicalScalarBase< V, N > &r) -> bool
 
template<typename VL , typename NL , typename VR , typename NR >
auto operator<= (const ChemicalScalarBase< VL, NL > &l, const ChemicalScalarBase< VR, NR > &r) -> bool
 
template<typename V , typename N >
auto operator<= (const ChemicalScalarBase< V, N > &l, double r) -> bool
 
template<typename V , typename N >
auto operator<= (double l, const ChemicalScalarBase< V, N > &r) -> bool
 
template<typename VL , typename NL , typename VR , typename NR >
auto operator> (const ChemicalScalarBase< VL, NL > &l, const ChemicalScalarBase< VR, NR > &r) -> bool
 
template<typename V , typename N >
auto operator> (const ChemicalScalarBase< V, N > &l, double r) -> bool
 
template<typename V , typename N >
auto operator> (double l, const ChemicalScalarBase< V, N > &r) -> bool
 
template<typename VL , typename NL , typename VR , typename NR >
auto operator>= (const ChemicalScalarBase< VL, NL > &l, const ChemicalScalarBase< VR, NR > &r) -> bool
 
template<typename V , typename N >
auto operator>= (const ChemicalScalarBase< V, N > &l, double r) -> bool
 
template<typename V , typename N >
auto operator>= (double l, const ChemicalScalarBase< V, N > &r) -> bool
 
template<typename VL , typename NL , typename VR , typename NR >
auto operator== (const ChemicalScalarBase< VL, NL > &l, const ChemicalScalarBase< VR, NR > &r) -> bool
 
template<typename V , typename N >
auto operator== (const ChemicalScalarBase< V, N > &l, double r) -> bool
 
template<typename V , typename N >
auto operator== (double l, const ChemicalScalarBase< V, N > &r) -> bool
 
template<typename VL , typename NL , typename VR , typename NR >
auto operator!= (const ChemicalScalarBase< VL, NL > &l, const ChemicalScalarBase< VR, NR > &r) -> bool
 
template<typename V , typename N >
auto operator!= (const ChemicalScalarBase< V, N > &l, double r) -> bool
 
template<typename V , typename N >
auto operator!= (double l, const ChemicalScalarBase< V, N > &r) -> bool
 
auto operator<< (std::ostream &out, const ChemicalScalar &scalar) -> std::ostream &
 
template<typename V , typename N >
auto abs (const ChemicalScalarBase< V, N > &l) -> ChemicalScalarBase< double, decltype(double()*l.ddn)>
 
template<typename V , typename N >
auto sqrt (const ChemicalScalarBase< V, N > &l) -> ChemicalScalarBase< double, decltype(double()*l.ddn)>
 
template<typename V , typename N >
auto pow (const ChemicalScalarBase< V, N > &l, double power) -> ChemicalScalarBase< double, decltype(double()*l.ddn)>
 
template<typename V , typename N >
auto exp (const ChemicalScalarBase< V, N > &l) -> ChemicalScalarBase< double, decltype(double()*l.ddn)>
 
template<typename V , typename N >
auto log (const ChemicalScalarBase< V, N > &l) -> ChemicalScalarBase< double, decltype(double()*l.ddn)>
 
template<typename V , typename N >
auto log10 (const ChemicalScalarBase< V, N > &l) -> decltype(log(l)/1.0)
 
template<typename Derived >
auto composition (const Eigen::MatrixBase< Derived > &n) -> Composition< Derived >
 Return a Composition instance for a given MatrixBase instance.
 
template<typename V , typename T , typename P , typename N >
auto operator<< (std::ostream &out, const ChemicalVectorBase< V, T, P, N > &r) -> std::ostream &
 
template<typename V , typename T , typename P , typename N >
auto operator+ (const ChemicalVectorBase< V, T, P, N > &r) -> ChemicalVectorBase< V, T, P, N >
 
template<typename V , typename T , typename P , typename N >
auto operator- (const ChemicalVectorBase< V, T, P, N > &r) -> ChemicalVectorBase< decltype(-r.val), decltype(-r.ddT), decltype(-r.ddP), decltype(-r.ddn)>
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto operator+ (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> ChemicalVectorBase< decltype(l.val+r.val), decltype(l.ddT+r.ddT), decltype(l.ddP+r.ddP), decltype(l.ddn+r.ddn)>
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR >
auto operator+ (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> ChemicalVectorBase< decltype(l.val+r.val), decltype(l.ddT+r.ddT), decltype(l.ddP+r.ddP), decltype(l.ddn)>
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR , typename NR >
auto operator+ (const ThermoVectorBase< VL, TL, PL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> decltype(r+l)
 
template<typename VL , typename TL , typename PL , typename NL , typename VR >
auto operator+ (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ThermoScalarBase< VR > &r) -> ChemicalVectorBase< decltype(l.val+r.val *ones(l.size())), decltype(l.ddT+r.ddT *ones(l.size())), decltype(l.ddP+r.ddP *ones(l.size())), decltype(l.ddn)>
 
template<typename VL , typename VR , typename TR , typename PR , typename NR >
auto operator+ (const ThermoScalarBase< VL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> decltype(r+l)
 
template<typename V , typename T , typename P , typename N >
auto operator+ (const ChemicalVectorBase< V, T, P, N > &l, const Vector &r) -> ChemicalVectorBase< decltype(l.val+r), T, P, N >
 
template<typename V , typename T , typename P , typename N >
auto operator+ (const Vector &l, const ChemicalVectorBase< V, T, P, N > &r) -> decltype(r+l)
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto operator- (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> ChemicalVectorBase< decltype(l.val-r.val), decltype(l.ddT-r.ddT), decltype(l.ddP-r.ddP), decltype(l.ddn-r.ddn)>
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR >
auto operator- (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> ChemicalVectorBase< decltype(l.val-r.val), decltype(l.ddT-r.ddT), decltype(l.ddP-r.ddP), decltype(l.ddn)>
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR , typename NR >
auto operator- (const ThermoVectorBase< VL, TL, PL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> decltype(-(r-l))
 
template<typename VL , typename TL , typename PL , typename NL , typename VR >
auto operator- (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ThermoScalarBase< VR > &r) -> ChemicalVectorBase< decltype(l.val-r.val *ones(l.size())), decltype(l.ddT-r.ddT *ones(l.size())), decltype(l.ddP-r.ddP *ones(l.size())), decltype(l.ddn)>
 
template<typename VL , typename VR , typename TR , typename PR , typename NR >
auto operator- (const ThermoScalarBase< VL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> decltype(r+l)
 
template<typename V , typename T , typename P , typename N >
auto operator- (const ChemicalVectorBase< V, T, P, N > &l, const Vector &r) -> ChemicalVectorBase< decltype(l.val-r), T, P, N >
 
template<typename V , typename T , typename P , typename N >
auto operator- (const Vector &l, const ChemicalVectorBase< V, T, P, N > &r) -> decltype(-(r-l))
 
template<typename V , typename T , typename P , typename N >
auto operator* (double l, const ChemicalVectorBase< V, T, P, N > &r) -> ChemicalVectorBase< decltype(l *r.val), decltype(l *r.ddT), decltype(l *r.ddP), decltype(l *r.ddn)>
 
template<typename V , typename T , typename P , typename N >
auto operator* (const ChemicalVectorBase< V, T, P, N > &l, double r) -> decltype(r *l)
 
template<typename VL , typename VR , typename T , typename P , typename N >
auto operator* (const ThermoScalarBase< VL > &l, const ChemicalVectorBase< VR, T, P, N > &r) -> ChemicalVectorBase< decltype(l.val *r.val), decltype(l.val *r.ddT+l.ddT *r.val), decltype(l.val *r.ddP+l.ddP *r.val), decltype(l.val *r.ddn)>
 
template<typename VL , typename VR , typename T , typename P , typename N >
auto operator* (const ChemicalVectorBase< VL, T, P, N > &l, const ThermoScalarBase< VR > &r) -> decltype(r *l)
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename NR >
auto operator* (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalScalarBase< VR, NR > &r) -> ChemicalVectorBase< decltype(l.val *r.val), decltype(l.val *r.ddT+l.ddT *r.val), decltype(l.val *r.ddP+l.ddP *r.val), decltype(l.val *tr(r.ddn)+l.ddn *r.val)>
 
template<typename VL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto operator* (const ChemicalScalarBase< VL, NL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> decltype(r *l)
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto operator% (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> ChemicalVectorBase< decltype(diag(l.val)*r.val), decltype(diag(l.val)*r.ddT+diag(r.val)*l.ddT), decltype(diag(l.val)*r.ddP+diag(r.val)*l.ddP), decltype(diag(l.val)*r.ddn+diag(r.val)*l.ddn)>
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR , typename NR >
auto operator% (const ThermoVectorBase< VL, TL, PL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> ChemicalVectorBase< decltype(diag(l.val)*r.val), decltype(diag(l.val)*r.ddT+diag(r.val)*l.ddT), decltype(diag(l.val)*r.ddP+diag(r.val)*l.ddP), decltype(diag(l.val)*r.ddn)>
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR >
auto operator% (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> decltype(r%l)
 
template<typename V , typename T , typename P , typename N >
auto operator% (const Vector &l, const ChemicalVectorBase< V, T, P, N > &r) -> ChemicalVectorBase< decltype(diag(l)*r.val), decltype(diag(l)*r.ddT), decltype(diag(l)*r.ddP), decltype(diag(l)*r.ddn)>
 
template<typename VL , typename TL , typename PL , typename NL >
auto operator% (const ChemicalVectorBase< VL, TL, PL, NL > &l, const Vector &r) -> decltype(r%l)
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto operator/ (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> ChemicalVector
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto operator/ (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> ChemicalVector
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename NR >
auto operator/ (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalScalarBase< VR, NR > &r) -> ChemicalVector
 
template<typename VL , typename VR , typename T , typename P , typename N >
auto operator/ (const ChemicalVectorBase< VL, T, P, N > &l, const ThermoScalarBase< VR > &r) -> ChemicalVectorBase< decltype(l.val/r.val), decltype(double()*(l.ddT *r.val-l.val *r.ddT)), decltype(double()*(l.ddP *r.val-l.val *r.ddP)), decltype(double()*(l.ddn *r.val))>
 
template<typename V , typename T , typename P , typename N >
auto operator/ (const ChemicalVectorBase< V, T, P, N > &l, double r) -> decltype((1.0/r)*l)
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto operator< (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> bool
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto operator<= (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> bool
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto operator> (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> bool
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto operator>= (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> bool
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto operator== (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> bool
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto operator!= (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> bool
 
template<typename V , typename T , typename P , typename N >
auto row (ChemicalVectorBase< V, T, P, N > &vec, Index irow) -> ChemicalScalarBase< double &, decltype(tr(vec.ddn.row(irow)))>
 Return a ChemicalScalarBase with reference to the chemical scalar in a given row.
 
template<typename V , typename T , typename P , typename N >
auto row (const ChemicalVectorBase< V, T, P, N > &vec, Index irow) -> ChemicalScalarBase< const double &, decltype(tr(vec.ddn.row(irow)))>
 Return a ChemicalScalarBase with const reference to the chemical scalar in a given row.
 
template<typename V , typename T , typename P , typename N >
auto row (ChemicalVectorBase< V, T, P, N > &vec, Index irow, Index icol, Index ncols) -> ChemicalScalarBase< double &, decltype(vec.ddn.row(irow).segment(icol, ncols))>
 Return a reference of a row of this ChemicalVectorBase instance.
 
template<typename V , typename T , typename P , typename N >
auto row (const ChemicalVectorBase< V, T, P, N > &vec, Index irow, Index icol, Index ncols) -> ChemicalScalarBase< const double &, decltype(vec.ddn.row(irow).segment(icol, ncols))>
 Return a const reference of a row of this ChemicalVectorBase instance.
 
template<typename Derived >
auto row (Eigen::MatrixBase< Derived > &vec, Index irow, Index icol, Index ncols) -> decltype(vec.row(irow))
 Return a reference of a row of this Eigen::MatrixBase instance.
 
template<typename Derived >
auto row (const Eigen::MatrixBase< Derived > &vec, Index irow, Index icol, Index ncols) -> decltype(vec.row(irow))
 Return a const reference of a row of this Eigen::MatrixBase instance.
 
template<typename V , typename T , typename P , typename N >
auto rows (ChemicalVectorBase< V, T, P, N > &vec, Index irow, Index nrows) -> ChemicalVectorBase< decltype(rows(vec.val, irow, nrows)), decltype(rows(vec.ddT, irow, nrows)), decltype(rows(vec.ddP, irow, nrows)), decltype(rows(vec.ddn, irow, nrows))>
 Return a reference of a sequence of rows of this ChemicalVectorBase instance.
 
template<typename V , typename T , typename P , typename N >
auto rows (const ChemicalVectorBase< V, T, P, N > &vec, Index irow, Index nrows) -> ChemicalVectorBase< decltype(rows(vec.val, irow, nrows)), decltype(rows(vec.ddT, irow, nrows)), decltype(rows(vec.ddP, irow, nrows)), decltype(rows(vec.ddn, irow, nrows))>
 Return a const reference of a sequence of rows of this ChemicalVectorBase instance.
 
template<typename V , typename T , typename P , typename N >
auto rows (ChemicalVectorBase< V, T, P, N > &vec, Index irow, Index icol, Index nrows, Index ncols) -> ChemicalVectorBase< decltype(rows(vec.val, irow, nrows)), decltype(rows(vec.ddT, irow, nrows)), decltype(rows(vec.ddP, irow, nrows)), decltype(block(vec.ddn, irow, icol, nrows, ncols))>
 Return a reference of a sequence of rows of this ChemicalVectorBase instance.
 
template<typename V , typename T , typename P , typename N >
auto rows (const ChemicalVectorBase< V, T, P, N > &vec, Index irow, Index icol, Index nrows, Index ncols) -> ChemicalVectorBase< decltype(rows(vec.val, irow, nrows)), decltype(rows(vec.ddT, irow, nrows)), decltype(rows(vec.ddP, irow, nrows)), decltype(block(vec.ddn, irow, icol, nrows, ncols))>
 Return a const reference of a sequence of rows of this ChemicalVectorBase instance.
 
template<typename Derived >
auto rows (Eigen::MatrixBase< Derived > &mat, Index irow, Index icol, Index nrows, Index ncols) -> decltype(mat.middleRows(irow, nrows))
 
template<typename Derived >
auto rows (const Eigen::MatrixBase< Derived > &mat, Index irow, Index icol, Index nrows, Index ncols) -> decltype(mat.middleRows(irow, nrows))
 
template<typename V , typename T , typename P , typename N >
auto rows (ChemicalVectorBase< V, T, P, N > &vec, const Indices &irows) -> ChemicalVector
 Return a reference of some rows of this ChemicalVectorBase instance.
 
template<typename V , typename T , typename P , typename N >
auto rows (const ChemicalVectorBase< V, T, P, N > &vec, const Indices &irows) -> ChemicalVector
 Return a const reference of some rows of this ChemicalVectorBase instance.
 
template<typename V , typename T , typename P , typename N >
auto rows (ChemicalVectorBase< V, T, P, N > &vec, const Indices &irows, const Indices &icols) -> ChemicalVector
 Return a reference of some rows and cols of this ChemicalVectorBase instance.
 
template<typename V , typename T , typename P , typename N >
auto rows (const ChemicalVectorBase< V, T, P, N > &vec, const Indices &irows, const Indices &icols) -> ChemicalVector
 Return a const reference of some rows and cols of this ChemicalVectorBase instance.
 
template<typename V , typename T , typename P , typename N >
auto abs (const ChemicalVectorBase< V, T, P, N > &l) -> ChemicalVector
 
template<typename V , typename T , typename P , typename N >
auto sqrt (const ChemicalVectorBase< V, T, P, N > &l) -> ChemicalVector
 
template<typename V , typename T , typename P , typename N >
auto pow (const ChemicalVectorBase< V, T, P, N > &l, double power) -> ChemicalVector
 
template<typename V , typename T , typename P , typename N >
auto exp (const ChemicalVectorBase< V, T, P, N > &l) -> ChemicalVector
 
template<typename V , typename T , typename P , typename N >
auto log (const ChemicalVectorBase< V, T, P, N > &l) -> ChemicalVector
 
template<typename V , typename T , typename P , typename N >
auto log10 (const ChemicalVectorBase< V, T, P, N > &l) -> decltype(log(l)/double())
 
template<typename V , typename T , typename P , typename N >
auto min (const ChemicalVectorBase< V, T, P, N > &r) -> double
 
template<typename V , typename T , typename P , typename N >
auto max (const ChemicalVectorBase< V, T, P, N > &r) -> double
 
template<typename V , typename T , typename P , typename N >
auto sum (const ChemicalVectorBase< V, T, P, N > &r) -> ChemicalScalarBase< double, decltype(tr(r.ddn).rowwise().sum())>
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto dot (const ChemicalVectorBase< VL, TL, PL, NL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> ChemicalScalarBase< double, decltype(tr(l.val)*tr(r.ddn)+tr(r.val)*tr(l.ddn))>
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto dot (const ThermoVectorBase< VL, TL, PL > &l, const ChemicalVectorBase< VR, TR, PR, NR > &r) -> ChemicalScalarBase< double, decltype(tr(l.val)*tr(r.ddn))>
 
template<typename VL , typename TL , typename PL , typename NL , typename VR , typename TR , typename PR , typename NR >
auto dot (const ChemicalVectorBase< VR, TR, PR, NR > &l, const ThermoVectorBase< VL, TL, PL > &r) -> decltype(dot(r, l))
 
template<typename V , typename T , typename P , typename N >
auto dot (const Vector &l, const ChemicalVectorBase< V, T, P, N > &r) -> ChemicalScalarBase< double, decltype(tr(l)*tr(r.ddn))>
 
template<typename V , typename T , typename P , typename N >
auto dot (const ChemicalVectorBase< V, T, P, N > &l, const Vector &r) -> decltype(dot(r, l))
 
template<typename Scalar >
auto convertCelsiusToKelvin (Scalar T) -> decltype(T+273.15)
 Converts temperature from celsius to kelvin.
 
template<typename Scalar >
auto convertKelvinToCelsius (Scalar T) -> decltype(T-273.15)
 Converts temperature from kelvin to celsius.
 
template<typename Scalar >
auto convertPascalToKiloPascal (Scalar P) -> decltype(P *1.0e-3)
 Converts pressure from pascal to kilo pascal.
 
template<typename Scalar >
auto convertPascalToMegaPascal (Scalar P) -> decltype(P *1.0e-6)
 Converts pressure from pascal to mega pascal.
 
template<typename Scalar >
auto convertPascalToBar (Scalar P) -> decltype(P *1.0e-5)
 Converts pressure from pascal to bar.
 
template<typename Scalar >
auto convertKiloPascalToPascal (Scalar P) -> decltype(P *1.0e+3)
 Converts pressure from kilo pascal to pascal.
 
template<typename Scalar >
auto convertKiloPascalToMegaPascal (Scalar P) -> decltype(P *1.0e-3)
 Converts pressure from kilo pascal to mega pascal.
 
template<typename Scalar >
auto convertKiloPascalToBar (Scalar P) -> decltype(P *1.0e-2)
 Converts pressure from kilo pascal to bar.
 
template<typename Scalar >
auto convertMegaPascalToPascal (Scalar P) -> decltype(P *1.0e+6)
 Converts pressure from mega pascal to pascal.
 
template<typename Scalar >
auto convertMegaPascalToKiloPascal (Scalar P) -> decltype(P *1.0e+3)
 Converts pressure from mega pascal to kilo pascal.
 
template<typename Scalar >
auto convertMegaPascalToBar (Scalar P) -> decltype(P *1.0e+1)
 Converts pressure from mega pascal to bar.
 
template<typename Scalar >
auto convertBarToPascal (Scalar P) -> decltype(P *1.0e+5)
 Converts pressure from bar to pascal.
 
template<typename Scalar >
auto convertBarToKiloPascal (Scalar P) -> decltype(P *1.0e+2)
 Converts pressure from bar to kilo pascal.
 
template<typename Scalar >
auto convertBarToMegaPascal (Scalar P) -> decltype(P *1.0e-1)
 Converts pressure from bar to mega pascal.
 
template<typename Scalar >
auto convertBarToAtm (Scalar P) -> decltype(P *0.986923267)
 Convert pressure from bar to atm.
 
template<typename Scalar >
auto convertCubicCentimeterToCubicMeter (Scalar V) -> decltype(V *1.0e-6)
 Converts volume from cm3 to m3.
 
template<typename Scalar >
auto convertCubicMeterToCubicCentimeter (Scalar V) -> decltype(V *1.0e+6)
 Converts volume from m3 to cm3.
 
template<typename Scalar >
auto convertCubicMeterToLiter (Scalar V) -> decltype(V *1.0e+3)
 Converts volume from m3 to liter.
 
template<typename Scalar >
auto convertLiterToCubicMeter (Scalar V) -> decltype(V *1.0e-3)
 Converts volume from liter to m3.
 
auto elements () -> std::vector< std::string >
 Return a vector of all known 116 chemical elements.
 
auto elements (std::string formula) -> std::map< std::string, double >
 Determine. More...
 
auto atomicMass (std::string element) -> double
 Return the atomic mass of a chemical element (in units of kg/mol). More...
 
auto molarMass (const std::map< std::string, double > &compound) -> double
 Calculate the molar mass of a chemical compound (in units of kg/mol). More...
 
auto molarMass (std::string formula) -> double
 Calculate the molar mass of a chemical compound (in units of kg/mol). More...
 
auto charge (const std::string &formula) -> double
 Extract the electrical charge of a chemical formula. More...
 
auto interpolate (const std::vector< double > &temperatures, const std::vector< double > &pressures, const std::vector< ThermoScalar > &scalars) -> ThermoScalarFunction
 
auto interpolate (const std::vector< double > &temperatures, const std::vector< double > &pressures, const ThermoScalarFunction &f) -> ThermoScalarFunction
 
auto interpolate (const std::vector< double > &temperatures, const std::vector< double > &pressures, const std::vector< ThermoScalarFunction > &fs) -> ThermoVectorFunction
 
auto alternativeWaterNames () -> std::vector< std::string > &
 Return a collection of alternative names to the given species name. More...
 
auto alternativeChargedSpeciesNames (std::string name) -> std::vector< std::string > &
 Return a collection of alternative names to the given charged species name. More...
 
auto alternativeNeutralSpeciesNames (std::string name) -> std::vector< std::string > &
 Return a collection of alternative names to the given neutral species name. More...
 
auto conventionalWaterName () -> std::string
 Return the conventional water name, which is H2O(l).
 
auto conventionalChargedSpeciesName (std::string name) -> std::string
 Return the conventional charged species name adopted in Reaktoro. More...
 
auto conventionalNeutralSpeciesName (std::string name) -> std::string
 Return the conventional neutral species name adopted in Reaktoro. More...
 
auto isAlternativeWaterName (std::string trial) -> bool
 Return true if a trial name is an alternative to a water species name. More...
 
auto isAlternativeChargedSpeciesName (std::string trial, std::string name) -> bool
 Return true if a trial name is an alternative to a given charged species name. More...
 
auto isAlternativeNeutralSpeciesName (std::string trial, std::string name) -> bool
 Return true if a trial name is an alternative to a given neutral species name. More...
 
auto splitChargedSpeciesName (std::string name) -> std::pair< std::string, double >
 Return a pair with the base name of a charged species and its electrical charge. More...
 
auto baseNameChargedSpecies (std::string name) -> std::string
 Return the name of a charged species without charge suffix. More...
 
auto baseNameNeutralSpecies (std::string name) -> std::string
 Return the name of a neutral species without suffix (aq). More...
 
auto chargeInSpeciesName (std::string name) -> double
 Return the electrical charge in a species name. More...
 
template<typename Ret , typename... Args>
auto memoize (std::function< Ret(Args...)> f) -> std::function< Ret(Args...)>
 
template<typename Ret , typename... Args>
auto memoizeLast (std::function< Ret(Args...)> f) -> std::function< Ret(Args...)>
 
template<typename Ret , typename... Args>
auto memoizeLastPtr (std::function< Ret(Args...)> f) -> std::shared_ptr< std::function< Ret(Args...)>>
 
template<typename Ret , typename... Args>
auto dereference (const std::shared_ptr< std::function< Ret(Args...)>> &f) -> std::function< Ret(Args...)>
 
auto parseReaction (std::string equation) -> std::map< std::string, double >
 Parse a reaction equation.
 
auto operator<< (std::ostream &out, const ReactionEquation &equation) -> std::ostream &
 Output a ReactionEquation instance.
 
auto begin (const Reaktoro::ReactionEquation &equation) -> decltype(equation.equation().begin())
 Return begin const iterator of a ReactionEquation instance.
 
auto begin (Reaktoro::ReactionEquation &equation) -> decltype(equation.equation().begin())
 Return begin iterator of a ReactionEquation instance.
 
auto end (const Reaktoro::ReactionEquation &equation) -> decltype(equation.equation().end())
 Return end const iterator of a ReactionEquation instance.
 
auto end (Reaktoro::ReactionEquation &equation) -> decltype(equation.equation().end())
 Return end iterator of a ReactionEquation instance.
 
template<typename T >
auto index (const T &value, const std::vector< T > &values) -> Index
 Find the index of a value in a container of values.
 
auto index (const std::string &word, const std::vector< std::string > &strings) -> Index
 Find the index of the word in the container of strings.
 
template<typename NamedValues >
auto index (const std::string &name, const NamedValues &values) -> Index
 Return the index of an entry in a container.
 
template<typename NamedValue , typename NamedValues >
auto index (const NamedValue &value, const NamedValues &values) -> Index
 Return the index of an entry in a container.
 
template<typename Names , typename NamedValues >
auto indexAny (const Names &names, const NamedValues &values) -> Index
 Return the index of the first entry in a container of named values with any of the given names.
 
template<typename NamedValues >
auto indices (const std::vector< std::string > &names, const NamedValues &values) -> Indices
 Return the indices of some entries in a container.
 
template<typename NamedValues >
auto indices (const NamedValues &subvalues, const NamedValues &values) -> Indices
 Return the indices of some entries in a container.
 
auto indices (const std::vector< std::string > &words, const std::vector< std::string > &strings) -> Indices
 Find the indices of the words in the container of strings
 
template<typename Container >
auto contained (const typename Container::value_type &value, const Container &values) -> bool
 Check if a value is contained in a container of values.
 
template<typename Container >
auto contained (const Container &values1, const Container &values2) -> bool
 Check if a container of values is contained in another.
 
template<typename NamedValues >
auto contained (const std::string &name, const NamedValues &values) -> bool
 Return true if a named value is in a set of values.
 
template<typename T >
auto unify (const std::vector< T > &values1, const std::vector< T > &values2) -> std::vector< T >
 Determine the union of two containers.
 
template<typename T >
auto intersect (const std::vector< T > &values1, const std::vector< T > &values2) -> std::vector< T >
 Determine the intersection of two containers.
 
template<typename T >
auto difference (const std::vector< T > &values1, const std::vector< T > &values2) -> std::vector< T >
 Determine the difference of two containers.
 
template<typename T >
auto emptyIntersection (const std::vector< T > &values1, const std::vector< T > &values2) -> bool
 Check if two containers have empty intersection.
 
template<typename T >
auto emptyDifference (const std::vector< T > &values1, const std::vector< T > &values2) -> bool
 Check if two containers have empty difference.
 
template<typename Container >
auto equal (const Container &values1, const Container &values2) -> bool
 Check if two containers are equal.
 
template<typename Container >
auto isunique (Container values) -> bool
 Check if a container has unique values.
 
template<typename T >
auto unique (std::vector< T > values) -> std::vector< T >
 Create a container with unique values from another.
 
template<typename T >
auto range (T first, T last, T step) -> std::vector< T >
 Return a range of values. More...
 
template<typename T >
auto range (T first, T last) -> std::vector< T >
 Return a range of values with unit step. More...
 
template<typename T >
auto range (T last) -> std::vector< T >
 Return a range of values starting from zero and increasing by one. More...
 
template<typename T , typename Predicate >
auto filter (const std::vector< T > &values, Predicate predicate) -> std::vector< T >
 Filter the values that pass on the predicate.
 
template<typename T , typename Predicate >
auto remove (const std::vector< T > &values, Predicate predicate) -> std::vector< T >
 Remove the values that pass on the predicate.
 
template<typename T >
auto extract (const std::vector< T > &values, const Indices &indices) -> std::vector< T >
 Extract values from a vector given a list of indices. More...
 
template<typename Container >
auto min (const Container &values) -> typename Container::value_type
 Return the minimum value in a STL compatible container.
 
template<typename Container >
auto max (const Container &values) -> typename Container::value_type
 Return the maximum value in a STL compatible container.
 
auto begin (const StringList &strings) -> decltype(strings.strings().begin())
 Return begin const iterator of a StringList instance.
 
auto begin (StringList &strings) -> decltype(strings.strings().begin())
 Return begin iterator of a StringList instance.
 
auto end (const StringList &strings) -> decltype(strings.strings().end())
 Return end const iterator of a StringList instance.
 
auto end (StringList &strings) -> decltype(strings.strings().end())
 Return end iterator of a StringList instance.
 
auto lowercase (std::string str) -> std::string
 Return a string with lower case characters.
 
auto uppercase (std::string str) -> std::string
 Return a string with upper case characters.
 
auto leftTrim (std::string &str) -> std::string &
 Trim the string from start (taken from http://stackoverflow.com/questions/216823/whats-the-best-way-to-trim-stdstring)
 
auto rightTrim (std::string &str) -> std::string &
 Trim the string from end (taken from http://stackoverflow.com/questions/216823/whats-the-best-way-to-trim-stdstring)
 
auto trim (std::string &str) -> std::string &
 Trim the string from both ends (taken from http://stackoverflow.com/questions/216823/whats-the-best-way-to-trim-stdstring)
 
auto split (const std::string &str, const std::string &delims, std::function< std::string &(std::string &)> transform) -> std::vector< std::string >
 Split the string on every occurrence of the specified delimiters.
 
auto split (const std::string &str, const std::string &delims=" ") -> std::vector< std::string >
 Split the string on every occurrence of the specified delimiters.
 
auto splitrim (const std::string &str, const std::string &delims=" ") -> std::vector< std::string >
 Split the string on every occurrence of the specified delimiters and trim each word.
 
auto join (const std::vector< std::string > &strs, std::string delim=" ") -> std::string
 Join several strings into one.
 
auto tofloat (const std::string &str) -> double
 Convert the string into a floating point number.
 
auto tofloats (const std::string &str, const std::string &delims=" ") -> std::vector< double >
 Convert the string into a list of floating point numbers.
 
template<typename T >
auto table1D (unsigned dim1) -> Table1D< T >
 
template<typename T >
auto table2D (unsigned dim1, unsigned dim2) -> Table2D< T >
 
template<typename T >
auto table3D (unsigned dim1, unsigned dim2, unsigned dim3) -> Table3D< T >
 
template<typename V >
auto operator+ (const ThermoScalarBase< V > &l) -> ThermoScalarBase< double >
 
template<typename VL , typename VR >
auto operator+ (const ThermoScalarBase< VL > &l, const ThermoScalarBase< VR > &r) -> ThermoScalarBase< double >
 
template<typename V >
auto operator+ (double l, const ThermoScalarBase< V > &r) -> ThermoScalarBase< double >
 
template<typename V >
auto operator+ (const ThermoScalarBase< V > &l, double r) -> ThermoScalarBase< double >
 
template<typename V >
auto operator- (const ThermoScalarBase< V > &l) -> ThermoScalarBase< double >
 
template<typename VL , typename VR >
auto operator- (const ThermoScalarBase< VL > &l, const ThermoScalarBase< VR > &r) -> ThermoScalarBase< double >
 
template<typename V >
auto operator- (const ThermoScalarBase< V > &l, double r) -> ThermoScalarBase< double >
 
template<typename V >
auto operator- (double l, const ThermoScalarBase< V > &r) -> ThermoScalarBase< double >
 
template<typename VL , typename VR >
auto operator* (const ThermoScalarBase< VL > &l, const ThermoScalarBase< VR > &r) -> ThermoScalarBase< double >
 
template<typename V >
auto operator* (double l, const ThermoScalarBase< V > &r) -> ThermoScalarBase< double >
 
template<typename V >
auto operator* (const ThermoScalarBase< V > &l, double r) -> ThermoScalarBase< double >
 
template<typename VL , typename VR >
auto operator/ (const ThermoScalarBase< VL > &l, const ThermoScalarBase< VR > &r) -> ThermoScalarBase< double >
 
template<typename V >
auto operator/ (double l, const ThermoScalarBase< V > &r) -> ThermoScalarBase< double >
 
template<typename V >
auto operator/ (const ThermoScalarBase< V > &l, double r) -> ThermoScalarBase< double >
 
template<typename VL , typename VR >
auto operator< (const ThermoScalarBase< VL > &l, const ThermoScalarBase< VR > &r) -> bool
 
template<typename VL , typename VR >
auto operator<= (const ThermoScalarBase< VL > &l, const ThermoScalarBase< VR > &r) -> bool
 
template<typename VL , typename VR >
auto operator> (const ThermoScalarBase< VL > &l, const ThermoScalarBase< VR > &r) -> bool
 
template<typename VL , typename VR >
auto operator>= (const ThermoScalarBase< VL > &l, const ThermoScalarBase< VR > &r) -> bool
 
template<typename VL , typename VR >
auto operator== (const ThermoScalarBase< VL > &l, const ThermoScalarBase< VR > &r) -> bool
 
template<typename VL , typename VR >
auto operator!= (const ThermoScalarBase< VL > &l, const ThermoScalarBase< VR > &r) -> bool
 
template<typename V >
auto operator< (double l, const ThermoScalarBase< V > &r) -> bool
 
template<typename V >
auto operator< (const ThermoScalarBase< V > &l, double r) -> bool
 
template<typename V >
auto operator<= (double l, const ThermoScalarBase< V > &r) -> bool
 
template<typename V >
auto operator<= (const ThermoScalarBase< V > &l, double r) -> bool
 
template<typename V >
auto operator> (double l, const ThermoScalarBase< V > &r) -> bool
 
template<typename V >
auto operator> (const ThermoScalarBase< V > &l, double r) -> bool
 
template<typename V >
auto operator>= (double l, const ThermoScalarBase< V > &r) -> bool
 
template<typename V >
auto operator>= (const ThermoScalarBase< V > &l, double r) -> bool
 
template<typename V >
auto operator== (double l, const ThermoScalarBase< V > &r) -> bool
 
template<typename V >
auto operator== (const ThermoScalarBase< V > &l, double r) -> bool
 
template<typename V >
auto operator!= (double l, const ThermoScalarBase< V > &r) -> bool
 
template<typename V >
auto operator!= (const ThermoScalarBase< V > &l, double r) -> bool
 
template<typename V >
auto operator<< (std::ostream &out, const ThermoScalarBase< V > &scalar) -> std::ostream &
 
template<typename V >
auto abs (const ThermoScalarBase< V > &l) -> ThermoScalarBase< double >
 
template<typename V >
auto sqrt (const ThermoScalarBase< V > &l) -> ThermoScalarBase< double >
 
template<typename V >
auto pow (const ThermoScalarBase< V > &l, double power) -> ThermoScalarBase< double >
 
template<typename VL , typename VR >
auto pow (const ThermoScalarBase< VL > &l, const ThermoScalarBase< VR > &power) -> ThermoScalarBase< double >
 
template<typename V >
auto exp (const ThermoScalarBase< V > &l) -> ThermoScalarBase< double >
 
template<typename V >
auto log (const ThermoScalarBase< V > &l) -> ThermoScalarBase< double >
 
template<typename V >
auto log10 (const ThermoScalarBase< V > &l) -> ThermoScalarBase< double >
 
template<typename V , typename T , typename P >
auto operator<< (std::ostream &out, const ThermoVectorBase< V, T, P > &a) -> std::ostream &
 
template<typename V , typename T , typename P >
auto operator+ (const ThermoVectorBase< V, T, P > &l) -> ThermoVectorBase< V, T, P >
 
template<typename V , typename T , typename P >
auto operator- (const ThermoVectorBase< V, T, P > &l) -> ThermoVectorBase< decltype(-l.val), decltype(-l.ddT), decltype(-l.ddP)>
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR >
auto operator+ (const ThermoVectorBase< VL, TL, PL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> ThermoVectorBase< decltype(l.val+r.val), decltype(l.ddT+r.ddT), decltype(l.ddP+r.ddP)>
 
template<typename V , typename T , typename P >
auto operator+ (const ThermoVectorBase< V, T, P > &l, const Vector &r) -> ThermoVectorBase< decltype(l.val+r), T, P >
 
template<typename V , typename T , typename P >
auto operator+ (const Vector &l, const ThermoVectorBase< V, T, P > &r) -> decltype(r+l)
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR >
auto operator- (const ThermoVectorBase< VL, TL, PL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> ThermoVectorBase< decltype(l.val-r.val), decltype(l.ddT-r.ddT), decltype(l.ddP-r.ddP)>
 
template<typename V , typename T , typename P >
auto operator- (const ThermoVectorBase< V, T, P > &l, const Vector &r) -> ThermoVectorBase< decltype(l.val-r), T, P >
 
template<typename V , typename T , typename P >
auto operator- (const Vector &l, const ThermoVectorBase< V, T, P > &r) -> decltype(-(r-l))
 
template<typename V , typename T , typename P >
auto operator* (double l, const ThermoVectorBase< V, T, P > &r) -> ThermoVectorBase< decltype(l *r.val), decltype(l *r.ddT), decltype(l *r.ddP)>
 
template<typename V , typename T , typename P >
auto operator* (const ThermoVectorBase< V, T, P > &l, double r) -> decltype(r *l)
 
template<typename VL , typename V , typename T , typename P >
auto operator* (const ThermoScalarBase< VL > &l, const ThermoVectorBase< V, T, P > &r) -> ThermoVectorBase< decltype(l.val *r.val), decltype(l.val *r.ddT+l.ddT *r.val), decltype(l.val *r.ddP+l.ddP *r.val)>
 
template<typename V , typename T , typename P , typename VR >
auto operator* (const ThermoVectorBase< V, T, P > &l, const ThermoScalarBase< VR > &r) -> decltype(r *l)
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR >
auto operator% (const ThermoVectorBase< VL, TL, PL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> ThermoVectorBase< decltype(diag(l.val)*r.val), decltype(diag(l.val)*r.ddT+diag(r.val)*l.ddT), decltype(diag(l.val)*r.ddP+diag(r.val)*l.ddP)>
 
template<typename V , typename T , typename P >
auto operator% (const Vector &l, const ThermoVectorBase< V, T, P > &r) -> ThermoVectorBase< decltype(diag(l)*r.val), decltype(diag(l)*r.ddT), decltype(diag(l)*r.ddP)>
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR >
auto operator% (const ThermoVectorBase< VL, TL, PL > &l, const Vector &r) -> decltype(r%l)
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR >
auto operator/ (const ThermoVectorBase< VL, TL, PL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> ThermoVector
 
template<typename V , typename T , typename P , typename VR >
auto operator/ (const ThermoVectorBase< V, T, P > &l, const ThermoScalarBase< VR > &r) -> ThermoVectorBase< decltype(l.val/r.val), decltype(double()*(l.ddT *r.val-l.val *r.ddT)), decltype(double()*(l.ddP *r.val-l.val *r.ddP))>
 
template<typename V , typename T , typename P >
auto operator/ (const ThermoVectorBase< V, T, P > &l, double r) -> decltype((1.0/r)*l)
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR >
auto operator< (const ThermoVectorBase< VL, TL, PL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> bool
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR >
auto operator<= (const ThermoVectorBase< VL, TL, PL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> bool
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR >
auto operator> (const ThermoVectorBase< VL, TL, PL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> bool
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR >
auto operator>= (const ThermoVectorBase< VL, TL, PL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> bool
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR >
auto operator== (const ThermoVectorBase< VL, TL, PL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> bool
 
template<typename VL , typename TL , typename PL , typename VR , typename TR , typename PR >
auto operator!= (const ThermoVectorBase< VL, TL, PL > &l, const ThermoVectorBase< VR, TR, PR > &r) -> bool
 
template<typename V , typename T , typename P >
auto row (ThermoVectorBase< V, T, P > &vec, Index irow) -> ThermoScalarBase< double & >
 Return a reference of a row of this ThermoVectorBase instance.
 
template<typename V , typename T , typename P >
auto row (const ThermoVectorBase< V, T, P > &vec, Index irow) -> ThermoScalarBase< const double & >
 Return a const reference of a row of this ThermoVectorBase instance.
 
template<typename V , typename T , typename P >
auto rows (ThermoVectorBase< V, T, P > &vec, Index irow, Index nrows) -> ThermoVectorBase< decltype(vec.val.segment(irow, nrows)), decltype(vec.ddT.segment(irow, nrows)), decltype(vec.ddP.segment(irow, nrows))>
 Return a reference of a sequence of rows of this ThermoVectorBase instance.
 
template<typename V , typename T , typename P >
auto rows (const ThermoVectorBase< V, T, P > &vec, Index irow, Index nrows) -> ThermoVectorBase< decltype(vec.val.segment(irow, nrows)), decltype(vec.ddT.segment(irow, nrows)), decltype(vec.ddP.segment(irow, nrows))>
 Return a const reference of a sequence of rows of this ThermoVectorBase instance.
 
template<typename V , typename T , typename P >
auto rows (ThermoVectorBase< V, T, P > &vec, const Indices &irows) -> ThermoVectorBase< decltype(Reaktoro::rows(vec.val, irows)), decltype(Reaktoro::rows(vec.ddT, irows)), decltype(Reaktoro::rows(vec.ddP, irows))>
 Return a reference of some rows of this ThermoVectorBase instance.
 
template<typename V , typename T , typename P >
auto rows (const ThermoVectorBase< V, T, P > &vec, const Indices &irows) -> ThermoVectorBase< decltype(Reaktoro::rows(vec.val, irows)), decltype(Reaktoro::rows(vec.ddT, irows)), decltype(Reaktoro::rows(vec.ddP, irows))>
 Return a const reference of some rows of this ThermoVectorBase instance.
 
template<typename V , typename T , typename P >
auto abs (const ThermoVectorBase< V, T, P > &l) -> ThermoVector
 
template<typename V , typename T , typename P >
auto sqrt (const ThermoVectorBase< V, T, P > &l) -> ThermoVector
 
template<typename V , typename T , typename P >
auto pow (const ThermoVectorBase< V, T, P > &l, double power) -> ThermoVector
 
template<typename V , typename T , typename P >
auto exp (const ThermoVectorBase< V, T, P > &l) -> ThermoVector
 
template<typename V , typename T , typename P >
auto log (const ThermoVectorBase< V, T, P > &l) -> ThermoVector
 
template<typename V , typename T , typename P >
auto log10 (const ThermoVectorBase< V, T, P > &l) -> ThermoVector
 
auto time () -> Time
 Return the time point now. More...
 
auto elapsed (const Time &end, const Time &begin) -> double
 Return the elapsed time between two time points (in units of s) More...
 
auto elapsed (const Time &begin) -> double
 Return the elapsed time between a time point and now (in units of s) More...
 
auto operator<< (std::ostream &out, const ChemicalState &state) -> std::ostream &
 Outputs a ChemicalState instance.
 
auto operator+ (const ChemicalState &l, const ChemicalState &r) -> ChemicalState
 Add two ChemicalState instances.
 
auto operator* (double scalar, const ChemicalState &state) -> ChemicalState
 Multiply a ChemicalState instance by a scalar (from the left).
 
auto operator* (const ChemicalState &state, double scalar) -> ChemicalState
 Multiply a ChemicalState instance by a scalar (from the right).
 
auto operator<< (std::ostream &out, const ChemicalSystem &system) -> std::ostream &
 Output a ChemicalSystem instance.
 
auto operator< (const Element &lhs, const Element &rhs) -> bool
 Compare two Element instances for less than.
 
auto operator== (const Element &lhs, const Element &rhs) -> bool
 Compare two Element instances for equality.
 
auto operator< (const Phase &lhs, const Phase &rhs) -> bool
 Compare two Phase instances for less than.
 
auto operator== (const Phase &lhs, const Phase &rhs) -> bool
 Compare two Phase instances for equality.
 
auto operator< (const Reaction &lhs, const Reaction &rhs) -> bool
 Compare two Reaction instances for less than.
 
auto operator== (const Reaction &lhs, const Reaction &rhs) -> bool
 Compare two Reaction instances for equality.
 
auto operator<< (std::ostream &out, const ReactionSystem &reactions) -> std::ostream &
 
auto operator< (const Species &lhs, const Species &rhs) -> bool
 Compare two Species instances for less than.
 
auto operator== (const Species &lhs, const Species &rhs) -> bool
 Compare two Species instances for equality.
 
template<typename NamedValues >
auto names (const NamedValues &values) -> std::vector< std::string >
 Return the names of the entries in a container.
 
template<typename ChargedValues >
auto charges (const ChargedValues &values) -> Vector
 Return the electrical charges of all species in a list of species.
 
template<typename SpeciesValues >
auto molarMasses (const SpeciesValues &species) -> Vector
 Return the molar masses of all species in a list of species (in units of kg/mol)
 
template<typename Derived >
auto molarFractions (const Eigen::MatrixBase< Derived > &n) -> ChemicalVector
 Return the molar fractions of the species.
 
template<typename SpeciesValues >
auto charges (const SpeciesValues &species) -> Vector
 
auto equilibrate (ChemicalState &state) -> EquilibriumResult
 Equilibrate a chemical state instance. More...
 
auto equilibrate (ChemicalState &state, const Partition &partition) -> EquilibriumResult
 Equilibrate a chemical state instance. More...
 
auto equilibrate (ChemicalState &state, const EquilibriumOptions &options) -> EquilibriumResult
 Equilibrate a chemical state instance with equilibrium options. More...
 
auto equilibrate (ChemicalState &state, const Partition &partition, const EquilibriumOptions &options) -> EquilibriumResult
 Equilibrate a chemical state instance with equilibrium options. More...
 
auto equilibrate (ChemicalState &state, const EquilibriumProblem &problem) -> EquilibriumResult
 Equilibrate a chemical state instance with an equilibrium problem. More...
 
auto equilibrate (ChemicalState &state, const EquilibriumProblem &problem, const EquilibriumOptions &options) -> EquilibriumResult
 Equilibrate a chemical state instance with an equilibrium problem. More...
 
auto equilibrate (const EquilibriumProblem &problem) -> ChemicalState
 Equilibrate a chemical state instance with an equilibrium problem. More...
 
auto equilibrate (const EquilibriumProblem &problem, const EquilibriumOptions &options) -> ChemicalState
 Equilibrate a chemical state instance with an equilibrium problem. More...
 
auto equilibrate (ChemicalState &state, const EquilibriumInverseProblem &problem) -> EquilibriumResult
 Equilibrate a chemical state instance with an equilibrium inverse problem. More...
 
auto equilibrate (ChemicalState &state, const EquilibriumInverseProblem &problem, const EquilibriumOptions &options) -> EquilibriumResult
 Equilibrate a chemical state instance with an equilibrium inverse problem. More...
 
auto equilibrate (const EquilibriumInverseProblem &problem) -> ChemicalState
 Equilibrate a chemical state instance with an equilibrium inverse problem. More...
 
auto equilibrate (const EquilibriumInverseProblem &problem, const EquilibriumOptions &options) -> ChemicalState
 Equilibrate a chemical state instance with an equilibrium inverse problem. More...
 
auto throwGemsNotBuiltError () -> void
 
auto throwPhreeqcNotBuiltError () -> void
 
auto operator<< (std::ostream &out, const BilinearInterpolator &interpolator) -> std::ostream &
 Output a BilinearInterpolator instance.
 
auto derivativeForward (const ScalarFunction &f, const Vector &x) -> Vector
 Calculate the partial derivatives of a scalar function using a 1st-order forward finite difference scheme. More...
 
auto derivativeBackward (const ScalarFunction &f, const Vector &x) -> Vector
 Calculate the partial derivatives of a scalar function using a 1st-order backward finite difference scheme. More...
 
auto derivativeCentral (const ScalarFunction &f, const Vector &x) -> Vector
 Calculate the partial derivatives of a scalar function using a 2nd-order central finite difference scheme. More...
 
auto derivativeForward (const VectorFunction &f, const Vector &x) -> Matrix
 Calculate the partial derivatives of a vector function using a 1st-order forward finite difference scheme. More...
 
auto derivativeBackward (const VectorFunction &f, const Vector &x) -> Matrix
 Calculate the partial derivatives of a vector function using a 1st-order backward finite difference scheme. More...
 
auto derivativeCentral (const VectorFunction &f, const Vector &x) -> Matrix
 Calculate the partial derivatives of a vector function using a 2nd-order central finite difference scheme. More...
 
auto linearlyIndependentCols (const Matrix &A) -> Indices
 Determine the set of linearly independent columns in a matrix using a column pivoting QR algorithm. More...
 
auto linearlyIndependentRows (const Matrix &A) -> Indices
 Determine the set of linearly independent rows in a matrix. More...
 
auto linearlyIndependentCols (const Matrix &A, Matrix &B) -> Indices
 Determine the set of linearly independent columns in a matrix. More...
 
auto linearlyIndependentRows (const Matrix &A, Matrix &B) -> Indices
 Determine the set of linearly independent rows in a matrix. More...
 
auto inverseShermanMorrison (const Matrix &invA, const Vector &D) -> Matrix
 Calculate the inverse of A + D where inv(A) is already known and D is a diagonal matrix. More...
 
auto fraction (double x, long maxden, long &num, long &den) -> void
 Calculate the rational number given a floating-point number. More...
 
auto cleanRationalNumbers (double *vals, long size, long maxden=6) -> void
 Clean an array that is known to have rational numbers from round-off errors. More...
 
auto cleanRationalNumbers (Matrix &A, long maxden=6) -> void
 Clean a matrix that is known to have rational numbers from round-off errors. More...
 
auto cleanRationalNumbers (Vector &x, long maxden=6) -> void
 Clean a vector that is known to have rational numbers from round-off errors. More...
 
template<typename VectorTypeX , typename VectorTypeY >
auto dot3p_ (const VectorTypeX &x, const VectorTypeY &y, double s) -> double
 
auto dot3p (const Vector &x, const Vector &y, double s) -> double
 Return the dot product s + dot(x, y) of two vectors with triple-precision.
 
auto residual3p (const Matrix &A, const Vector &x, const Vector &b) -> Vector
 Return the residual of the equation A*x - b with triple-precision.
 
auto zeros (Index rows) -> decltype(Vector::Zero(rows))
 Return an expression of a zero vector. More...
 
auto ones (Index rows) -> decltype(Vector::Ones(rows))
 Return an expression of a vector with entries equal to one. More...
 
auto random (Index rows) -> decltype(Vector::Random(rows))
 Return an expression of a vector with random entries. More...
 
auto linspace (Index rows, double start, double stop) -> decltype(Vector::LinSpaced(rows, start, stop))
 Return a linearly spaced vector. More...
 
auto unit (Index rows, Index i) -> decltype(Vector::Unit(rows, i))
 Return an expression of a unit vector. More...
 
auto zeros (Index rows, Index cols) -> decltype(Matrix::Zero(rows, cols))
 Return an expression of a zero matrix. More...
 
auto ones (Index rows, Index cols) -> decltype(Matrix::Ones(rows, cols))
 Return an expression of a matrix with entries equal to one. More...
 
auto random (Index rows, Index cols) -> decltype(Matrix::Random(rows, cols))
 Return an expression of a matrix with random entries. More...
 
auto identity (Index rows, Index cols) -> decltype(Matrix::Identity(rows, cols))
 Return an expression of an identity matrix. More...
 
template<typename Derived >
auto rows (Eigen::MatrixBase< Derived > &mat, Index start, Index num) -> decltype(mat.middleRows(start, num))
 Return a view of a sequence of rows of a matrix. More...
 
template<typename Derived >
auto rows (const Eigen::MatrixBase< Derived > &mat, Index start, Index num) -> decltype(mat.middleRows(start, num))
 Return a view of a sequence of rows of a matrix. More...
 
template<typename Derived , typename Indices >
auto rows (Eigen::MatrixBase< Derived > &mat, const Indices &irows) -> Eigen::MatrixRowsView< Derived, Indices >
 Return a view of some rows of a matrix. More...
 
template<typename Derived , typename Indices >
auto rows (const Eigen::MatrixBase< Derived > &mat, const Indices &irows) -> Eigen::MatrixRowsViewConst< Derived, Indices >
 Return a const view of some rows of a matrix. More...
 
template<typename Derived >
auto cols (Eigen::MatrixBase< Derived > &mat, Index start, Index num) -> decltype(mat.middleCols(start, num))
 Return a view of a sequence of columns of a matrix. More...
 
template<typename Derived >
auto cols (const Eigen::MatrixBase< Derived > &mat, Index start, Index num) -> decltype(mat.middleCols(start, num))
 Return a view of a sequence of columns of a matrix. More...
 
template<typename Derived , typename Indices >
auto cols (Eigen::MatrixBase< Derived > &mat, const Indices &icols) -> Eigen::MatrixColsView< Derived, Indices >
 Return a view of some columns of a matrix. More...
 
template<typename Derived , typename Indices >
auto cols (const Eigen::MatrixBase< Derived > &mat, const Indices &icols) -> Eigen::MatrixColsViewConst< Derived, Indices >
 Return a const view of some columns of a matrix. More...
 
template<typename Derived >
auto segment (Eigen::MatrixBase< Derived > &vec, Index irow, Index nrows) -> decltype(vec.segment(irow, nrows))
 Return a view of some rows and columns of a matrix. More...
 
template<typename Derived >
auto segment (const Eigen::MatrixBase< Derived > &vec, Index irow, Index nrows) -> decltype(vec.segment(irow, nrows))
 Return a view of some rows and columns of a matrix. More...
 
template<typename Derived >
auto block (Eigen::MatrixBase< Derived > &mat, Index irow, Index icol, Index nrows, Index ncols) -> decltype(mat.block(irow, icol, nrows, ncols))
 Return a view of some rows and columns of a matrix. More...
 
template<typename Derived >
auto block (const Eigen::MatrixBase< Derived > &mat, Index irow, Index icol, Index nrows, Index ncols) -> decltype(mat.block(irow, icol, nrows, ncols))
 Return a view of some rows and columns of a matrix. More...
 
template<typename Derived , typename Indices >
auto submatrix (Eigen::MatrixBase< Derived > &mat, const Indices &irows, const Indices &icols) -> Eigen::MatrixSubView< Derived, Indices >
 Return a view of some rows and columns of a matrix. More...
 
template<typename Derived , typename Indices >
auto submatrix (const Eigen::MatrixBase< Derived > &mat, const Indices &irows, const Indices &icols) -> Eigen::MatrixSubViewConst< Derived, Indices >
 Return a const view of some rows and columns of a matrix. More...
 
template<typename Derived >
auto tr (Eigen::MatrixBase< Derived > &mat) -> decltype(mat.transpose())
 Return the transpose of the matrix.
 
template<typename Derived >
auto tr (const Eigen::MatrixBase< Derived > &mat) -> decltype(mat.transpose())
 Return the transpose of the matrix.
 
template<typename Derived >
auto inv (const Eigen::MatrixBase< Derived > &mat) -> decltype(mat.cwiseInverse())
 Return the component-wise inverse of the matrix.
 
template<typename Derived >
auto diag (const Eigen::MatrixBase< Derived > &vec) -> decltype(vec.asDiagonal())
 Return a diagonal matrix representation of a vector.
 
template<typename Derived >
auto diagonal (Eigen::MatrixBase< Derived > &mat) -> decltype(mat.diagonal())
 Return a vector representation of the diagonal of a matrix.
 
template<typename Derived >
auto diagonal (const Eigen::MatrixBase< Derived > &mat) -> decltype(mat.diagonal())
 Return a vector representation of the diagonal of a matrix.
 
template<int p, typename Derived >
auto norm (const Eigen::MatrixBase< Derived > &mat) -> double
 Return the Lp norm of a matrix.
 
template<typename Derived >
auto norm (const Eigen::MatrixBase< Derived > &mat) -> double
 Return the L2 norm of a matrix.
 
template<typename Derived >
auto norminf (const Eigen::MatrixBase< Derived > &mat) -> double
 Return the L-inf norm of a matrix.
 
template<typename Derived >
auto sum (const Eigen::DenseBase< Derived > &mat) -> typename Derived::Scalar
 Return the sum of the components of a matrix.
 
template<typename DerivedLHS , typename DerivedRHS >
auto dot (const Eigen::MatrixBase< DerivedLHS > &lhs, const Eigen::MatrixBase< DerivedRHS > &rhs) -> decltype(lhs.dot(rhs))
 Return the dot product of two matrices.
 
template<typename Derived >
auto min (const Eigen::MatrixBase< Derived > &mat) -> decltype(mat.minCoeff())
 Return the minimum component of a matrix.
 
template<typename DerivedLHS , typename DerivedRHS >
auto min (const Eigen::MatrixBase< DerivedLHS > &lhs, const Eigen::MatrixBase< DerivedRHS > &rhs) -> decltype(lhs.cwiseMin(rhs))
 Return the component-wise minimum of two matrices.
 
template<typename Derived >
auto max (const Eigen::MatrixBase< Derived > &mat) -> decltype(mat.maxCoeff())
 Return the maximum component of a matrix.
 
template<typename DerivedLHS , typename DerivedRHS >
auto max (const Eigen::MatrixBase< DerivedLHS > &lhs, const Eigen::MatrixBase< DerivedRHS > &rhs) -> decltype(lhs.cwiseMax(rhs))
 Return the component-wise maximum of two matrices.
 
template<typename DerivedLHS , typename DerivedRHS >
auto operator% (const Eigen::MatrixBase< DerivedLHS > &lhs, const Eigen::MatrixBase< DerivedRHS > &rhs) -> decltype(lhs.cwiseProduct(rhs))
 Return the component-wise multiplication of two matrices.
 
template<typename DerivedLHS , typename DerivedRHS >
auto operator/ (const Eigen::MatrixBase< DerivedLHS > &lhs, const Eigen::MatrixBase< DerivedRHS > &rhs) -> decltype(lhs.cwiseQuotient(rhs))
 Return the component-wise division of two matrices.
 
template<typename Derived >
auto operator/ (const typename Derived::Scalar &scalar, const Eigen::MatrixBase< Derived > &mat) -> decltype(scalar *mat.cwiseInverse())
 Return the component-wise division of two matrices.
 
template<typename Derived >
auto operator+ (const typename Derived::Scalar &scalar, const Eigen::MatrixBase< Derived > &mat) -> decltype((scalar+mat.array()).matrix())
 Return the component-wise division of two matrices.
 
template<typename Derived >
auto operator+ (const Eigen::MatrixBase< Derived > &mat, const typename Derived::Scalar &scalar) -> decltype((scalar+mat.array()).matrix())
 Return the component-wise division of two matrices.
 
template<typename Derived >
auto operator- (const typename Derived::Scalar &scalar, const Eigen::MatrixBase< Derived > &mat) -> decltype((scalar-mat.array()).matrix())
 Return the component-wise division of two matrices.
 
template<typename Derived >
auto operator- (const Eigen::MatrixBase< Derived > &mat, const typename Derived::Scalar &scalar) -> decltype((mat.array()-scalar).matrix())
 Return the component-wise division of two matrices.
 
template<typename Derived >
auto abs (const Eigen::MatrixBase< Derived > &mat) -> decltype(mat.cwiseAbs())
 Return the component-wise absolute entries of a matrix.
 
template<typename Derived >
auto sqrt (const Eigen::MatrixBase< Derived > &mat) -> decltype(mat.cwiseSqrt())
 Return the component-wise square root of a matrix.
 
template<typename Derived >
auto pow (const Eigen::MatrixBase< Derived > &mat, double power) -> decltype(mat.array().pow(power))
 Return the component-wise exponential of a matrix.
 
template<typename Derived >
auto exp (const Eigen::MatrixBase< Derived > &mat) -> decltype(mat.array().exp().matrix())
 Return the component-wise natural exponential of a matrix.
 
template<typename Derived >
auto log (const Eigen::MatrixBase< Derived > &mat) -> decltype(mat.array().log().matrix())
 Return the component-wise natural log of a matrix.
 
template<typename Derived >
auto log10 (const Eigen::MatrixBase< Derived > &mat) -> decltype(mat.array().log10().matrix())
 Return the component-wise log10 of a matrix.
 
auto constants (Index rows, double val) -> decltype(Vector::Constant(rows, val))
 
int CVODEStep (const ODEStepMode &step)
 
int CVODEIteration (const ODEIterationMode &iteration)
 
int CVODEMaxStepOrder (const ODEOptions &options)
 
int CVODEFunction (realtype t, N_Vector y, N_Vector ydot, void *user_data)
 
int CVODEJacobian (long int N, realtype t, N_Vector y, N_Vector fy, DlsMat J, void *user_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3)
 
auto cardano (double a, double b, double c, double d) -> CubicRoots
 Calculate the roots of a cubic equation using Cardano's method. More...
 
auto newton (const std::function< std::tuple< double, double >(double)> &f, double x0, double epsilon, unsigned maxiter) -> double
 Calculate the root of a non-linear function using Newton's method. More...
 
auto newton (const std::function< void(const Vector &, Vector &, Matrix &)> &f, const Vector &x0, double epsilon, unsigned maxiter) -> Vector
 Calculate the root of a non-linear multi-dimensional function using Newton's method. More...
 
auto operator* (const Hessian &H, const Vector &x) -> Vector
 Return the multiplication of a Hessian matrix and a vector.
 
auto isfinite (const ObjectiveResult &f) -> bool
 Returns true if the evaluation of a objective function has finite value and gradient.
 
auto largestStep (const Vector &p, const Vector &dp) -> double
 Compute the largest step length \(\alpha\) such that \(\mathbf{p} + \alpha\Delta\mathbf{p}\) is on the lower bound \(\mathbf{x}_l=\mathbf{0}\). More...
 
auto fractionToTheBoundary (const Vector &p, const Vector &dp, double tau) -> double
 
auto fractionToTheBoundary (const Vector &p, const Vector &dp, double tau, Index &ilimiting) -> double
 
auto fractionToTheBoundary (const Vector &p, const Vector &dp, const Matrix &C, const Vector &r, double tau) -> double
 
auto fractionToTheLowerBoundary (const Vector &p, const Vector &dp, const Vector &lower, double tau) -> double
 
auto lessThan (double a, double b, double baseval) -> bool
 Compute the fraction-to-the-boundary step length given by:

\[\alpha_{\mathrm{max}}=\max\{\alpha\in(0,1]:\mathbf{p}+\alpha\Delta\mathbf{p}\geq(1-\tau)\mathbf{p}\}@f.] @param p The point @f$\mathbf{p}@f$ @param dp The step @f$\Delta\mathbf{p}@f$ @param tau The fraction-to-the-boundary parameter @f$\tau@f$ auto fractionToTheBoundary(const Vector& p, const Vector& dp, double tau) -> double; Compute the fraction-to-the-boundary step length given by: @f[\alpha_{\mathrm{max}}=\max\{\alpha\in(0,1]:\mathbf{p}+\alpha\Delta\mathbf{p}\geq(1-\tau)\mathbf{p}\}@f.] @param p The point @f$\mathbf{p}@f$ @param dp The step @f$\Delta\mathbf{p}@f$ @param tau The fraction-to-the-boundary parameter @f$\tau@f$ @param ilimiting The index of the limiting variable auto fractionToTheBoundary(const Vector& p, const Vector& dp, double tau, Index& ilimiting) -> double; Compute the fraction-to-the-boundary step length given by: @f[\alpha_{\mathrm{max}}=\max\{\alpha\in(0,1]:\alpha C\Delta\mathbf{p}\geq-\tau C\mathbf{p}+\mathbf{r}\}@f.] @param p The point @f$\mathbf{p}@f$ @param dp The step @f$\Delta\mathbf{p}@f$ @param C The left-hand side matrix that defines the inequality constraint @f$C\mathbf{p}\geq\mathbf{r}@f$ @param r The right-hand side vector that defines the inequality constraint @f$C\mathbf{p}\geq\mathbf{r}@f$ @param tau The fraction-to-the-boundary parameter @f$\tau@f$ auto fractionToTheBoundary(const Vector& p, const Vector& dp, const Matrix& C, const Vector& r, double tau) -> double; Compute the fraction-to-the-boundary step length given by: @f[\alpha_{\mathrm{max}}=\max\{\alpha\in(0,1]:\mathbf{p}+\alpha\Delta\mathbf{p}\geq(1-\tau)\mathbf{p}\}@f.] @param p The point @f$\mathbf{p}@f$ @param dp The step @f$\Delta\mathbf{p}@f$ @param lower The lower bound for the step @f$\Delta\mathbf{p}@f$ @param tau The fraction-to-the-boundary parameter @f$\tau@f$ auto fractionToTheLowerBoundary(const Vector& p, const Vector& dp, const Vector& lower, double tau) -> double; Check if a float number is less than another by a base value. This method is particularly useful when comparing two float numbers where round-off errors can compromise the checking. The following is used for the comparison: @f[a < b + 10\epsilon \mathrm{baseval}\]

, where \(\epsilon\) is the machine double precision. More...

 
auto greaterThan (double a, double b, double baseval) -> bool
 Check if a float number is greater than another by a base value. More...
 
auto infinity () -> double
 Return the floating-point representation of positive infinity.
 
auto bfgs () -> std::function< Matrix(const Vector &, const Vector &)>
 Return an inverse Hessian function based on the BFGS Hessian approximation.
 
auto minimizeGoldenSectionSearch (const std::function< double(double)> &f, double tol) -> double
 
auto minimizeGoldenSectionSearch (const std::function< double(double)> &f, double a, double b, double tol=1e-5) -> double
 Calculate the minimum of a single variable function using the Golden Section Search algorithm.
 
auto minimizeBrent (const std::function< double(double)> &f, double min, double max, double tolerance=1e-5, unsigned maxiters=100) -> double
 Calculate the minimum of a single variable function using the Brent algorithm.
 
auto aqueousActivityModelDrummondCO2 (const AqueousMixture &mixture) -> AqueousActivityModel
 Create the function for the calculation of ln activity coefficient of CO2(aq), based on the model of Drummond (1981). More...
 
auto aqueousActivityModelDuanSunCO2 (const AqueousMixture &mixture) -> AqueousActivityModel
 Create the function for the calculation of ln activity coefficient of CO2(aq), based on the model of Duan and Sun (2003) The model is documented in the paper *Duan, Z., Sun, R. More...
 
auto aqueousActivityModelRumpfCO2 (const AqueousMixture &mixture) -> AqueousActivityModel
 Create the function for the calculation of ln activity coefficient of CO2(aq), based on the model of Rumpf et al. More...
 
auto aqueousActivityModelSetschenow (const AqueousMixture &mixture, double b) -> AqueousActivityModel
 Create the aqueous activity function of a neutral species based on the Setschenow model. More...
 
auto database (std::string name) -> std::string
 Return the contents of a built-in database as a string. More...
 
auto databases () -> std::vector< std::string >
 Return the list of names of all built-in databases.
 
auto operator== (const MixtureState &l, const MixtureState &r) -> bool
 Compare two MixtureState instances for equality.
 
auto aqueousChemicalModelDebyeHuckel (const AqueousMixture &mixture, const DebyeHuckelParams &params) -> PhaseChemicalModel
 Return an equation of state for an aqueous phase based on the Debye–Hückel activity model. More...
 
auto aqueousChemicalModelHKF (const AqueousMixture &mixture) -> PhaseChemicalModel
 Return an equation of state for an aqueous phase based on HKF model. More...
 
auto aqueousChemicalModelIdeal (const AqueousMixture &mixture) -> PhaseChemicalModel
 Return an equation of state for an aqueous phase based on the ideal model. More...
 
auto aqueousChemicalModelPitzerHMW (const AqueousMixture &mixture) -> PhaseChemicalModel
 Return an equation of state for an aqueous phase based on a Pitzer model. More...
 
auto gaseousChemicalModelVanDerWaals (const GaseousMixture &mixture) -> PhaseChemicalModel
 Set the chemical model of the phase with the van der Waals equation of state. More...
 
auto gaseousChemicalModelRedlichKwong (const GaseousMixture &mixture) -> PhaseChemicalModel
 Set the chemical model of the phase with the Redlich-Kwong equation of state. More...
 
auto gaseousChemicalModelSoaveRedlichKwong (const GaseousMixture &mixture) -> PhaseChemicalModel
 Set the chemical model of the phase with the Soave-Redlich-Kwong equation of state. More...
 
auto gaseousChemicalModelPengRobinson (const GaseousMixture &mixture) -> PhaseChemicalModel
 Set the chemical model of the phase with the Peng-Robinson equation of state. More...
 
auto gaseousChemicalModelIdeal (const GaseousMixture &mixture) -> PhaseChemicalModel
 Return an equation of state for a gaseous phase based on the ideal model. More...
 
auto gaseousChemicalModelSpycherPruessEnnis (const GaseousMixture &mixture) -> PhaseChemicalModel
 Return a chemical model function for a gaseous phase based on the Spycher et al. More...
 
auto gaseousChemicalModelSpycherReed (const GaseousMixture &mixture) -> PhaseChemicalModel
 Return a chemical model function for a gaseous phase based on the Spycher and Reed (1988) model. More...
 
auto mineralChemicalModelIdeal (const MineralMixture &mixture) -> PhaseChemicalModel
 Return an equation of state for a mineral phase based on the ideal model. More...
 
auto mineralChemicalModelRedlichKister (const MineralMixture &mixture, double a0, double a1, double a2) -> PhaseChemicalModel
 Return an equation of state for a binary mineral solid solution based on Redlich-Kister model. More...
 
auto functionG (Temperature T, Pressure P, const WaterThermoState &wts) -> FunctionG
 Calculate the function g of the HKF model.
 
auto speciesElectroStateHKF (const FunctionG &g, const AqueousSpecies &species) -> SpeciesElectroState
 Calculate the electrostatic state of the aqueous species using the g-function state.
 
auto speciesElectroStateHKF (Temperature T, Pressure P, const AqueousSpecies &species) -> SpeciesElectroState
 Calculate the electrostatic state of the aqueous species using the HKF model.
 
auto speciesThermoStateSolventHKF (Temperature T, Pressure P, const WaterThermoState &wts) -> SpeciesThermoState
 Calculate the thermodynamic state of solvent water using the HKF model.
 
auto speciesThermoStateSoluteHKF (Temperature T, Pressure P, const AqueousSpecies &species, const SpeciesElectroState &aes, const WaterElectroState &wes) -> SpeciesThermoState
 Calculate the thermodynamic state of an aqueous solute using the HKF model.
 
auto speciesThermoStateHKF (Temperature T, Pressure P, const AqueousSpecies &species) -> SpeciesThermoState
 Calculate the thermodynamic state of an aqueous species using the HKF model.
 
auto speciesThermoStateHKF (Temperature T, Pressure P, const GaseousSpecies &species) -> SpeciesThermoState
 Calculate the thermodynamic state of a gaseous species using the HKF model.
 
auto speciesThermoStateHKF (Temperature T, Pressure P, const MineralSpecies &species) -> SpeciesThermoState
 Calculate the thermodynamic state of a mineral species using the HKF model.
 
auto operator< (const MineralCatalyst &lhs, const MineralCatalyst &rhs) -> bool
 Compare two MineralCatalyst instances for less than.
 
auto operator== (const MineralCatalyst &lhs, const MineralCatalyst &rhs) -> bool
 Compare two MineralCatalyst instances for equality.
 
auto operator< (const MineralMechanism &lhs, const MineralMechanism &rhs) -> bool
 Compare two MineralMechanism instances for less than.
 
auto operator== (const MineralMechanism &lhs, const MineralMechanism &rhs) -> bool
 Compare two MineralMechanism instances for equality.
 
auto molarSurfaceArea (const MineralReaction &reaction, const ChemicalSystem &system) -> double
 Calculate the molar surface area of a mineral (in units of m2/mol) More...
 
auto createReaction (const MineralReaction &mineralrxn, const ChemicalSystem &system) -> Reaction
 
auto waterElectroStateJohnsonNorton (Temperature T, Pressure P, const WaterThermoState &wts) -> WaterElectroState
 Calculate the electrostatic state of water using the model of Johnson and Norton (1991). More...
 
auto waterHelmholtzStateHGK (Temperature T, ThermoScalar D) -> WaterHelmholtzState
 Calculate the Helmholtz free energy state of water using the Haar–Gallagher–Kell (1984) equation of state. More...
 
auto waterHelmholtzStateWagnerPruss (Temperature T, ThermoScalar D) -> WaterHelmholtzState
 Calculate the Helmholtz free energy state of water using the Wagner and Pruss (1995) equation of state. More...
 
auto waterThermoStateHGK (Temperature T, Pressure P) -> WaterThermoState
 Calculate the thermodynamic state of water using the Haar–Gallagher–Kell (1984) equation of state. More...
 
auto waterThermoStateWagnerPruss (Temperature T, Pressure P) -> WaterThermoState
 Calculate the thermodynamic state of water using the Wagner and Pruss (1995) equation of state. More...
 
auto waterThermoState (Temperature T, Pressure P, ThermoScalar D, const WaterHelmholtzState &wh) -> WaterThermoState
 Calculate the thermodynamic state of water. More...
 
template<typename HelmholtsModel >
auto waterDensity (Temperature T, Pressure P, const HelmholtsModel &model) -> ThermoScalar
 
auto waterDensityHGK (Temperature T, Pressure P) -> ThermoScalar
 Calculate the density of water using the Haar–Gallagher–Kell (1984) equation of state. More...
 
auto waterDensityWagnerPruss (Temperature T, Pressure P) -> ThermoScalar
 Calculate the density of water using the Wagner and Pruss (1995) equation of state. More...
 
template<typename HelmholtzModel >
auto waterPressure (Temperature T, ThermoScalar D, const HelmholtzModel &model) -> ThermoScalar
 
auto waterPressureHGK (Temperature T, ThermoScalar D) -> ThermoScalar
 Calculate the pressure of water using the Haar–Gallagher–Kell (1984) equation of state. More...
 
auto waterPressureWagnerPruss (Temperature T, ThermoScalar D) -> ThermoScalar
 Calculate the pressure of water using the Wagner and Pruss (1995) equation of state. More...
 
auto waterSaturatedPressureWagnerPruss (Temperature T) -> ThermoScalar
 Calculate the saturated pressure of water using the Wagner and Pruss (1995) equation of state. More...
 
auto waterSaturatedLiquidDensityWagnerPruss (Temperature T) -> ThermoScalar
 Calculate the saturated liquid-density of water using the Wagner and Pruss (1995) equation of state. More...
 
auto waterSaturatedVapourDensityWagnerPruss (Temperature T) -> ThermoScalar
 Calculate the saturated vapour-density of water using the Wagner and Pruss (1995) equation of state. More...
 
auto operator<< (std::ostream &out, const ChemicalField &f) -> std::ostream &
 Output a ChemicalField instance.
 

Variables

const double universalGasConstant = 8.3144621
 The universal gas constant (in units of J/(mol*K))
 
const double faradayConstant = 96485.3329
 The Faraday constant (in units of C/mol)
 
const double jouleToCalorie = 0.239005736
 The constant factor that converts joule to calorie.
 
const double calorieToJoule = 4.184
 The constant factor that converts calorie to joule.
 
const double barToPascal = 1.0e+05
 The conversion factor from bar to pascal.
 
const double cubicCentimeterToCubicMeter = 1.0e-06
 The conversion factor from cubic centimeters to cubic meters.
 
const double cubicMeterToCubicCentimeter = 1.0e+06
 The conversion factor from cubic meters to cubic centimeters.
 
const double waterMolarMass = 0.018015268
 The molar mass of water in units of kg/mol.
 
const double waterCriticalTemperature = 647.096
 The critical temperature of water in units of K.
 
const double waterCriticalPressure = 22.064e+06
 The critical pressure of water in units of Pa.
 
const double waterCriticalDensity = 322.0
 The critical density of water in units of kg/m3.
 
const double waterTriplePointTemperature = 273.16
 The triple point temperature of water in units of K.
 
const double waterTriplePointPressure = 611.655
 The triple point pressure of water in units of Pa.
 
const double waterTriplePointDensityLiquid = 999.793
 The triple point liquid-density of water in units of kg/m3.
 
const double waterTriplePointDensityVapour = 0.00485458
 The triple point vapour-density of water in units of kg/m3.
 

Detailed Description

The namespace containing all components of the Reaktoro library.

Typedef Documentation

A type that represents a chemical scalar and its derivatives.

A chemical scalar is a quantity that depends on temperature, pressure, and mole amounts of species. A ChemicalScalar holds not only its value, but also its temperature, pressure, and mole partial derivatives.

See also
ThermoScalar, ChemicalVector, ThermoVector

A type that represents a vector of chemical scalars and their derivatives.

A chemical scalar is a quantity that depends on temperature, pressure, and mole amounts of species. A ChemicalScalar holds not only its value, but also its partial derivatives with respect to temperature, pressure, and species amounts. A ChemicalVector is a vector representation of a collection of ChemicalScalar instances.

See also
ThermoVector, ThermoScalar, ChemicalScalar

A type that defines a scalar thermo property.

A thermo property means here any property that depends on temperature and pressure. A ThermoScalar instance not only holds the value of the thermo property, but also is partial temperature and pressure derivatives.

See also
ChemicalVector

A type that defines a vector thermo property.

A thermo property means here any property that depends on temperature and pressure. A ThermoVector instance not only holds the values of the thermo properties, but also their partial temperature and pressure derivatives.

See also
ThermoScalar, ChemicalScalar, ChemicalVector
using Reaktoro::NonlinearFunction = typedef std::function<NonlinearResidual(const Vector& x)>

A type that describes the functional signature of a non-linear residual function.

Parameters
xThe vector of variables
Returns
The residual of the non-linear function evaluated at x
using Reaktoro::ObjectiveFunction = typedef std::function<ObjectiveResult(const Vector& x)>

A type that describes the functional signature of an objective function.

Parameters
xThe vector of primal variables
Returns
The objective function evaluated at x
using Reaktoro::AqueousActivityModel = typedef std::function<ChemicalScalar(const AqueousMixtureState&)>

The signature of a function that calculates the ln activity coefficient of a neutral aqueous species.

See also
AqueousMixtureState, ChemicalScalar

Enumeration Type Documentation

The options for the description of the Hessian of the Gibbs energy function.

Enumerator
Exact 

The Hessian of the Gibbs energy function is H = H(exact).

ExactDiagonal 

The Hessian of the Gibbs energy function is H = diag(H(exact)).

Approximation 

The Hessian of the Gibbs energy function is H = d(ln(x))/dn, where x is the molar fractions of the species.

ApproximationDiagonal 

The Hessian of the Gibbs energy function is H = diag(d(ln(x))/dn), where x is the molar fractions of the species.

enum Reaktoro::KktMethod
strong

An enumeration of possible methods for the solution of a KKT equation.

Enumerator
PartialPivLU 

Use a partial pivoting LU algorithm on the full KKT equation.

This can only be used for dense Hessian matrices.

FullPivLU 

Use a full pivoting LU algorithm on the full KKT equation.

This can only be used for dense Hessian matrices.

Nullspace 

Use a nullspace method to solve the KKT equation.

This method is advisable when there are many equality constraints and these are linear so that their gradient is constant.

Rangespace 

Use a rangespace method to solve the KKT equation.

This method is advisable when the Hessian matrix can be easily inverted such as a quasi-Newton approximation or a diagonal matrix.

Automatic 

Use a method that fits better to the type of KKT equation.

This option will ensure that a rangespace method is used when the Hessian matrix is diagonal or its inverse is available. It will use a PartialPivLU method for dense KKT equations.

The available stepping modes for some optimization algorithms.

Enumerator
Conservative 

Use convervative step in which its direction is not changed.

Aggressive 

Use aggressive step that results in faster approach of variables to the bounds.

Function Documentation

auto Reaktoro::amount ( double  value,
Index  size,
Index  index 
) -> ChemicalScalarBase<double, decltype(unit(size, index))>
inline

Return a ChemicalScalar representation of a mole amount of a species.

Parameters
valueThe mole amount of the species.
sizeThe number of species in the system.
indexThe index of the species in the system.
auto Reaktoro::elements ( std::string  formula) -> std::map< std::string, double >

Determine.

the elemental composition of a chemical compound.

Parameters
compoundThe formula of the chemical compound
Returns
The elemental composition of the chemical compound
auto Reaktoro::atomicMass ( std::string  element) -> double

Return the atomic mass of a chemical element (in units of kg/mol).

Parameters
elementThe symbol of the chemical element
Returns
The atomic mass of the chemical element
auto Reaktoro::molarMass ( const std::map< std::string, double > &  compound) -> double

Calculate the molar mass of a chemical compound (in units of kg/mol).

Parameters
compoundThe elements and their stoichiometries that compose the chemical compound
Returns
The molar mass of the chemical compound
auto Reaktoro::molarMass ( std::string  formula) -> double

Calculate the molar mass of a chemical compound (in units of kg/mol).

Parameters
compoundThe formula of the chemical compound
Returns
The molar mass of the chemical compound
auto Reaktoro::charge ( const std::string &  formula) -> double

Extract the electrical charge of a chemical formula.

The chemical formula of a species can be represented by string with the following formats:

std::string formula1 = "Na+"; // species: Na+
std::string formula2 = "Ca++"; // species: Ca++
std::string formula3 = "OH-"; // species: OH-
std::string formula4 = "CO3--"; // species: CO3--
std::string formula5 = "H+"; // species: H+

The number 1 is optional when the species has one negative or positive electrical charge.

Parameters
formulaThe chemical formula of a species
Returns
The electrical charge of the species
auto Reaktoro::alternativeWaterNames ( ) -> std::vector< std::string > &

Return a collection of alternative names to the given species name.

Parameters
nameThe name of the species.
auto Reaktoro::alternativeChargedSpeciesNames ( std::string  name) -> std::vector< std::string > &

Return a collection of alternative names to the given charged species name.

The argument name must follow the naming convention H+, Ca++, Cl-, HCO3-, CO3--, and so forth. That is it, the charge is given as a suffix with as much - or + as the number of charges.

Parameters
nameThe name of the charged species.
auto Reaktoro::alternativeNeutralSpeciesNames ( std::string  name) -> std::vector< std::string > &

Return a collection of alternative names to the given neutral species name.

The argument name must follow the naming convention CO2(aq), CaCO3(aq), NaCl(aq), and so forth. That is, the neutral species name has the suffix (aq).

Parameters
nameThe name of the neutral species.
auto Reaktoro::conventionalChargedSpeciesName ( std::string  name) -> std::string

Return the conventional charged species name adopted in Reaktoro.

This method will return the conventional charged species name adopted in Reaktoro. For example, Ca+2 results in Ca++, CO3-2 results in CO3--, Mg[+2] results in Mg++, and so forth.

Parameters
nameThe name of a charged species.
auto Reaktoro::conventionalNeutralSpeciesName ( std::string  name) -> std::string

Return the conventional neutral species name adopted in Reaktoro.

This method will return the conventional neutral species name adopted in Reaktoro. For example, CO2 results in CO2(aq), CaCO3@ results in CaCO3(aq), NaCl,aq results in NaCl(aq), and so forth.

Parameters
nameThe name of a charged species.
auto Reaktoro::isAlternativeWaterName ( std::string  trial) -> bool

Return true if a trial name is an alternative to a water species name.

Parameters
trialThe trial name that is being checked as an alternative to H2O(l)
auto Reaktoro::isAlternativeChargedSpeciesName ( std::string  trial,
std::string  name 
) -> bool

Return true if a trial name is an alternative to a given charged species name.

Parameters
trialThe trial name that is being checked as an alternative to name
nameThe name of the charged species with convention H+, Ca++, CO3--, etc.
auto Reaktoro::isAlternativeNeutralSpeciesName ( std::string  trial,
std::string  name 
) -> bool

Return true if a trial name is an alternative to a given neutral species name.

Parameters
trialThe trial name that is being checked as an alternative to name
nameThe name of the neutral species with convention CO2(aq), CaCO3(aq).
auto Reaktoro::splitChargedSpeciesName ( std::string  name) -> std::pair< std::string, double >

Return a pair with the base name of a charged species and its electrical charge.

The name of the charge species has to have the following naming conventions: Ca++, Ca+2, and Ca[2+], or Na+, Na[+], or CO3–, CO3-2, and CO3[2-].

Parameters
nameThe name of the charged species.
auto Reaktoro::baseNameChargedSpecies ( std::string  name) -> std::string

Return the name of a charged species without charge suffix.

The name of the charge species has to have the following naming conventions: Ca++, Ca+2, and Ca[2+], or Na+, Na[+], or CO3–, CO3-2, and CO3[2-].

Parameters
nameThe name of the charged species.
auto Reaktoro::baseNameNeutralSpecies ( std::string  name) -> std::string

Return the name of a neutral species without suffix (aq).

Parameters
nameThe name of the charged species.
auto Reaktoro::chargeInSpeciesName ( std::string  name) -> double

Return the electrical charge in a species name.

The charge in the species name must be represended as H+, Ca++, HCO3-, CO3--, SO4--, and so forth.

Parameters
nameThe name of the species
template<typename T >
auto Reaktoro::range ( first,
last,
step 
) -> std::vector<T>

Return a range of values.

Parameters
beginThe begin of the sequence
endThe past-the-end entry of the sequence
stepThe step of the sequence
template<typename T >
auto Reaktoro::range ( first,
last 
) -> std::vector<T>

Return a range of values with unit step.

Parameters
beginThe begin of the sequence
endThe past-the-end entry of the sequence
template<typename T >
auto Reaktoro::range ( last) -> std::vector<T>

Return a range of values starting from zero and increasing by one.

Parameters
Thesize of the sequence
template<typename T >
auto Reaktoro::extract ( const std::vector< T > &  values,
const Indices indices 
) -> std::vector<T>

Extract values from a vector given a list of indices.

Parameters
valuesThe values from which a extraction will be performed
indicesThe indices of the values to be extracted
Returns
The extracted values
auto Reaktoro::time ( ) -> Time

Return the time point now.

See also
elapsed
auto Reaktoro::elapsed ( const Time &  end,
const Time &  begin 
) -> double

Return the elapsed time between two time points (in units of s)

Parameters
endThe end time point
endThe begin time point
Returns
The elapsed time between end and begin in seconds
auto Reaktoro::elapsed ( const Time &  begin) -> double

Return the elapsed time between a time point and now (in units of s)

Parameters
endThe begin time point
Returns
The elapsed time between now and begin in seconds
auto Reaktoro::equilibrate ( ChemicalState state) -> EquilibriumResult

Equilibrate a chemical state instance.

Warning
This function is intended for convenience only! For performance critical applications, use class EquilibriumSolver.
auto Reaktoro::equilibrate ( ChemicalState state,
const Partition partition 
) -> EquilibriumResult

Equilibrate a chemical state instance.

Warning
This function is intended for convenience only! For performance critical applications, use class EquilibriumSolver.
auto Reaktoro::equilibrate ( ChemicalState state,
const EquilibriumOptions options 
) -> EquilibriumResult

Equilibrate a chemical state instance with equilibrium options.

Warning
This function is intended for convenience only! For performance critical applications, use class EquilibriumSolver.
auto Reaktoro::equilibrate ( ChemicalState state,
const Partition partition,
const EquilibriumOptions options 
) -> EquilibriumResult

Equilibrate a chemical state instance with equilibrium options.

Warning
This function is intended for convenience only! For performance critical applications, use class EquilibriumSolver.
auto Reaktoro::equilibrate ( ChemicalState state,
const EquilibriumProblem problem 
) -> EquilibriumResult

Equilibrate a chemical state instance with an equilibrium problem.

Warning
This function is intended for convenience only! For performance critical applications, use class EquilibriumSolver.
auto Reaktoro::equilibrate ( ChemicalState state,
const EquilibriumProblem problem,
const EquilibriumOptions options 
) -> EquilibriumResult

Equilibrate a chemical state instance with an equilibrium problem.

Warning
This function is intended for convenience only! For performance critical applications, use class EquilibriumSolver.
auto Reaktoro::equilibrate ( const EquilibriumProblem problem) -> ChemicalState

Equilibrate a chemical state instance with an equilibrium problem.

Warning
This function is intended for convenience only! For performance critical applications, use class EquilibriumSolver.
auto Reaktoro::equilibrate ( const EquilibriumProblem problem,
const EquilibriumOptions options 
) -> ChemicalState

Equilibrate a chemical state instance with an equilibrium problem.

Warning
This function is intended for convenience only! For performance critical applications, use class EquilibriumSolver.
auto Reaktoro::equilibrate ( ChemicalState state,
const EquilibriumInverseProblem problem 
) -> EquilibriumResult

Equilibrate a chemical state instance with an equilibrium inverse problem.

Warning
This function is intended for convenience only! For performance critical applications, use class EquilibriumSolver.
auto Reaktoro::equilibrate ( ChemicalState state,
const EquilibriumInverseProblem problem,
const EquilibriumOptions options 
) -> EquilibriumResult

Equilibrate a chemical state instance with an equilibrium inverse problem.

Warning
This function is intended for convenience only! For performance critical applications, use class EquilibriumSolver.
auto Reaktoro::equilibrate ( const EquilibriumInverseProblem problem) -> ChemicalState

Equilibrate a chemical state instance with an equilibrium inverse problem.

Warning
This function is intended for convenience only! For performance critical applications, use class EquilibriumSolver.
auto Reaktoro::equilibrate ( const EquilibriumInverseProblem problem,
const EquilibriumOptions options 
) -> ChemicalState

Equilibrate a chemical state instance with an equilibrium inverse problem.

Warning
This function is intended for convenience only! For performance critical applications, use class EquilibriumSolver.
auto Reaktoro::derivativeForward ( const ScalarFunction f,
const Vector x 
) -> Vector

Calculate the partial derivatives of a scalar function using a 1st-order forward finite difference scheme.

Parameters
fThe scalar function as an instance of ScalarFunction
xThe point where the derivative is calculated
Returns
The partial derivatives of the scalar function
auto Reaktoro::derivativeBackward ( const ScalarFunction f,
const Vector x 
) -> Vector

Calculate the partial derivatives of a scalar function using a 1st-order backward finite difference scheme.

Parameters
fThe scalar function as an instance of ScalarFunction
xThe point where the derivative is calculated
Returns
The partial derivatives of the scalar function
auto Reaktoro::derivativeCentral ( const ScalarFunction f,
const Vector x 
) -> Vector

Calculate the partial derivatives of a scalar function using a 2nd-order central finite difference scheme.

Parameters
fThe scalar function as an instance of ScalarFunction
xThe point where the derivative is calculated
Returns
The partial derivatives of the scalar function
auto Reaktoro::derivativeForward ( const VectorFunction f,
const Vector x 
) -> Matrix

Calculate the partial derivatives of a vector function using a 1st-order forward finite difference scheme.

Parameters
fThe scalar function as an instance of ScalarFunction
xThe point where the derivative is calculated
Returns
The partial derivatives of the scalar function
auto Reaktoro::derivativeBackward ( const VectorFunction f,
const Vector x 
) -> Matrix

Calculate the partial derivatives of a vector function using a 1st-order backward finite difference scheme.

Parameters
fThe scalar function as an instance of ScalarFunction
xThe point where the derivative is calculated
Returns
The partial derivatives of the scalar function
auto Reaktoro::derivativeCentral ( const VectorFunction f,
const Vector x 
) -> Matrix

Calculate the partial derivatives of a vector function using a 2nd-order central finite difference scheme.

Parameters
fThe scalar function as an instance of ScalarFunction
xThe point where the derivative is calculated
Returns
The partial derivatives of the scalar function
auto Reaktoro::linearlyIndependentCols ( const Matrix A) -> Indices

Determine the set of linearly independent columns in a matrix using a column pivoting QR algorithm.

Parameters
AThe matrix whose linearly independent columns must be found
Returns
The indices of the linearly independent columns
auto Reaktoro::linearlyIndependentRows ( const Matrix A) -> Indices

Determine the set of linearly independent rows in a matrix.

Parameters
AThe matrix whose linearly independent rows must be found
Returns
The indices of the linearly independent rows
auto Reaktoro::linearlyIndependentCols ( const Matrix A,
Matrix B 
) -> Indices

Determine the set of linearly independent columns in a matrix.

Parameters
[in]AThe matrix whose linearly independent columns must be found
[out]BThe matrix composed by linearly independent columns only
Returns
The indices of the linearly independent columns
auto Reaktoro::linearlyIndependentRows ( const Matrix A,
Matrix B 
) -> Indices

Determine the set of linearly independent rows in a matrix.

Parameters
[in]AThe matrix whose linearly independent rows must be found
[out]BThe matrix composed by linearly independent rows only
Returns
The indices of the linearly independent rows
auto Reaktoro::inverseShermanMorrison ( const Matrix invA,
const Vector D 
) -> Matrix

Calculate the inverse of A + D where inv(A) is already known and D is a diagonal matrix.

Parameters
invA[in,out]The inverse of the matrix A and the final inverse of A + D
DThe diagonal matrix D
auto Reaktoro::fraction ( double  x,
long  maxden,
long &  num,
long &  den 
) -> void

Calculate the rational number given a floating-point number.

Parameters
xThe floating point number
maxdenThe maximum number the denominator can assume
[out]numThe calculated numerator
[out]denThe calculated denominator
auto Reaktoro::cleanRationalNumbers ( double *  vals,
long  size,
long  maxden = 6 
) -> void

Clean an array that is known to have rational numbers from round-off errors.

Parameters
vals[in,out]The values to be cleaned
maxdenThe maximum known denominator in the array with rational numbers
auto Reaktoro::cleanRationalNumbers ( Matrix A,
long  maxden = 6 
) -> void

Clean a matrix that is known to have rational numbers from round-off errors.

Parameters
A[in,out]The matrix to be cleaned
maxdenThe maximum known denominator in the matrix with rational numbers
auto Reaktoro::cleanRationalNumbers ( Vector x,
long  maxden = 6 
) -> void

Clean a vector that is known to have rational numbers from round-off errors.

Parameters
x[in,out]The vector to be cleaned
maxdenThe maximum known denominator in the matrix with rational numbers
auto Reaktoro::zeros ( Index  rows) -> decltype(Vector::Zero(rows))
inline

Return an expression of a zero vector.

Parameters
rowsThe number of rows
Returns
The expression of a zero vector
auto Reaktoro::ones ( Index  rows) -> decltype(Vector::Ones(rows))
inline

Return an expression of a vector with entries equal to one.

Parameters
rowsThe number of rows
Returns
The expression of a vector with entries equal to one
auto Reaktoro::random ( Index  rows) -> decltype(Vector::Random(rows))
inline

Return an expression of a vector with random entries.

Parameters
rowsThe number of rows
Returns
The expression of a vector with random entries equal to one
auto Reaktoro::linspace ( Index  rows,
double  start,
double  stop 
) -> decltype(Vector::LinSpaced(rows, start, stop))
inline

Return a linearly spaced vector.

Parameters
rowsThe number of rows
startThe start of the sequence
stopThe stop of the sequence
Returns
The expression of a vector with linearly spaced entries
auto Reaktoro::unit ( Index  rows,
Index  i 
) -> decltype(Vector::Unit(rows, i))
inline

Return an expression of a unit vector.

Parameters
rowsThe number of rows
iThe index at which the component is one
Returns
The expression of a unit vector
auto Reaktoro::zeros ( Index  rows,
Index  cols 
) -> decltype(Matrix::Zero(rows, cols))
inline

Return an expression of a zero matrix.

Parameters
rowsThe number of rows
colsThe number of columns
Returns
The expression of a zero matrix
auto Reaktoro::ones ( Index  rows,
Index  cols 
) -> decltype(Matrix::Ones(rows, cols))
inline

Return an expression of a matrix with entries equal to one.

Parameters
rowsThe number of rows
colsThe number of columns
Returns
The expression of a matrix with entries equal to one
auto Reaktoro::random ( Index  rows,
Index  cols 
) -> decltype(Matrix::Random(rows, cols))
inline

Return an expression of a matrix with random entries.

Parameters
rowsThe number of rows
colsThe number of columns
Returns
The expression of a matrix with random entries
auto Reaktoro::identity ( Index  rows,
Index  cols 
) -> decltype(Matrix::Identity(rows, cols))
inline

Return an expression of an identity matrix.

Parameters
rowsThe number of rows
colsThe number of columns
Returns
The expression of an identity matrix
template<typename Derived >
auto Reaktoro::rows ( Eigen::MatrixBase< Derived > &  mat,
Index  start,
Index  num 
) -> decltype(mat.middleRows(start, num))

Return a view of a sequence of rows of a matrix.

Parameters
startThe row index of the start of the sequence
numThe number of rows in the sequence
template<typename Derived >
auto Reaktoro::rows ( const Eigen::MatrixBase< Derived > &  mat,
Index  start,
Index  num 
) -> decltype(mat.middleRows(start, num))

Return a view of a sequence of rows of a matrix.

Parameters
startThe row index of the start of the sequence
numThe number of rows in the sequence
template<typename Derived , typename Indices >
auto Reaktoro::rows ( Eigen::MatrixBase< Derived > &  mat,
const Indices irows 
) -> Eigen::MatrixRowsView<Derived, Indices>

Return a view of some rows of a matrix.

Parameters
matThe matrix for which the view is created
irowsThe indices of the rows of the matrix
template<typename Derived , typename Indices >
auto Reaktoro::rows ( const Eigen::MatrixBase< Derived > &  mat,
const Indices irows 
) -> Eigen::MatrixRowsViewConst<Derived, Indices>

Return a const view of some rows of a matrix.

Parameters
matThe matrix for which the view is created
irowsThe indices of the rows of the matrix
template<typename Derived >
auto Reaktoro::cols ( Eigen::MatrixBase< Derived > &  mat,
Index  start,
Index  num 
) -> decltype(mat.middleCols(start, num))

Return a view of a sequence of columns of a matrix.

Parameters
startThe column index of the start of the sequence
numThe number of columns in the sequence
template<typename Derived >
auto Reaktoro::cols ( const Eigen::MatrixBase< Derived > &  mat,
Index  start,
Index  num 
) -> decltype(mat.middleCols(start, num))

Return a view of a sequence of columns of a matrix.

Parameters
startThe column index of the start of the sequence
numThe number of columns in the sequence
template<typename Derived , typename Indices >
auto Reaktoro::cols ( Eigen::MatrixBase< Derived > &  mat,
const Indices icols 
) -> Eigen::MatrixColsView<Derived, Indices>

Return a view of some columns of a matrix.

Parameters
matThe matrix for which the view is created
icolsThe indices of the columns of the matrix
template<typename Derived , typename Indices >
auto Reaktoro::cols ( const Eigen::MatrixBase< Derived > &  mat,
const Indices icols 
) -> Eigen::MatrixColsViewConst<Derived, Indices>

Return a const view of some columns of a matrix.

Parameters
matThe matrix for which the view is created
icolsThe indices of the columns of the matrix
template<typename Derived >
auto Reaktoro::segment ( Eigen::MatrixBase< Derived > &  vec,
Index  irow,
Index  nrows 
) -> decltype(vec.segment(irow, nrows))

Return a view of some rows and columns of a matrix.

Parameters
matThe matrix for which the view is created
irowsThe indices of the rows of the matrix
icolsThe indices of the columns of the matrix
template<typename Derived >
auto Reaktoro::segment ( const Eigen::MatrixBase< Derived > &  vec,
Index  irow,
Index  nrows 
) -> decltype(vec.segment(irow, nrows))

Return a view of some rows and columns of a matrix.

Parameters
matThe matrix for which the view is created
irowsThe indices of the rows of the matrix
icolsThe indices of the columns of the matrix
template<typename Derived >
auto Reaktoro::block ( Eigen::MatrixBase< Derived > &  mat,
Index  irow,
Index  icol,
Index  nrows,
Index  ncols 
) -> decltype(mat.block(irow, icol, nrows, ncols))

Return a view of some rows and columns of a matrix.

Parameters
matThe matrix for which the view is created
irowsThe indices of the rows of the matrix
icolsThe indices of the columns of the matrix
template<typename Derived >
auto Reaktoro::block ( const Eigen::MatrixBase< Derived > &  mat,
Index  irow,
Index  icol,
Index  nrows,
Index  ncols 
) -> decltype(mat.block(irow, icol, nrows, ncols))

Return a view of some rows and columns of a matrix.

Parameters
matThe matrix for which the view is created
irowsThe indices of the rows of the matrix
icolsThe indices of the columns of the matrix
template<typename Derived , typename Indices >
auto Reaktoro::submatrix ( Eigen::MatrixBase< Derived > &  mat,
const Indices irows,
const Indices icols 
) -> Eigen::MatrixSubView<Derived, Indices>

Return a view of some rows and columns of a matrix.

Parameters
matThe matrix for which the view is created
irowsThe indices of the rows of the matrix
icolsThe indices of the columns of the matrix
template<typename Derived , typename Indices >
auto Reaktoro::submatrix ( const Eigen::MatrixBase< Derived > &  mat,
const Indices irows,
const Indices icols 
) -> Eigen::MatrixSubViewConst<Derived, Indices>

Return a const view of some rows and columns of a matrix.

Parameters
matThe matrix for which the view is created
irowsThe indices of the rows of the matrix
icolsThe indices of the columns of the matrix
auto Reaktoro::cardano ( double  a,
double  b,
double  c,
double  d 
) -> CubicRoots

Calculate the roots of a cubic equation using Cardano's method.

The calculation uses the approach presented in: Nickalls, R. W. D. (2012). A New Approach to Solving the Cubic: Cardan’s Solution Revealed. The Mathematical Gazette, 77(480), 354–359 to solve the cubic equation: \( ax^{3}+bx^{2}+cx+d=0 \).

Parameters
aThe coefficient a of the cubic equation
bThe coefficient b of the cubic equation
cThe coefficient c of the cubic equation
dThe coefficient d of the cubic equation
Returns
The three roots \( (r_1, r_2, r_3) \) that solve the cubic equation, where \( |r_1| \geq |r_2| \geq |r_3| \).
auto Reaktoro::newton ( const std::function< std::tuple< double, double >(double)> &  f,
double  x0,
double  epsilon,
unsigned  maxiter 
) -> double

Calculate the root of a non-linear function using Newton's method.

Parameters
fThe function that returns a pair of \( f(x) \) and \( f^{\prime}(x) \).
x0The initial guess for the iterative root calculation.
epsilonThe tolerance used in \( |f(x)| < \epsilon \) to check convergence.
maxiterThe maximum number of iterations.
auto Reaktoro::newton ( const std::function< void(const Vector &, Vector &, Matrix &)> &  f,
const Vector x0,
double  epsilon,
unsigned  maxiter 
) -> Vector

Calculate the root of a non-linear multi-dimensional function using Newton's method.

Parameters
fThe function that returns \( f(x) \) and \( J(x) \).
x0The initial guess for the iterative root calculation.
epsilonThe tolerance used in \( |f(x)| < \epsilon \) to check convergence.
maxiterThe maximum number of iterations.
auto Reaktoro::largestStep ( const Vector p,
const Vector dp 
) -> double

Compute the largest step length \(\alpha\) such that \(\mathbf{p} + \alpha\Delta\mathbf{p}\) is on the lower bound \(\mathbf{x}_l=\mathbf{0}\).

Parameters
pThe point \(\mathbf{p}\)
dpThe step \(\Delta\mathbf{p}\)
auto Reaktoro::lessThan ( double  a,
double  b,
double  baseval 
) -> bool

Compute the fraction-to-the-boundary step length given by:

\[\alpha_{\mathrm{max}}=\max\{\alpha\in(0,1]:\mathbf{p}+\alpha\Delta\mathbf{p}\geq(1-\tau)\mathbf{p}\}@f.] @param p The point @f$\mathbf{p}@f$ @param dp The step @f$\Delta\mathbf{p}@f$ @param tau The fraction-to-the-boundary parameter @f$\tau@f$ auto fractionToTheBoundary(const Vector& p, const Vector& dp, double tau) -> double; Compute the fraction-to-the-boundary step length given by: @f[\alpha_{\mathrm{max}}=\max\{\alpha\in(0,1]:\mathbf{p}+\alpha\Delta\mathbf{p}\geq(1-\tau)\mathbf{p}\}@f.] @param p The point @f$\mathbf{p}@f$ @param dp The step @f$\Delta\mathbf{p}@f$ @param tau The fraction-to-the-boundary parameter @f$\tau@f$ @param ilimiting The index of the limiting variable auto fractionToTheBoundary(const Vector& p, const Vector& dp, double tau, Index& ilimiting) -> double; Compute the fraction-to-the-boundary step length given by: @f[\alpha_{\mathrm{max}}=\max\{\alpha\in(0,1]:\alpha C\Delta\mathbf{p}\geq-\tau C\mathbf{p}+\mathbf{r}\}@f.] @param p The point @f$\mathbf{p}@f$ @param dp The step @f$\Delta\mathbf{p}@f$ @param C The left-hand side matrix that defines the inequality constraint @f$C\mathbf{p}\geq\mathbf{r}@f$ @param r The right-hand side vector that defines the inequality constraint @f$C\mathbf{p}\geq\mathbf{r}@f$ @param tau The fraction-to-the-boundary parameter @f$\tau@f$ auto fractionToTheBoundary(const Vector& p, const Vector& dp, const Matrix& C, const Vector& r, double tau) -> double; Compute the fraction-to-the-boundary step length given by: @f[\alpha_{\mathrm{max}}=\max\{\alpha\in(0,1]:\mathbf{p}+\alpha\Delta\mathbf{p}\geq(1-\tau)\mathbf{p}\}@f.] @param p The point @f$\mathbf{p}@f$ @param dp The step @f$\Delta\mathbf{p}@f$ @param lower The lower bound for the step @f$\Delta\mathbf{p}@f$ @param tau The fraction-to-the-boundary parameter @f$\tau@f$ auto fractionToTheLowerBoundary(const Vector& p, const Vector& dp, const Vector& lower, double tau) -> double; Check if a float number is less than another by a base value. This method is particularly useful when comparing two float numbers where round-off errors can compromise the checking. The following is used for the comparison: @f[a < b + 10\epsilon \mathrm{baseval}\]

, where \(\epsilon\) is the machine double precision.

Parameters
aThe left-hand side value
bThe right-hand side value
basevalThe base value for the comparison
auto Reaktoro::greaterThan ( double  a,
double  b,
double  baseval 
) -> bool

Check if a float number is greater than another by a base value.

This method is particularly useful when comparing two float numbers where round-off errors can compromise the checking. The following is used for the comparison:

\[a > b - 10\epsilon \mathrm{baseval}\]

, where \(\epsilon\) is the machine double precision.

Parameters
aThe left-hand side value
bThe right-hand side value
basevalThe base value for the comparison
auto Reaktoro::aqueousActivityModelDrummondCO2 ( const AqueousMixture mixture) -> AqueousActivityModel

Create the function for the calculation of ln activity coefficient of CO2(aq), based on the model of Drummond (1981).

The model is documented in the paper Drummond, S. E. (1981). Boiling and mixing of hydrothermal fluids: chemical effects on mineral precipitation. Pennsylvania State University.

Parameters
mixtureThe aqueous mixture instance
Returns
The aqueous activity function of species CO2(aq)
See also
AqueousMixture, AqueousActivityModel
auto Reaktoro::aqueousActivityModelDuanSunCO2 ( const AqueousMixture mixture) -> AqueousActivityModel

Create the function for the calculation of ln activity coefficient of CO2(aq), based on the model of Duan and Sun (2003) The model is documented in the paper *Duan, Z., Sun, R.

(2003). An improved model calculating CO2 solubility in pure water and aqueous NaCl mixtures from 273 to 533 K and from 0 to 2000 bar. Chemical Geology, 193(3-4), 257–271*.

Parameters
mixtureThe aqueous mixture instance
See also
AqueousMixture, AqueousActivityModel
auto Reaktoro::aqueousActivityModelRumpfCO2 ( const AqueousMixture mixture) -> AqueousActivityModel

Create the function for the calculation of ln activity coefficient of CO2(aq), based on the model of Rumpf et al.

(1994). The model is documented in the paper *Rumpf, B., Nicolaisen, H., Ocal, C., & Maurer, G. (1994). Solubility of carbon dioxide in aqueous mixtures of sodium chloride: Experimental results and correlation. Journal of Solution Chemistry,

Parameters
mixtureThe aqueous mixture instance
See also
AqueousMixture, AqueousActivityModel
auto Reaktoro::aqueousActivityModelSetschenow ( const AqueousMixture mixture,
double  b 
) -> AqueousActivityModel

Create the aqueous activity function of a neutral species based on the Setschenow model.

Parameters
mixtureThe aqueous mixture instance containing the aqueous species
bThe Setschenow constant
Returns
The aqueous activity function of the aqueous species
See also
AqueousMixture, AqueousActivityModel
auto Reaktoro::database ( std::string  name) -> std::string

Return the contents of a built-in database as a string.

This method searches among all built-in databases and return the database file as a string. If the given database name is not found, an empty string is returned.

Parameters
nameThe name of the database.
See also
databases
auto Reaktoro::aqueousChemicalModelDebyeHuckel ( const AqueousMixture mixture,
const DebyeHuckelParams params 
) -> PhaseChemicalModel

Return an equation of state for an aqueous phase based on the Debye–Hückel activity model.

Parameters
mixtureThe aqueous mixture instance
paramsThe parameters for the Debye–Hückel activity model.
Returns
The activity model function for the aqueous phase
See also
AqueousMixture, DebyeHuckelParams, PhaseChemicalModel
auto Reaktoro::aqueousChemicalModelHKF ( const AqueousMixture mixture) -> PhaseChemicalModel

Return an equation of state for an aqueous phase based on HKF model.

The HKF model implemented here was documented in:

  • Helgeson, H. C., Kirkham, D. H., Flowers, G. C. (1981). Theoretical prediction of the thermodynamic behavior of aqueous electrolytes at high pressures and temperatures: IV. Calculation of activity coefficients, osmotic coefficients, and apparent molal and standard and relative partial molal properties to 600°C. American Journal of Science, 281(10), 1249–1516.
    Parameters
    mixtureThe aqueous mixture
    Returns
    The equation of state function for the aqueous phase
    See also
    AqueousMixture, PhaseChemicalModel
auto Reaktoro::aqueousChemicalModelIdeal ( const AqueousMixture mixture) -> PhaseChemicalModel

Return an equation of state for an aqueous phase based on the ideal model.

Parameters
mixtureThe aqueous mixture
Returns
The equation of state function for the aqueous phase
See also
AqueousMixture, PhaseChemicalModel
auto Reaktoro::aqueousChemicalModelPitzerHMW ( const AqueousMixture mixture) -> PhaseChemicalModel

Return an equation of state for an aqueous phase based on a Pitzer model.

The implementation of this Pitzer model was taken from the following references:

  1. Harvie, C.E., Møller, N., Weare, J.H. (1984). The prediction of mineral solubilities in natural waters: The Na-K-Mg-Ca-H-Cl-SO4-OH-HCO3-CO3-CO2-H2O system to high ionic strengths at 25°C. Geochimica et Cosmochimica Acta, 48(4), 723–751.
  2. Harvie, C.E., Weare, J.H. (1980). The prediction of mineral soluhilities in natural waters: the system from zero to high concentration at 25°C. Geochimica et Cosmochimica Acta, 44(7), 981–997.
  3. Pitzer, K. S. (1975). Thermodynamics of electrolytes. V. effects of higher-order electrostatic terms. Journal of Solution Chemistry, 4(3), 249–265.
    Parameters
    mixtureThe aqueous mixture
    Returns
    The equation of state function for the aqueous phase
    See also
    AqueousMixture, PhaseChemicalModel
auto Reaktoro::gaseousChemicalModelVanDerWaals ( const GaseousMixture mixture) -> PhaseChemicalModel

Set the chemical model of the phase with the van der Waals equation of state.

Reference: van der Waals, J.D. (1910). The equation of state for gases and liquids. Nobel Lectures in Physics. pp. 254-265.

auto Reaktoro::gaseousChemicalModelRedlichKwong ( const GaseousMixture mixture) -> PhaseChemicalModel

Set the chemical model of the phase with the Redlich-Kwong equation of state.

Reference: Redlich, O., Kwong, J.N.S. (1949). On The Thermodynamics of Solutions. Chem. Rev. 44(1) 233–244.

auto Reaktoro::gaseousChemicalModelSoaveRedlichKwong ( const GaseousMixture mixture) -> PhaseChemicalModel

Set the chemical model of the phase with the Soave-Redlich-Kwong equation of state.

Reference: Soave, G. (1972). Equilibrium constants from a modified Redlich-Kwong equation of state, Chem. Eng. Sci., 27, 1197-1203.

auto Reaktoro::gaseousChemicalModelPengRobinson ( const GaseousMixture mixture) -> PhaseChemicalModel

Set the chemical model of the phase with the Peng-Robinson equation of state.

Reference: Peng, D.Y., Robinson, D.B. (1976). A New Two-Constant Equation of State. Industrial and Engineering Chemistry: Fundamentals 15: 59–64.

auto Reaktoro::gaseousChemicalModelIdeal ( const GaseousMixture mixture) -> PhaseChemicalModel

Return an equation of state for a gaseous phase based on the ideal model.

Parameters
mixtureThe gaseous mixture
Returns
The equation of state function for the gaseous phase
See also
GaseousMixture, GaseousChemicalModel
auto Reaktoro::gaseousChemicalModelSpycherPruessEnnis ( const GaseousMixture mixture) -> PhaseChemicalModel

Return a chemical model function for a gaseous phase based on the Spycher et al.

(2003) model. This model only supports a gaseous phase with species CO2(g) and H2O(g). The model is documented in: Spycher, N., Pruess, K., Ennis-King, J. (2003). CO2-H2O mixtures in the geological sequestration of CO2. I. Assessment and calculation of mutual solubilities from 12 to 100°C and up to 600 bar. Geochimica et Cosmochimica Acta, 67(16), 3015–3031.

Parameters
mixtureThe gaseous mixture instance
See also
GaseousMixture, PhaseChemicalModel
auto Reaktoro::gaseousChemicalModelSpycherReed ( const GaseousMixture mixture) -> PhaseChemicalModel

Return a chemical model function for a gaseous phase based on the Spycher and Reed (1988) model.

This model only supports the gaseous species H2O(g), CO2(g), and CH4(g).

Reference: Spycher, N., Reed, M. (1988). Fugacity coefficients of H2, CO2, CH4, H2O and of H2O–CO2–CH4 mixtures: A virial equation treatment for moderate pressures and temperatures applicable to calculations of hydrothermal boiling. Geochimica et Cosmochimica Acta, 52(3), 739–749.

Parameters
mixtureThe gaseous mixture instance
See also
GaseousMixture, GaseousActivityFunction
auto Reaktoro::mineralChemicalModelIdeal ( const MineralMixture mixture) -> PhaseChemicalModel

Return an equation of state for a mineral phase based on the ideal model.

Parameters
mixtureThe mineral mixture
Returns
The equation of state function for the mineral phase
See also
MineralMixture, MineralChemicalModel
auto Reaktoro::mineralChemicalModelRedlichKister ( const MineralMixture mixture,
double  a0,
double  a1,
double  a2 
) -> PhaseChemicalModel

Return an equation of state for a binary mineral solid solution based on Redlich-Kister model.

The Redlich-Kister model calculates the activity coefficient of the end-members in a solid solution using the equations:

\[\ln\gamma_{1}=x_{2}^{2}[a_{0}+a_{1}(3x_{1}-x_{2})+a_{2}(x_{1}-x_{2})(5x_{1}-x_{2})]\]

and

\[\ln\gamma_{2}=x_{1}^{2}[a_{0}-a_{1}(3x_{2}-x_{1})+a_{2}(x_{2}-x_{1})(5x_{2}-x_{1})]\]

. The parameters \(a_0\), \(a_1\), and \(a_2\) must be provided. Set them to zero if not needed.

Parameters
mixtureThe mineral mixture
a0The Redlich-Kister parameter a0
a1The Redlich-Kister parameter a1
a2The Redlich-Kister parameter a2
Returns
The equation of state function for the mineral phase
See also
MineralMixture, MineralChemicalModel
auto Reaktoro::molarSurfaceArea ( const MineralReaction reaction,
const ChemicalSystem system 
) -> double

Calculate the molar surface area of a mineral (in units of m2/mol)

Parameters
reactionThe mineral reaction instance
systemThe chemical system instance
Returns
The molar surface area of the mineral (in units of m2/mol)
auto Reaktoro::createReaction ( const MineralReaction mineralrxn,
const ChemicalSystem system 
) -> Reaction

The rate of the reaction and its partial derivatives

auto Reaktoro::waterElectroStateJohnsonNorton ( Temperature  T,
Pressure  P,
const WaterThermoState wts 
) -> WaterElectroState

Calculate the electrostatic state of water using the model of Johnson and Norton (1991).

References:

  • Johnson, J. W., Norton, D. (1991). Critical phenomena in hydrothermal systems; state, thermodynamic, electrostatic, and transport properties of H2O in the critical region. American Journal of Science, 291(6), 541–648. doi
auto Reaktoro::waterHelmholtzStateHGK ( Temperature  T,
ThermoScalar  D 
) -> WaterHelmholtzState

Calculate the Helmholtz free energy state of water using the Haar–Gallagher–Kell (1984) equation of state.

Parameters
TThe temperature of water (in units of K)
DThe density of water (in units of kg/m3)
Returns
The Helmholtz free energy state of water
See also
WaterHelmholtzState
auto Reaktoro::waterHelmholtzStateWagnerPruss ( Temperature  T,
ThermoScalar  D 
) -> WaterHelmholtzState

Calculate the Helmholtz free energy state of water using the Wagner and Pruss (1995) equation of state.

Parameters
TThe temperature of water (in units of K)
DThe density of water (in units of kg/m3)
Returns
The Helmholtz free energy state of water
See also
WaterHelmholtzState
auto Reaktoro::waterThermoStateHGK ( Temperature  T,
Pressure  P 
) -> WaterThermoState

Calculate the thermodynamic state of water using the Haar–Gallagher–Kell (1984) equation of state.

References:

  • Haar, L., Gallagher, J. S., Kell, G. S. (1984). NBS/NRC Steam Tables: Thermodynamic and Transport Properties and Computer Program for Vapor and Liquid States of Water in SI Units. New York: Hemisphere Publishing Corporation.
    Parameters
    TThe temperature of water (in units of K)
    PThe pressure of water (in units of Pa)
    Returns
    The thermodynamic state of water
    See also
    WaterThermoState
auto Reaktoro::waterThermoStateWagnerPruss ( Temperature  T,
Pressure  P 
) -> WaterThermoState

Calculate the thermodynamic state of water using the Wagner and Pruss (1995) equation of state.

References:

  • Wagner, W., Pruss, A. (1999). The IAPWS Formulation 1995 for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific Use. Journal of Physical and Chemical Reference Data, 31(2), 387. doi
    Parameters
    TThe temperature of water (in units of K)
    PThe pressure of water (in units of Pa)
    Returns
    The thermodynamic state of water
    See also
    WaterThermoState
auto Reaktoro::waterThermoState ( Temperature  T,
Pressure  P,
ThermoScalar  D,
const WaterHelmholtzState wh 
) -> WaterThermoState

Calculate the thermodynamic state of water.

This is a general method that uses the Helmholtz free energy state of water, as an instance of WaterHelmholtzState, to completely resolve its thermodynamic state.

Parameters
TThe temperature of water (in units of K)
PThe pressure of water (in units of Pa)
DThe density of water (in units of kg/m3)
whThe Helmholtz free energy state of water
Returns
The thermodynamic state of water
See also
WaterHelmholtzState, WaterThermoState
auto Reaktoro::waterDensityHGK ( Temperature  T,
Pressure  P 
) -> ThermoScalar

Calculate the density of water using the Haar–Gallagher–Kell (1984) equation of state.

Parameters
TThe temperature of water (in units of K)
PThe pressure of water (in units of Pa)
Returns
The density of water (in units of kg/m3)
auto Reaktoro::waterDensityWagnerPruss ( Temperature  T,
Pressure  P 
) -> ThermoScalar

Calculate the density of water using the Wagner and Pruss (1995) equation of state.

Parameters
TThe temperature of water (in units of K)
PThe pressure of water (in units of Pa)
Returns
The density of water (in units of kg/m3)
auto Reaktoro::waterPressureHGK ( Temperature  T,
ThermoScalar  D 
) -> ThermoScalar

Calculate the pressure of water using the Haar–Gallagher–Kell (1984) equation of state.

Parameters
TThe temperature of water (in units of K)
DThe density of water (in units of kg/m3)
Returns
The pressure of water (in units of Pa)
auto Reaktoro::waterPressureWagnerPruss ( Temperature  T,
ThermoScalar  D 
) -> ThermoScalar

Calculate the pressure of water using the Wagner and Pruss (1995) equation of state.

Parameters
TThe temperature of water (in units of K)
DThe density of water (in units of kg/m3)
Returns
The pressure of water (in units of Pa)
auto Reaktoro::waterSaturatedPressureWagnerPruss ( Temperature  T) -> ThermoScalar

Calculate the saturated pressure of water using the Wagner and Pruss (1995) equation of state.

Parameters
TThe temperature of water (in units of K)
Returns
The saturated pressure of water (in units of Pa)
auto Reaktoro::waterSaturatedLiquidDensityWagnerPruss ( Temperature  T) -> ThermoScalar

Calculate the saturated liquid-density of water using the Wagner and Pruss (1995) equation of state.

Parameters
TThe temperature of water (in units of K)
Returns
The saturated liquid-density of water (in units of kg/m3)
auto Reaktoro::waterSaturatedVapourDensityWagnerPruss ( Temperature  T) -> ThermoScalar

Calculate the saturated vapour-density of water using the Wagner and Pruss (1995) equation of state.

Parameters
TThe temperature of water (in units of K)
Returns
The saturated vapour-density of water (in units of kg/m3)