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