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-2018 Allan Leal
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library 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 GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library. 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) = delete;
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 addFluidSink(double volumerate, std::string units) -> void
Add a fluid sink to the chemical kinetics problem.
Definition: KineticPath.cpp:144
auto operator=(KineticPath other) -> KineticPath &
Assign a KineticPath instance to this instance.
Definition: KineticPath.cpp:118
virtual ~KineticPath()
Destroy the KineticPath instance.
Definition: KineticPath.cpp:115
A class that conveniently solves kinetic path calculations.
Definition: KineticPath.hpp:39
A struct to describe the options for a chemical kinetics calculation.
Definition: KineticOptions.hpp:36
A class to represent a system and its attributes and properties.
Definition: ChemicalSystem.hpp:38
KineticPath(const ReactionSystem &reactions)
Construct a KineticPath instance.
Definition: KineticPath.cpp:111
auto addSolidSink(double volumerate, std::string units) -> void
Add a solid sink to the chemical kinetics problem.
Definition: KineticPath.cpp:149
Provides a computational representation of the state of a multiphase chemical system.
Definition: ChemicalState.hpp:61
auto setOptions(const KineticOptions &options) -> void
Set the options for the chemical kinetics calculation.
Definition: KineticPath.cpp:124
auto plot() -> ChemicalPlot
Return a ChemicalPlot instance.
Definition: KineticPath.cpp:165
auto addSource(const ChemicalState &state, double volumerate, std::string units) -> void
Add a source to the chemical kinetics problem.
Definition: KineticPath.cpp:134
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
auto output() -> ChemicalOutput
Return a ChemicalPlot instance.
Definition: KineticPath.cpp:159
auto addPhaseSink(std::string phase, double volumerate, std::string units) -> void
Add a phase sink to the chemical kinetics problem.
Definition: KineticPath.cpp:139
A type used to output sequence of chemical states to a file or terminal.
Definition: ChemicalOutput.hpp:36
KineticPath(const KineticPath &other)=delete
Construct a copy of a KineticPath instance.
auto setPartition(const Partition &partition) -> void
Set the partition of the chemical system.
Definition: KineticPath.cpp:129
auto system() const -> const ChemicalSystem &
Return the chemical system in the kinetic path definition.
Definition: KineticPath.cpp:177
A class that represents a system of chemical reactions.
Definition: ReactionSystem.hpp:42
auto reactions() const -> const ReactionSystem &
Return the reactions in the kinetic path definition.
Definition: KineticPath.cpp:182
auto partition() const -> const Partition &
Return the partition of the chemical system in the kinetic path definition.
Definition: KineticPath.cpp:187
auto solve(ChemicalState &state, double t0, double t1, std::string units="s") -> void
Solve the kinetic path problem.
Definition: KineticPath.cpp:154
Provide a computational representation of the Partition of a chemical system.
Definition: Partition.hpp:56
A class used to create plots from sequence of chemical states.
Definition: ChemicalPlot.hpp:36
auto plots(unsigned num) -> std::vector< ChemicalPlot >
Return a collection of ChemicalPlot instances.
Definition: KineticPath.cpp:171