Reaktoro 
A unified framework for modeling chemically reactive systems
KineticPath.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 <memory>
22 #include <string>
23 #include <vector>
24 
25 namespace Reaktoro {
26 
27 // Forward declarations
28 class ChemicalOutput;
29 class ChemicalPlot;
30 class ChemicalSystem;
31 class ChemicalState;
32 class ChemicalState;
33 class Partition;
34 class ReactionSystem;
35 struct KineticOptions;
36 
39 {
40 public:
42  explicit KineticPath(const ReactionSystem& reactions);
43 
45  KineticPath(const KineticPath& other);
46 
48  virtual ~KineticPath();
49 
51  auto operator=(KineticPath other) -> KineticPath&;
52 
54  auto setOptions(const KineticOptions& options) -> void;
55 
58  auto setPartition(const Partition& partition) -> void;
59 
64  auto addSource(const ChemicalState& state, double volumerate, std::string units) -> void;
65 
72  auto addPhaseSink(std::string phase, double volumerate, std::string units) -> void;
73 
79  auto addFluidSink(double volumerate, std::string units) -> void;
80 
86  auto addSolidSink(double volumerate, std::string units) -> void;
87 
93  auto solve(ChemicalState& state, double t0, double t1, std::string units = "s") -> void;
94 
100  auto output() -> ChemicalOutput;
101 
107  auto plot() -> ChemicalPlot;
108 
114  auto plots(unsigned num) -> std::vector<ChemicalPlot>;
115 
117  auto system() const -> const ChemicalSystem&;
118 
120  auto reactions() const -> const ReactionSystem&;
121 
123  auto partition() const -> const Partition&;
124 
125 private:
126  struct Impl;
127 
128  std::unique_ptr<Impl> pimpl;
129 };
130 
131 } // namespace Reaktoro
auto reactions() const -> const ReactionSystem &
Return the reactions in the kinetic path definition.
Definition: KineticPath.cpp:186
auto solve(ChemicalState &state, double t0, double t1, std::string units="s") -> void
Solve the kinetic path problem.
Definition: KineticPath.cpp:158
A class to represent a system and its attributes and properties.
Definition: ChemicalSystem.hpp:47
A struct to describe the options for a chemical kinetics calculation.
Definition: KineticOptions.hpp:35
auto addPhaseSink(std::string phase, double volumerate, std::string units) -> void
Add a phase sink to the chemical kinetics problem.
Definition: KineticPath.cpp:143
auto setPartition(const Partition &partition) -> void
Set the partition of the chemical system.
Definition: KineticPath.cpp:133
auto plots(unsigned num) -> std::vector< ChemicalPlot >
Return a collection of ChemicalPlot instances.
Definition: KineticPath.cpp:175
auto system() const -> const ChemicalSystem &
Return the chemical system in the kinetic path definition.
Definition: KineticPath.cpp:181
auto addSolidSink(double volumerate, std::string units) -> void
Add a solid sink to the chemical kinetics problem.
Definition: KineticPath.cpp:153
auto operator=(KineticPath other) -> KineticPath &
Assign a KineticPath instance to this instance.
Definition: KineticPath.cpp:122
auto output() -> ChemicalOutput
Return a ChemicalPlot instance.
Definition: KineticPath.cpp:163
auto addFluidSink(double volumerate, std::string units) -> void
Add a fluid sink to the chemical kinetics problem.
Definition: KineticPath.cpp:148
A class used to create plots from sequence of chemical states.
Definition: ChemicalPlot.hpp:35
KineticPath(const ReactionSystem &reactions)
Construct a KineticPath instance.
Definition: KineticPath.cpp:111
A class that represents a system of chemical reactions.
Definition: ReactionSystem.hpp:41
auto partition() const -> const Partition &
Return the partition of the chemical system in the kinetic path definition.
Definition: KineticPath.cpp:191
Provide a computational representation of the Partition of a chemical system.
Definition: Partition.hpp:55
auto setOptions(const KineticOptions &options) -> void
Set the options for the chemical kinetics calculation.
Definition: KineticPath.cpp:128
Definition: Units.cpp:38
Provides a computational representation of the state of a multiphase chemical system.
Definition: ChemicalState.hpp:60
A type used to output sequence of chemical states to a file or terminal.
Definition: ChemicalOutput.hpp:35
A class that conveniently solves kinetic path calculations.
Definition: KineticPath.hpp:38
auto addSource(const ChemicalState &state, double volumerate, std::string units) -> void
Add a source to the chemical kinetics problem.
Definition: KineticPath.cpp:138
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
virtual ~KineticPath()
Destroy the KineticPath instance.
Definition: KineticPath.cpp:119
auto plot() -> ChemicalPlot
Return a ChemicalPlot instance.
Definition: KineticPath.cpp:169