Reaktoro 
A unified framework for modeling chemically reactive systems
MineralReaction.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright (C) 2014-2015 Allan Leal
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // C++ includes
21 #include <string>
22 #include <vector>
23 #include <memory>
24 
25 // Reaktoro includes
26 #include <Reaktoro/Common/ScalarTypes.hpp>
27 #include <Reaktoro/Thermodynamics/Reactions/MineralCatalyst.hpp>
28 #include <Reaktoro/Thermodynamics/Reactions/MineralMechanism.hpp>
29 
30 namespace Reaktoro {
31 
32 // Forward declarations
33 class ChemicalSystem;
34 class Reaction;
35 class ReactionEquation;
36 
38 {
39 public:
42 
44  MineralReaction(std::string mineral);
45 
47  auto setMineral(std::string mineral) -> MineralReaction&;
48 
52 
57  auto setEquation(std::string equation) -> MineralReaction&;
58 
62  auto setEquilibriumConstant(const ThermoScalarFunction& lnk) -> MineralReaction&;
63 
71  auto setSpecificSurfaceArea(double value, std::string unit) -> MineralReaction&;
72 
75  auto addMechanism(std::string mechanism) -> MineralReaction&;
76 
80  auto addMechanism(const MineralMechanism& mechanism) -> MineralReaction&;
81 
85  auto setMechanisms(const std::vector<MineralMechanism>& mechanisms) -> MineralReaction&;
86 
88  auto mineral() const -> std::string;
89 
92  auto equation() const -> const ReactionEquation&;
93 
95  auto equilibriumConstant() const -> const ThermoScalarFunction&;
96 
98  auto specificSurfaceArea() const -> double;
99 
101  auto volumetricSurfaceArea() const -> double;
102 
105  auto mechanisms() const -> const std::vector<MineralMechanism>&;
106 
107 private:
108  struct Impl;
109 
110  std::shared_ptr<Impl> pimpl;
111 };
112 
113 auto createReaction(const MineralReaction& reaction, const ChemicalSystem& system) -> Reaction;
114 
115 } // namespace Reaktoro
auto mechanisms() const -> const std::vector< MineralMechanism > &
Return the mineral mechanisms of the kinetic rate model of the mineral reaction.
Definition: MineralReaction.cpp:381
auto volumetricSurfaceArea() const -> double
Return the volumetric surface area of the mineral (in units of m2/m3).
Definition: MineralReaction.cpp:376
auto specificSurfaceArea() const -> double
Return the specific surface area of the mineral (in units of m2/kg).
Definition: MineralReaction.cpp:371
Definition: MineralReaction.hpp:37
A class to represent a system and its attributes and properties.
Definition: ChemicalSystem.hpp:47
auto equation() const -> const ReactionEquation &
Return the equation of the mineral reaction as a string.
Definition: MineralReaction.cpp:361
auto createReaction(const MineralReaction &mineralrxn, const ChemicalSystem &system) -> Reaction
Definition: MineralReaction.cpp:426
auto mineral() const -> std::string
Return the name of the mineral species in the reaction.
Definition: MineralReaction.cpp:356
auto setEquation(const ReactionEquation &equation) -> MineralReaction &
Set the equation of the mineral reaction.
Definition: MineralReaction.cpp:314
auto equilibriumConstant() const -> const ThermoScalarFunction &
Return the equilibrium constant of the mineral reaction.
Definition: MineralReaction.cpp:366
Provide a computational representation of a chemical reaction.
Definition: Reaction.hpp:59
Define a type that describes the equation of a reaction.
Definition: ReactionEquation.hpp:35
auto setMechanisms(const std::vector< MineralMechanism > &mechanisms) -> MineralReaction &
Set the mineral mechanisms of the kinetic rate model of the mineral reaction.
Definition: MineralReaction.cpp:350
auto addMechanism(std::string mechanism) -> MineralReaction &
Adds a mineral mechanism to the kinetic rate model of the mineral reaction.
Definition: MineralReaction.cpp:338
auto unit(Index rows, Index i) -> decltype(Vector::Unit(rows, i))
Return an expression of a unit vector.
Definition: Matrix.hxx:47
auto setEquilibriumConstant(const ThermoScalarFunction &lnk) -> MineralReaction &
Set the equilibrium constant of the mineral reaction (in natural log scale).
Definition: MineralReaction.cpp:326
Definition: MineralMechanism.hpp:29
auto setMineral(std::string mineral) -> MineralReaction &
Set the name of the mineral species in the reaction.
Definition: MineralReaction.cpp:308
auto setSpecificSurfaceArea(double value, std::string unit) -> MineralReaction &
Set the specific surface area of the mineral.
Definition: MineralReaction.cpp:332
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
MineralReaction()
Construct a default MineralReaction instance.
Definition: MineralReaction.cpp:300