Reaktoro
A unified framework for modeling chemically reactive systems
EquilibriumCompositionProblem.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 //
21 //#include <Reaktoro/Common/ChemicalScalar.hpp>
22 //#include <Reaktoro/Math/Matrix.hpp>
23 //#include <Reaktoro/Equilibrium/EquilibriumInverseProblem.hpp>
24 //
25 //namespace Reaktoro {
26 //
28 //class ChemicalState;
29 //class ChemicalSystem;
30 //class Partition;
31 //
33 //class EquilibriumCompositionProblem
34 //{
35 //public:
36 // /// Construct a default EquilibriumCompositionProblem instance.
37 // EquilibriumCompositionProblem();
38 //
39 // /// Construct a custom EquilibriumCompositionProblem instance.
40 // EquilibriumCompositionProblem(const ChemicalSystem& system);
41 //
42 // /// Construct a copy of a EquilibriumCompositionProblem instance.
43 // EquilibriumCompositionProblem(const EquilibriumCompositionProblem& other);
44 //
45 // /// Destroy this instance.
46 // virtual ~EquilibriumCompositionProblem();
47 //
48 // /// Construct a copy of a EquilibriumCompositionProblem instance.
49 // auto operator=(EquilibriumCompositionProblem other) -> EquilibriumCompositionProblem&;
50 //
51 // /// Return the chemical system.
52 // auto system() const -> const ChemicalSystem&;
53 //
54 // /// Return the partition of the chemical system.
55 // auto partition() const -> const Partition&;
56 //
57 // /// Set the partition of the chemical system.
58 // auto setPartition(const Partition& partition) -> void;
59 //
60 // /// Set the temperature for the equilibrium calculation.
61 // /// @param value The temperature value.
62 // /// @param units The temperature units.
63 // auto setTemperature(double value, std::string units) -> void;
64 //
65 // /// Set the pressure for the equilibrium calculation.
66 // /// @param value The pressure value.
67 // /// @param units The pressure units.
68 // auto setPressure(double value, std::string units) -> void;
69 //
70 // /// Set the composition of the aqueous phase using molalities of compounds.
71 // /// The compounds and their molalities are separated by semicollon.
72 // /// The following describes how to set the composition of an aqueous phase
73 // /// with 1 molal of NaCl and 1 mmolal MgCl2:
74 // /// ~~~
75 // /// EquilibriumCompositionProblem composition(system);
76 // /// composition.aqueous("1 molal NaCl; 1 mmolal MgCl2");
77 // /// ~~~
78 // auto setAqueousComposition(std::string molalities) -> void;
79 //
80 // /// Set the composition of the gaseous phase using mole fractions of compounds.
81 // /// The compounds and their mole fractions are separated by semicollon.
82 // /// The following describes how to set the composition of a gas phase
83 // /// with 70% N2, 20% O2, and 10% CO2 (molar percentage):
84 // /// ~~~
85 // /// EquilibriumCompositionProblem composition(system);
86 // /// composition.gaseous("0.70 N2; 0.20 O2; 0.10 CO2");
87 // /// ~~~
88 // auto setGaseousComposition(std::string molarfractions) -> void;
89 //
90 // /// Set the volume fractions of the solid phases.
91 // /// The composition of the solid part of the system is defined using
92 // /// volume fractions of each solid phase. The volume fraction of a solid
93 // /// phase is defined as the volume of that phase divided by total solid volume.
94 // /// The following describes how to set the volume fractions of solid
95 // /// phases `Calcite` and `Quartz`.
96 // /// ~~~
97 // /// EquilibriumCompositionProblem composition(system);
98 // /// composition.solid("0.10 Calcite; 0.90 Quartz");
99 // /// ~~~
100 // auto setSolidComposition(std::string volumefractions) -> void;
101 //
102 // /// Set the saturation of the aqueous fluid.
103 // /// The saturation of the aqueous fluid is defined as the ratio
104 // /// of its volume and the total fluid volume.
105 // auto setAqueousSaturation(double value) -> void;
106 //
107 // /// Set the saturation of the gaseous fluid.
108 // /// The saturation of the gaseous fluid is defined as the ratio
109 // /// of its volume and the total fluid volume.
110 // auto setGaseousSaturation(double value) -> void;
111 //
112 // /// Set the porosity of the solid matrix.
113 // /// The porosity is defined as the total fluid volume divided by total volume.
114 // auto setPorosity(double value) -> void;
115 //
116 // /// Convert this EquilibriumCompositionProblem instance into an EquilibriumProblem instance.
117 // /// This conversion is needed to calculate the equilibrium state of both fluid and
118 // /// solid phases using their given compositions and volume conditions.
119 // /// Note that the calculated equilibrium state will satisfy the given fluid phase
120 // /// saturations and solid matrix porosity. The internal equilibrium composition of
121 // /// each phase might differ from those provided.
122 // /// For example, assume the aqueous and gaseous phases are set as:
123 // /// ~~~
124 // /// composition.setAqueousFluid("1 molal NaCl");
125 // /// composition.setGaseousFluid("0.95 CO2; 0.05 O2");
126 // /// ChemicalState state = equilibrate(composition);
127 // /// ~~~
128 // /// When both phases are equilibrated, enouth amount of gas with prescribed
129 // /// composition will be added in the system to satisfy the saturation of the
130 // /// gaseous phase. As a result, the aqueous phase will become saturated with
131 // /// both CO2 and O2. Thus, its final composition will contain a saturated
132 // /// molality of CO2 and O2 in addition to NaCl.
133 // operator EquilibriumInverseProblem();
134 //
135 //private:
136 // struct Impl;
137 //
138 // std::unique_ptr<Impl> pimpl;
139 //};
140 //
141 //} // namespace Reaktoro
142 //