All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hTabulatedThermo.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 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::hTabulatedThermo
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  (200 1005)
49  (350 1010)
50  (400 1020)
51  );
52  }
53  \endverbatim
54 
55 SourceFiles
56  hTabulatedThermoI.H
57  hTabulatedThermo.C
58 
59 See also
60  Foam::thermophysicalFunctions::nonUniformTable
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef hTabulatedThermo_H
65 #define hTabulatedThermo_H
66 
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 
74 // Forward declaration of friend functions and operators
75 
76 template<class EquationOfState>
77 class hTabulatedThermo;
78 
79 template<class EquationOfState>
80 Ostream& operator<<
81 (
82  Ostream&,
83  const hTabulatedThermo<EquationOfState>&
84 );
85 
86 
87 /*---------------------------------------------------------------------------*\
88  Class hTabulatedThermo Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 template<class EquationOfState>
92 class hTabulatedThermo
93 :
94  public EquationOfState
95 {
98 
99 
100  // Private Data
101 
102  //- Heat of formation
103  scalar Hf_;
104 
105  //- Standard entropy
106  scalar Sf_;
107 
108  //- Specific heat at constant pressure table [J/kg/K]
109  integratedNonUniformTable Cp_;
110 
111 
112 public:
113 
114  // Constructors
115 
116  //- Construct from dictionary
118 
119  //- Construct as a named copy
120  inline hTabulatedThermo(const word&, const hTabulatedThermo&);
121 
122 
123  // Member Functions
124 
125  //- Return the instantiated type name
126  static word typeName()
127  {
128  return "hTabulated<" + EquationOfState::typeName() + '>';
129  }
130 
131  //- Limit the temperature to be in the range Tlow_ to Thigh_
132  inline scalar limit(const scalar) const;
133 
134 
135  // Fundamental properties
136 
137  //- Heat capacity at constant pressure [J/kg/K]
138  inline scalar Cp(const scalar p, const scalar T) const;
139 
140  //- Absolute enthalpy [J/kg]
141  inline scalar Ha(const scalar p, const scalar T) const;
142 
143  //- Sensible enthalpy [J/kg]
144  inline scalar Hs(const scalar p, const scalar T) const;
145 
146  //- Enthalpy of formation [J/kg]
147  inline scalar Hf() const;
148 
149  //- Entropy [J/kg/K]
150  inline scalar S(const scalar p, const scalar T) const;
151 
152  //- Gibbs free energy of the mixture in the standard state [J/kg]
153  inline scalar Gstd(const scalar T) const;
154 
155  #include "HtoEthermo.H"
156 
157 
158  // Derivative term used for Jacobian
159 
160  //- Temperature derivative of heat capacity at constant pressure
161  inline scalar dCpdT(const scalar p, const scalar T) const;
162 
163 
164  // I-O
165 
166  //- Write to Ostream
167  void write(Ostream& os) const;
168 
169 
170  // Ostream Operator
171 
172  friend Ostream& operator<< <EquationOfState>
173  (
174  Ostream&,
175  const hTabulatedThermo&
176  );
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #include "hTabulatedThermoI.H"
187 
188 #ifdef NoRepository
189  #include "hTabulatedThermo.C"
190 #endif
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
dictionary dict
scalar limit(const scalar) const
Limit the temperature to be in the range Tlow_ to Thigh_.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Enthalpy based thermodynamics package using non-uniform tabulated data for heat capacity vs temperatu...
scalar Hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
scalar dCpdT(const scalar p, const scalar T) const
Temperature derivative of heat capacity at constant pressure.
scalar Cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/kg/K].
hTabulatedThermo(const dictionary &dict)
Construct from dictionary.
scalar Gstd(const scalar T) const
Gibbs free energy of the mixture in the standard state [J/kg].
scalar Ha(const scalar p, const scalar T) const
Absolute enthalpy [J/kg].
A class for handling words, derived from string.
Definition: word.H:59
Non-uniform tabulated property function that linearly interpolates between the values.
scalar S(const scalar p, const scalar T) const
Entropy [J/kg/K].
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
scalar Hf() const
Enthalpy of formation [J/kg].
void write(Ostream &os) const
Write to Ostream.
volScalarField & p
Namespace for OpenFOAM.
static word typeName()
Return the instantiated type name.