hConstThermo.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) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::hConstThermo
29
30Group
31 grpSpecieThermo
32
33Description
34 Constant properties thermodynamics package
35 templated into the EquationOfState.
36
37SourceFiles
38 hConstThermoI.H
39 hConstThermo.C
40
41\*---------------------------------------------------------------------------*/
42
43#ifndef hConstThermo_H
44#define hConstThermo_H
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51// Forward declaration of friend functions and operators
52
53template<class EquationOfState> class hConstThermo;
54
55template<class EquationOfState>
56inline hConstThermo<EquationOfState> operator+
57(
60);
61
62template<class EquationOfState>
63inline hConstThermo<EquationOfState> operator*
64(
65 const scalar,
67);
68
69template<class EquationOfState>
70inline hConstThermo<EquationOfState> operator==
71(
74);
75
76template<class EquationOfState>
77Ostream& operator<<
78(
79 Ostream&,
81);
82
83
84/*---------------------------------------------------------------------------*\
85 Class hConstThermo Declaration
86\*---------------------------------------------------------------------------*/
87
88template<class EquationOfState>
89class hConstThermo
90:
91 public EquationOfState
92{
93 // Private data
94
95 scalar Cp_;
96 scalar Hf_;
97
98 //- Reference temperature
99 scalar Tref_;
100
101 //- Reference sensible enthalpy
102 scalar Hsref_;
103
104
105 // Private Member Functions
106
107 //- Construct from components
108 inline hConstThermo
109 (
110 const EquationOfState& st,
111 const scalar cp,
112 const scalar hf,
113 const scalar Tref,
114 const scalar Href
115 );
116
117
118public:
119
120 // Constructors
121
122 //- Construct from dictionary
124
125 //- Construct as named copy
126 inline hConstThermo(const word&, const hConstThermo&);
127
128 //- Construct and return a clone
129 inline autoPtr<hConstThermo> clone() const;
130
131 //- Selector from dictionary
132 inline static autoPtr<hConstThermo> New(const dictionary& dict);
133
134
135 // Member Functions
136
137 //- Return the instantiated type name
138 static word typeName()
139 {
140 return "hConst<" + EquationOfState::typeName() + '>';
141 }
142
143 //- Limit temperature to be within the range
144 inline scalar limit(const scalar T) const;
145
146
147 // Fundamental properties
148
149 //- Heat capacity at constant pressure [J/(kg K)]
150 inline scalar Cp(const scalar p, const scalar T) const;
151
152 //- Absolute Enthalpy [J/kg]
153 inline scalar Ha(const scalar p, const scalar T) const;
154
155 //- Sensible enthalpy [J/kg]
156 inline scalar Hs(const scalar p, const scalar T) const;
157
158 //- Chemical enthalpy [J/kg]
159 inline scalar Hc() const;
160
161 //- Entropy [J/(kg K)]
162 inline scalar S(const scalar p, const scalar T) const;
163
164 //- Gibbs free energy of the mixture in the standard state [J/kg]
165 inline scalar Gstd(const scalar T) const;
166
167 #include "HtoEthermo.H"
168
169
170 // Derivative term used for Jacobian
171
172
173 //- Temperature derivative of heat capacity at constant pressure
174 inline scalar dCpdT(const scalar p, const scalar T) const;
175
176
177
178 // I-O
179
180 //- Write to Ostream
181 void write(Ostream& os) const;
182
183
184 // Member operators
185
186 inline void operator+=(const hConstThermo&);
187
188
189 // Friend operators
191 friend hConstThermo operator+ <EquationOfState>
192 (
193 const hConstThermo&,
194 const hConstThermo&
195 );
197 friend hConstThermo operator* <EquationOfState>
198 (
199 const scalar,
200 const hConstThermo&
201 );
203 friend hConstThermo operator== <EquationOfState>
204 (
205 const hConstThermo&,
206 const hConstThermo&
207 );
208
209
210 // IOstream Operators
212 friend Ostream& operator<< <EquationOfState>
213 (
214 Ostream&,
215 const hConstThermo&
216 );
217};
218
219
220// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221
222} // End namespace Foam
223
224// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225
226#include "hConstThermoI.H"
227
228#ifdef NoRepository
229 #include "hConstThermo.C"
230#endif
231
232// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233
234#endif
235
236// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Constant properties thermodynamics package templated into the EquationOfState.
Definition: hConstThermo.H:91
scalar limit(const scalar T) const
Limit temperature to be within the range.
Definition: hConstThermoI.H:85
scalar Hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
static autoPtr< hConstThermo > New(const dictionary &dict)
Selector from dictionary.
Definition: hConstThermoI.H:75
static word typeName()
Return the instantiated type name.
Definition: hConstThermo.H:137
scalar dCpdT(const scalar p, const scalar T) const
Temperature derivative of heat capacity at constant pressure.
void operator+=(const hConstThermo &)
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].
autoPtr< hConstThermo > clone() const
Construct and return a clone.
Definition: hConstThermoI.H:67
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
const volScalarField & cp