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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::hTabulatedThermo
28
29Description
30 Enthalpy based thermodynamics package using non-uniform tabulated data for
31 heat capacity vs temperature.
32
33Usage
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
57SourceFiles
58 hTabulatedThermoI.H
59 hTabulatedThermo.C
60
61See also
62 Foam::thermophysicalFunctions::nonUniformTable
63
64\*---------------------------------------------------------------------------*/
65
66#ifndef hTabulatedThermo_H
67#define hTabulatedThermo_H
68
70
71// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72
73namespace Foam
74{
75
76// Forward Declarations
77
78template<class EquationOfState>
79class hTabulatedThermo;
80
81template<class EquationOfState>
82Ostream& operator<<
83(
84 Ostream&,
85 const hTabulatedThermo<EquationOfState>&
86);
87
88
89/*---------------------------------------------------------------------------*\
90 Class hTabulatedThermo Declaration
91\*---------------------------------------------------------------------------*/
92
93template<class EquationOfState>
95:
96 public EquationOfState
97{
98 // Private Typedefs
99
100 typedef thermophysicalFunctions::integratedNonUniformTable
101 integratedNonUniformTable;
102
103
104 // Private Data
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
116public:
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
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
190// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191
192#include "hTabulatedThermoI.H"
193
194#ifdef NoRepository
195 #include "hTabulatedThermo.C"
196#endif
197
198// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199
200#endif
201
202// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Enthalpy based thermodynamics package using non-uniform tabulated data for heat capacity vs temperatu...
scalar limit(const scalar T) const
Limit the temperature to be in the temperature range.
scalar Hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
static word typeName()
The instantiated type name.
scalar dCpdT(const scalar p, const scalar T) const
Temperature derivative of heat capacity at constant pressure.
scalar Hc() const
Chemical enthalpy [J/kg].
scalar S(const scalar p, const scalar T) const
Entropy [J/kg/K].
scalar Ha(const scalar p, const scalar T) const
Absolute enthalpy [J/kg].
scalar Gstd(const scalar T) const
Gibbs free energy of the mixture in the standard state [J/kg].
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
const volScalarField & T
const volScalarField & Cp
Definition: EEqn.H:7
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
runTime write()
dictionary dict