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-2023 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  values
49  (
50  (200 1005)
51  (350 1010)
52  (400 1020)
53  );
54  }
55  }
56  \endverbatim
57 
58 SourceFiles
59  hIcoTabulatedThermoI.H
60  hIcoTabulatedThermo.C
61 
62 See also
63  Foam::Function1s::UniformTable
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef hIcoTabulatedThermo_H
68 #define hIcoTabulatedThermo_H
69 
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 // Forward declaration of friend functions and operators
78 
79 template<class EquationOfState>
80 class hIcoTabulatedThermo;
81 
82 template<class EquationOfState>
83 Ostream& operator<<
84 (
85  Ostream&,
86  const hIcoTabulatedThermo<EquationOfState>&
87 );
88 
89 
90 /*---------------------------------------------------------------------------*\
91  Class hIcoTabulatedThermo Declaration
92 \*---------------------------------------------------------------------------*/
93 
94 template<class EquationOfState>
96 :
97  public EquationOfState
98 {
99  // Private Typedefs
100 
101  //- Table type
102  typedef Function1s::integratedNonUniformTable integratedNonUniformTable;
103 
104 
105  // Private Data
106 
107  //- Heat of formation
108  scalar Hf_;
109 
110  //- Standard entropy
111  scalar Sf_;
112 
113  //- Specific heat at constant pressure table [J/kg/K]
115 
116 
117 public:
118 
119  // Constructors
120 
121  //- Construct from name and dictionary
122  hIcoTabulatedThermo(const word& name, const dictionary& dict);
123 
124  //- Construct as a named copy
125  inline hIcoTabulatedThermo(const word&, const hIcoTabulatedThermo&);
126 
127 
128  // Member Functions
129 
130  //- Return the instantiated type name
131  static word typeName()
132  {
133  return "hIcoTabulated<" + EquationOfState::typeName() + '>';
134  }
135 
136  //- Limit the temperature to be in the range Tlow_ to Thigh_
137  inline scalar limit(const scalar) 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  //- Enthalpy of formation [J/kg]
152  inline scalar Hf() 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  #include "HtoEthermo.H"
161 
162 
163  // Derivative term used for Jacobian
164 
165  //- Temperature derivative of heat capacity at constant pressure
166  inline scalar dCpdT(const scalar p, const scalar T) const;
167 
168 
169  // I-O
170 
171  //- Write to Ostream
172  void write(Ostream& os) const;
173 
174 
175  // Ostream Operator
176 
177  friend Ostream& operator<< <EquationOfState>
178  (
179  Ostream&,
180  const hIcoTabulatedThermo&
181  );
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace Foam
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #include "hIcoTabulatedThermoI.H"
192 
193 #ifdef NoRepository
194  #include "hIcoTabulatedThermo.C"
195 #endif
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
Non-uniform tabulated property function that linearly interpolates between the values.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Enthalpy based thermodynamics package using non-uniform tabulated data for heat capacity vs temperatu...
scalar Hf() const
Enthalpy of formation [J/kg].
scalar Hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
hIcoTabulatedThermo(const word &name, const dictionary &dict)
Construct from name and dictionary.
static word typeName()
Return the instantiated type name.
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].
void write(Ostream &os) const
Write to Ostream.
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 limit(const scalar) const
Limit the temperature to be in the range Tlow_ to Thigh_.
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 string.
Definition: word.H:62
Namespace for OpenFOAM.
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dictionary dict
volScalarField & p