Reaktoro  v2.11.0
A unified framework for modeling chemically reactive systems
SmartKineticsSolver.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright © 2014-2024 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 // Reaktoro includes
21 #include <Reaktoro/Common/Types.hpp>
22 #include <Reaktoro/Common/Matrix.hpp>
23 
24 namespace Reaktoro {
25 
26 // Forward declarations
27 class ChemicalProps;
28 class ChemicalState;
29 class ChemicalSystem;
30 class EquilibriumConditions;
31 class EquilibriumRestrictions;
32 class EquilibriumSpecs;
33 class KineticsSensitivity;
34 struct SmartKineticsOptions;
35 struct SmartKineticsResult;
36 
39 {
40 public:
42  explicit SmartKineticsSolver(ChemicalSystem const& system);
43 
45  explicit SmartKineticsSolver(EquilibriumSpecs const& specs);
46 
49 
52 
55 
56  //=================================================================================================================
57  //
58  // CHEMICAL KINETICS METHODS
59  //
60  //=================================================================================================================
61 
65  auto solve(ChemicalState& state, real const& dt) -> SmartKineticsResult;
66 
71  auto solve(ChemicalState& state, real const& dt, EquilibriumRestrictions const& restrictions) -> SmartKineticsResult;
72 
77  auto solve(ChemicalState& state, real const& dt, EquilibriumConditions const& conditions) -> SmartKineticsResult;
78 
84  auto solve(ChemicalState& state, real const& dt, EquilibriumConditions const& conditions, EquilibriumRestrictions const& restrictions) -> SmartKineticsResult;
85 
86  //=================================================================================================================
87  //
88  // CHEMICAL KINETICS METHODS WITH SENSITIVITY CALCULATION
89  //
90  //=================================================================================================================
91 
96  auto solve(ChemicalState& state, KineticsSensitivity& sensitivity, real const& dt) -> SmartKineticsResult;
97 
103  auto solve(ChemicalState& state, KineticsSensitivity& sensitivity, real const& dt, EquilibriumRestrictions const& restrictions) -> SmartKineticsResult;
104 
110  auto solve(ChemicalState& state, KineticsSensitivity& sensitivity, real const& dt, EquilibriumConditions const& conditions) -> SmartKineticsResult;
111 
118  auto solve(ChemicalState& state, KineticsSensitivity& sensitivity, real const& dt, EquilibriumConditions const& conditions, EquilibriumRestrictions const& restrictions) -> SmartKineticsResult;
119 
120  //=================================================================================================================
121  //
122  // MISCELLANEOUS METHODS
123  //
124  //=================================================================================================================
125 
127  auto setOptions(SmartKineticsOptions const& options) -> void;
128 
129 private:
130  struct Impl;
131 
132  Ptr<Impl> pimpl;
133 };
134 
135 } // namespace Reaktoro
The chemical state of a chemical system.
Definition: ChemicalState.hpp:41
The class used to represent a chemical system and its attributes and properties.
Definition: ChemicalSystem.hpp:70
The class used to define conditions to be satisfied at chemical equilibrium.
Definition: EquilibriumConditions.hpp:32
The class used to define reactivity restrictions in a chemical equilibrium calculation.
Definition: EquilibriumRestrictions.hpp:28
The class used to define conditions to be satisfied at chemical equilibrium.
Definition: EquilibriumSpecs.hpp:281
The sensitivity derivatives of a chemical equilibrium state.
Definition: KineticsSensitivity.hpp:35
Used for chemical kinetics calculations.
Definition: SmartKineticsSolver.hpp:39
auto solve(ChemicalState &state, KineticsSensitivity &sensitivity, real const &dt, EquilibriumConditions const &conditions, EquilibriumRestrictions const &restrictions) -> SmartKineticsResult
React a chemical state for a given time interval respecting given constraint conditions and reactivit...
auto solve(ChemicalState &state, real const &dt, EquilibriumConditions const &conditions) -> SmartKineticsResult
React a chemical state for a given time interval respecting given constraint conditions.
auto solve(ChemicalState &state, real const &dt) -> SmartKineticsResult
React a chemical state for a given time interval.
auto operator=(SmartKineticsSolver other) -> SmartKineticsSolver &
Assign a copy of an SmartKineticsSolver object to this.
auto setOptions(SmartKineticsOptions const &options) -> void
Set the options of the kinetics solver.
auto solve(ChemicalState &state, KineticsSensitivity &sensitivity, real const &dt) -> SmartKineticsResult
React a chemical state for a given time interval and compute sensitivity derivatives.
~SmartKineticsSolver()
Destroy this SmartKineticsSolver object.
SmartKineticsSolver(SmartKineticsSolver const &other)
Construct a copy of an SmartKineticsSolver object.
auto solve(ChemicalState &state, KineticsSensitivity &sensitivity, real const &dt, EquilibriumRestrictions const &restrictions) -> SmartKineticsResult
React a chemical state for a given time interval respecting given reactivity restrictions and compute...
SmartKineticsSolver(ChemicalSystem const &system)
Construct an SmartKineticsSolver object with given chemical system.
auto solve(ChemicalState &state, KineticsSensitivity &sensitivity, real const &dt, EquilibriumConditions const &conditions) -> SmartKineticsResult
React a chemical state for a given time interval respecting given constraint conditions and compute s...
auto solve(ChemicalState &state, real const &dt, EquilibriumRestrictions const &restrictions) -> SmartKineticsResult
React a chemical state for a given time interval respecting given reactivity restrictions.
SmartKineticsSolver(EquilibriumSpecs const &specs)
Construct an SmartKineticsSolver object with given chemical equilibrium specifications to be attained...
auto solve(ChemicalState &state, real const &dt, EquilibriumConditions const &conditions, EquilibriumRestrictions const &restrictions) -> SmartKineticsResult
React a chemical state for a given time interval respecting given constraint conditions and reactivit...
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
autodiff::real real
The number type used throughout the library.
Definition: Real.hpp:26
std::unique_ptr< T > Ptr
Convenient alias for std::unique_ptr<T>.
Definition: Types.hpp:102
The options for smart chemical kinetics calculation.
Definition: SmartKineticsOptions.hpp:27
Used to describe the result of a smart chemical kinetics calculation.
Definition: SmartKineticsResult.hpp:27