Reaktoro 
A unified framework for modeling chemically reactive systems
Thermo.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 <string>
22 #include <memory>
23 
24 // Reaktoro includes
25 #include <Reaktoro/Common/ScalarTypes.hpp>
26 
27 namespace Reaktoro {
28 
29 // Forward declarations
30 class Database;
31 struct SpeciesThermoState;
32 struct WaterThermoState;
33 
35 class Thermo
36 {
37 public:
39  explicit Thermo(const Database& database);
40 
45  auto standardPartialMolarGibbsEnergy(double T, double P, std::string species) const -> ThermoScalar;
46 
51  auto standardPartialMolarHelmholtzEnergy(double T, double P, std::string species) const -> ThermoScalar;
52 
57  auto standardPartialMolarInternalEnergy(double T, double P, std::string species) const -> ThermoScalar;
58 
63  auto standardPartialMolarEnthalpy(double T, double P, std::string species) const -> ThermoScalar;
64 
69  auto standardPartialMolarEntropy(double T, double P, std::string species) const -> ThermoScalar;
70 
75  auto standardPartialMolarVolume(double T, double P, std::string species) const -> ThermoScalar;
76 
81  auto standardPartialMolarHeatCapacityConstP(double T, double P, std::string species) const -> ThermoScalar;
82 
87  auto standardPartialMolarHeatCapacityConstV(double T, double P, std::string species) const -> ThermoScalar;
88 
93  auto lnEquilibriumConstant(double T, double P, std::string reaction) -> ThermoScalar;
94 
99  auto logEquilibriumConstant(double T, double P, std::string reaction) -> ThermoScalar;
100 
103  auto hasStandardPartialMolarGibbsEnergy(std::string species) const -> bool;
104 
107  auto hasStandardPartialMolarHelmholtzEnergy(std::string species) const -> bool;
108 
111  auto hasStandardPartialMolarInternalEnergy(std::string species) const -> bool;
112 
115  auto hasStandardPartialMolarEnthalpy(std::string species) const -> bool;
116 
119  auto hasStandardPartialMolarEntropy(std::string species) const -> bool;
120 
123  auto hasStandardPartialMolarVolume(std::string species) const -> bool;
124 
127  auto hasStandardPartialMolarHeatCapacityConstP(std::string species) const -> bool;
128 
131  auto hasStandardPartialMolarHeatCapacityConstV(std::string species) const -> bool;
132 
138  auto speciesThermoStateHKF(double T, double P, std::string species) -> SpeciesThermoState;
139 
144  auto waterThermoStateHGK(double T, double P) -> WaterThermoState;
145 
150  auto waterThermoStateWagnerPruss(double T, double P) -> WaterThermoState;
151 
152 private:
153  struct Impl;
154 
155  std::shared_ptr<Impl> pimpl;
156 };
157 
158 } // namespace Reaktoro
auto waterThermoStateHGK(double T, double P) -> WaterThermoState
Calculate the thermodynamic state of water using the Haar–Gallagher–Kell (1984) equation of state...
Definition: Thermo.cpp:668
A type to calculate thermodynamic properties of chemical species.
Definition: Thermo.hpp:35
auto standardPartialMolarHeatCapacityConstV(double T, double P, std::string species) const -> ThermoScalar
Calculate the standard molar isochoric heat capacity of a species (in units of J/(mol*K)).
Definition: Thermo.cpp:541
auto standardPartialMolarInternalEnergy(double T, double P, std::string species) const -> ThermoScalar
Calculate the apparent standard molar internal energy of a species (in units of J/mol).
Definition: Thermo.cpp:516
Definition: WaterThermoState.hpp:25
Thermo(const Database &database)
Construct a Thermo instance with given Database instance.
Definition: Thermo.cpp:502
Provides operations to retrive physical and thermodynamic data of chemical species.
Definition: Database.hpp:63
auto waterThermoStateWagnerPruss(double T, double P) -> WaterThermoState
Calculate the thermodynamic state of water using the Wagner and Pruss (1995) equation of state...
Definition: Thermo.cpp:673
auto lnEquilibriumConstant(double T, double P, std::string reaction) -> ThermoScalar
Calculate the ln equilibrium constant of a reaction.
Definition: Thermo.cpp:546
auto hasStandardPartialMolarHeatCapacityConstV(std::string species) const -> bool
Return true if there is support for the calculation of the standard molar isochoric heat capacity of ...
Definition: Thermo.cpp:650
auto standardPartialMolarHelmholtzEnergy(double T, double P, std::string species) const -> ThermoScalar
Calculate the apparent standard molar Helmholtz free energy of a species (in units of J/mol)...
Definition: Thermo.cpp:511
auto hasStandardPartialMolarInternalEnergy(std::string species) const -> bool
Return true if there is support for the calculation of the apparent standard molar internal energy of...
Definition: Thermo.cpp:585
auto logEquilibriumConstant(double T, double P, std::string reaction) -> ThermoScalar
Calculate the log equilibrium constant of a reaction.
Definition: Thermo.cpp:551
auto hasStandardPartialMolarEnthalpy(std::string species) const -> bool
Return true if there is support for the calculation of the apparent standard molar enthalpy of a spec...
Definition: Thermo.cpp:598
auto hasStandardPartialMolarVolume(std::string species) const -> bool
Return true if there is support for the calculation of the standard molar volumes of a species...
Definition: Thermo.cpp:624
auto hasStandardPartialMolarEntropy(std::string species) const -> bool
Return true if there is support for the calculation of the standard molar entropies of a species...
Definition: Thermo.cpp:611
auto standardPartialMolarHeatCapacityConstP(double T, double P, std::string species) const -> ThermoScalar
Calculate the standard molar isobaric heat capacity of a species (in units of J/(mol*K)).
Definition: Thermo.cpp:536
auto hasStandardPartialMolarGibbsEnergy(std::string species) const -> bool
Return true if there is support for the calculation of the apparent standard molar Gibbs free energy ...
Definition: Thermo.cpp:556
ThermoScalarBase< double > ThermoScalar
A type that defines a scalar thermo property.
Definition: ScalarTypes.hpp:40
auto hasStandardPartialMolarHeatCapacityConstP(std::string species) const -> bool
Return true if there is support for the calculation of the standard molar isobaric heat capacity of a...
Definition: Thermo.cpp:637
auto standardPartialMolarEnthalpy(double T, double P, std::string species) const -> ThermoScalar
Calculate the apparent standard molar enthalpy of a species (in units of J/mol).
Definition: Thermo.cpp:521
auto standardPartialMolarGibbsEnergy(double T, double P, std::string species) const -> ThermoScalar
Calculate the apparent standard molar Gibbs free energy of a species (in units of J/mol)...
Definition: Thermo.cpp:506
auto speciesThermoStateHKF(double T, double P, std::string species) -> SpeciesThermoState
Calculate the thermodynamic state of an aqueous species using the HKF model.
Definition: Thermo.cpp:663
auto database(std::string name) -> std::string
Return the contents of a built-in database as a string.
Definition: DatabaseUtils.cpp:65
auto standardPartialMolarEntropy(double T, double P, std::string species) const -> ThermoScalar
Calculate the standard molar entropies of a species (in units of J/K).
Definition: Thermo.cpp:526
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
auto standardPartialMolarVolume(double T, double P, std::string species) const -> ThermoScalar
Calculate the standard molar volumes of a species (in units of m3/mol).
Definition: Thermo.cpp:531
Describe the thermodynamic state of a species.
Definition: SpeciesThermoState.hpp:26
auto hasStandardPartialMolarHelmholtzEnergy(std::string species) const -> bool
Return true if there is support for the calculation of the apparent standard molar Helmholtz free ene...
Definition: Thermo.cpp:572