All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 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  (200 1005)
49  (350 1010)
50  (400 1020)
51  );
52  }
53  \endverbatim
54 
55 SourceFiles
56  hIcoTabulatedThermoI.H
57  hIcoTabulatedThermo.C
58 
59 See also
60  Foam::Function1s::UniformTable
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef hIcoTabulatedThermo_H
65 #define hIcoTabulatedThermo_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 hIcoTabulatedThermo;
78 
79 template<class EquationOfState>
80 Ostream& operator<<
81 (
82  Ostream&,
83  const hIcoTabulatedThermo<EquationOfState>&
84 );
85 
86 
87 /*---------------------------------------------------------------------------*\
88  Class hIcoTabulatedThermo Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 template<class EquationOfState>
93 :
94  public EquationOfState
95 {
97 
98 
99  // Private Data
100 
101  //- Heat of formation
102  scalar Hf_;
103 
104  //- Standard entropy
105  scalar Sf_;
106 
107  //- Specific heat at constant pressure table [J/kg/K]
108  integratedNonUniformTable Cp_;
109 
110 
111 public:
112 
113  // Constructors
114 
115  //- Construct from dictionary
117 
118  //- Construct as a named copy
119  inline hIcoTabulatedThermo(const word&, const hIcoTabulatedThermo&);
120 
121 
122  // Member Functions
123 
124  //- Return the instantiated type name
125  static word typeName()
126  {
127  return "hIcoTabulated<" + EquationOfState::typeName() + '>';
128  }
129 
130  //- Limit the temperature to be in the range Tlow_ to Thigh_
131  inline scalar limit(const scalar) const;
132 
133 
134  // Fundamental properties
135 
136  //- Heat capacity at constant pressure [J/kg/K]
137  inline scalar Cp(const scalar p, const scalar T) const;
138 
139  //- Absolute enthalpy [J/kg]
140  inline scalar Ha(const scalar p, const scalar T) const;
141 
142  //- Sensible enthalpy [J/kg]
143  inline scalar Hs(const scalar p, const scalar T) const;
144 
145  //- Enthalpy of formation [J/kg]
146  inline scalar Hf() const;
147 
148  //- Entropy [J/kg/K]
149  inline scalar S(const scalar p, const scalar T) const;
150 
151  //- Gibbs free energy of the mixture in the standard state [J/kg]
152  inline scalar Gstd(const scalar T) const;
153 
154  #include "HtoEthermo.H"
155 
156 
157  // Derivative term used for Jacobian
158 
159  //- Temperature derivative of heat capacity at constant pressure
160  inline scalar dCpdT(const scalar p, const scalar T) const;
161 
162 
163  // I-O
164 
165  //- Write to Ostream
166  void write(Ostream& os) const;
167 
168 
169  // Ostream Operator
170 
171  friend Ostream& operator<< <EquationOfState>
172  (
173  Ostream&,
174  const hIcoTabulatedThermo&
175  );
176 };
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace Foam
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #include "hIcoTabulatedThermoI.H"
186 
187 #ifdef NoRepository
188  #include "hIcoTabulatedThermo.C"
189 #endif
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
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.