Reaktoro  v2.11.0
A unified framework for modeling chemically reactive systems
StandardThermoModelNasa.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/Core/AggregateState.hpp>
22 #include <Reaktoro/Core/StandardThermoModel.hpp>
23 
24 namespace Reaktoro {
25 
28 {
30  struct Polynomial
31  {
32  double Tmin;
33  double Tmax;
34 
37 
38  real a1;
39  real a2;
40  real a3;
41  real a4;
42  real a5;
43  real a6;
44  real a7;
45  real b1;
46  real b2;
47  };
48 
51 
54 
57 
59  double T0;
60 
63 };
64 
67 
68 //=================================================================================================
69 // AUXILIARY METHODS
70 //=================================================================================================
71 
72 namespace detail {
73 
78 auto indexTemperatureInterval(const Vec<StandardThermoModelParamsNasa::Polynomial>& polynomials, const real& T) -> Index;
79 
83 auto computeStandardThermoProps(const StandardThermoModelParamsNasa::Polynomial& polynomial, const real& T) -> StandardThermoProps;
84 
88 auto computeStandardThermoProps(const StandardThermoModelParamsNasa& params, const real& T) -> StandardThermoProps;
89 
90 } // namespace detail
91 } // namespace Reaktoro
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::vector< T > Vec
Convenient alias for std::vector<T>.
Definition: Types.hpp:66
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
autodiff::real real
The number type used throughout the library.
Definition: Real.hpp:26
auto StandardThermoModelNasa(const StandardThermoModelParamsNasa &params) -> StandardThermoModel
Return a function that calculates thermodynamic properties of a species using the Maier-Kelley model.
Model< StandardThermoProps(real T, real P)> StandardThermoModel
The function type for calculation of standard thermodynamic properties of a species.
Definition: StandardThermoModel.hpp:30
Used to store Nasa polynomial coefficients valid for a certain temperature interval.
Definition: StandardThermoModelNasa.hpp:31
double Tmax
The maximum temperature (in K) for which the NASA polynomial coefficients below are valid.
Definition: StandardThermoModelNasa.hpp:33
real a7
The least-square coefficient in the regression model for .
Definition: StandardThermoModelNasa.hpp:44
real a5
The least-square coefficient in the regression model for .
Definition: StandardThermoModelNasa.hpp:42
double Tmin
The minimum temperature (in K) for which the NASA polynomial coefficients below are valid.
Definition: StandardThermoModelNasa.hpp:32
real b2
The integration constant used to compute .
Definition: StandardThermoModelNasa.hpp:46
real a3
The least-square coefficient in the regression model for .
Definition: StandardThermoModelNasa.hpp:40
real a2
The least-square coefficient in the regression model for .
Definition: StandardThermoModelNasa.hpp:39
real b1
The least-square coefficient in the regression model for .
Definition: StandardThermoModelNasa.hpp:45
real a4
The least-square coefficient in the regression model for .
Definition: StandardThermoModelNasa.hpp:41
real a6
The least-square coefficient in the regression model for .
Definition: StandardThermoModelNasa.hpp:43
String label
The label describing the species name and its physical form or crystal configuration such as Mg(L)L,...
Definition: StandardThermoModelNasa.hpp:35
AggregateState state
The aggregate state of the species within this temperature interval.
Definition: StandardThermoModelNasa.hpp:36
The parameters in the NASA polynomial model for calculating standard thermodynamic properties of gase...
Definition: StandardThermoModelNasa.hpp:28
Vec< Polynomial > polynomials
The Nasa polynomials for one or more temperature intervals.
Definition: StandardThermoModelNasa.hpp:62
real dHf
The heat of formation at 298.15 K (in J/mol).
Definition: StandardThermoModelNasa.hpp:50
real H0
The assigned enthalpy (in J/mol) of the species when there are no temperature intervals.
Definition: StandardThermoModelNasa.hpp:56
real dH0
The value of (in J/mol).
Definition: StandardThermoModelNasa.hpp:53
double T0
The temperature (in K) corresponding to the assigned enthalpy when there are no temperature intervals...
Definition: StandardThermoModelNasa.hpp:59
The primary standard thermodynamic properties of a chemical species.
Definition: StandardThermoProps.hpp:27