Reaktoro  v2.11.0
A unified framework for modeling chemically reactive systems
Phase.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/Core/ActivityProps.hpp>
23 #include <Reaktoro/Core/ActivityModel.hpp>
24 #include <Reaktoro/Core/SpeciesList.hpp>
25 #include <Reaktoro/Core/StateOfMatter.hpp>
26 
27 namespace Reaktoro {
28 
32 class Phase
33 {
34 public:
36  Phase();
37 
39  auto clone() const -> Phase;
40 
43 
46 
49 
51  auto withActivityModel(const ActivityModel& model) -> Phase;
52 
55 
57  auto name() const -> String;
58 
60  auto stateOfMatter() const -> StateOfMatter;
61 
63  auto aggregateState() const -> AggregateState;
64 
66  auto elements() const -> const ElementList&;
67 
69  auto element(Index idx) const -> const Element&;
70 
72  auto species() const -> const SpeciesList&;
73 
75  auto species(Index idx) const -> const Species&;
76 
79 
81  auto activityModel() const -> const ActivityModel&;
82 
84  auto idealActivityModel() const -> const ActivityModel&;
85 
86 private:
87  struct Impl;
88 
89  SharedPtr<Impl> pimpl;
90 };
91 
93 auto operator<(const Phase& lhs, const Phase& rhs) -> bool;
94 
96 auto operator==(const Phase& lhs, const Phase& rhs) -> bool;
97 
98 } // namespace Reaktoro
A type used as a collection of elements.
Definition: ElementList.hpp:28
A type used to define a element and its attributes.
Definition: Element.hpp:28
Definition: Model.hpp:30
A type used to define a phase and its attributes.
Definition: Phase.hpp:33
Phase()
Construct a default Phase object.
auto speciesMolarMasses() const -> ArrayXdConstRef
Return the molar masses of the species in the phase (in kg/mol).
auto withStateOfMatter(StateOfMatter state) -> Phase
Return a copy of this Phase object with a new state of matter.
auto activityModel() const -> const ActivityModel &
Return the function that computes activity properties of the phase.
auto elements() const -> const ElementList &
Return the elements of the phase.
auto element(Index idx) const -> const Element &
Return the element in the phase with given index.
auto clone() const -> Phase
Return a deep copy of this Phase object.
auto withIdealActivityModel(const ActivityModel &model) -> Phase
Return a copy of this Phase object with a new ideal activity model function.
auto aggregateState() const -> AggregateState
Return the common aggregate state of the species in the phase.
auto withSpecies(SpeciesList species) -> Phase
Return a copy of this Phase object with new list of species.
auto species() const -> const SpeciesList &
Return the species of the phase.
auto stateOfMatter() const -> StateOfMatter
Return the state of matter of the phase.
auto idealActivityModel() const -> const ActivityModel &
Return the function that computes ideal activity properties of the phase.
auto name() const -> String
Return the name of the phase.
auto withActivityModel(const ActivityModel &model) -> Phase
Return a copy of this Phase object with a new activity model function.
auto withName(String name) -> Phase
Return a copy of this Phase object with a new name.
A type used as a collection of species.
Definition: SpeciesList.hpp:29
A type used to represent a chemical species and its attributes.
Definition: Species.hpp:35
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
AggregateState
The aggregate states of substances according to IUPAC.
Definition: AggregateState.hpp:32
std::string String
Convenient alias for std::string.
Definition: Types.hpp:52
std::size_t Index
Define a type that represents an index.
Definition: Index.hpp:26
Eigen::Ref< const ArrayXd > ArrayXdConstRef
Convenient alias to Eigen type.
Definition: Matrix.hpp:105
StateOfMatter
The list of states of matter for phases.
Definition: StateOfMatter.hpp:27
std::shared_ptr< T > SharedPtr
Convenient alias for std::shared_ptr<T>.
Definition: Types.hpp:106