hIcoTabulatedThermo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::hIcoTabulatedThermo
26 
27 Description
28  Enthalpy based thermodynamics package using non-uniform tabulated data for
29  heat capacity vs temperature.
30 
31 Usage
32 
33  \table
34  Property | Description
35  Hf | Heat of formation
36  Sf | Standard entropy
37  Cp | Specific heat at constant pressure vs temperature table
38  \endtable
39 
40  Example of the specification of the thermodynamic properties:
41  \verbatim
42  thermodynamics
43  {
44  Hf 0;
45  Sf 0;
46  Cp
47  {
48  values
49  (
50  (200 1005)
51  (350 1010)
52  (400 1020)
53  );
54  }
55  }
56  \endverbatim
57 
58 SourceFiles
59  hIcoTabulatedThermoI.H
60  hIcoTabulatedThermo.C
61 
62 See also
63  Foam::Function1s::UniformTable
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef hIcoTabulatedThermo_H
68 #define hIcoTabulatedThermo_H
69 
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 // Forward declaration of friend functions and operators
78 
79 template<class EquationOfState>
80 class hIcoTabulatedThermo;
81 
82 template<class EquationOfState>
83 Ostream& operator<<
84 (
85  Ostream&,
86  const hIcoTabulatedThermo<EquationOfState>&
87 );
88 
89 
90 /*---------------------------------------------------------------------------*\
91  Class hIcoTabulatedThermo Declaration
92 \*---------------------------------------------------------------------------*/
93 
94 template<class EquationOfState>
96 :
97  public EquationOfState
98 {
100 
101 
102  // Private Data
103 
104  //- Heat of formation
105  scalar Hf_;
106 
107  //- Standard entropy
108  scalar Sf_;
109 
110  //- Specific heat at constant pressure table [J/kg/K]
111  integratedNonUniformTable Cp_;
112 
113 
114 public:
115 
116  // Constructors
117 
118  //- Construct from dictionary
120 
121  //- Construct as a named copy
122  inline hIcoTabulatedThermo(const word&, const hIcoTabulatedThermo&);
123 
124 
125  // Member Functions
126 
127  //- Return the instantiated type name
128  static word typeName()
129  {
130  return "hIcoTabulated<" + EquationOfState::typeName() + '>';
131  }
132 
133  //- Limit the temperature to be in the range Tlow_ to Thigh_
134  inline scalar limit(const scalar) const;
135 
136 
137  // Fundamental properties
138 
139  //- Heat capacity at constant pressure [J/kg/K]
140  inline scalar Cp(const scalar p, const scalar T) const;
141 
142  //- Absolute enthalpy [J/kg]
143  inline scalar Ha(const scalar p, const scalar T) const;
144 
145  //- Sensible enthalpy [J/kg]
146  inline scalar Hs(const scalar p, const scalar T) const;
147 
148  //- Enthalpy of formation [J/kg]
149  inline scalar Hf() const;
150 
151  //- Entropy [J/kg/K]
152  inline scalar S(const scalar p, const scalar T) const;
153 
154  //- Gibbs free energy of the mixture in the standard state [J/kg]
155  inline scalar Gstd(const scalar T) const;
156 
157  #include "HtoEthermo.H"
158 
159 
160  // Derivative term used for Jacobian
161 
162  //- Temperature derivative of heat capacity at constant pressure
163  inline scalar dCpdT(const scalar p, const scalar T) const;
164 
165 
166  // I-O
167 
168  //- Write to Ostream
169  void write(Ostream& os) const;
170 
171 
172  // Ostream Operator
173 
174  friend Ostream& operator<< <EquationOfState>
175  (
176  Ostream&,
177  const hIcoTabulatedThermo&
178  );
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #include "hIcoTabulatedThermoI.H"
189 
190 #ifdef NoRepository
191  #include "hIcoTabulatedThermo.C"
192 #endif
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
scalar Gstd(const scalar T) const
Gibbs free energy of the mixture in the standard state [J/kg].
dictionary dict
scalar Cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/kg/K].
Enthalpy based thermodynamics package using non-uniform tabulated data for heat capacity vs temperatu...
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
scalar limit(const scalar) const
Limit the temperature to be in the range Tlow_ to Thigh_.
Non-uniform tabulated property function that linearly interpolates between the values.
scalar dCpdT(const scalar p, const scalar T) const
Temperature derivative of heat capacity at constant pressure.
scalar S(const scalar p, const scalar T) const
Entropy [J/kg/K].
A class for handling words, derived from string.
Definition: word.H:59
void write(Ostream &os) const
Write to Ostream.
static word typeName()
Return the instantiated type name.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
hIcoTabulatedThermo(const dictionary &dict)
Construct from dictionary.
scalar Hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
scalar Ha(const scalar p, const scalar T) const
Absolute enthalpy [J/kg].
volScalarField & p
scalar Hf() const
Enthalpy of formation [J/kg].
Namespace for OpenFOAM.