eIcoTabulatedThermo.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-2021 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::eIcoTabulatedThermo
26 
27 Description
28  Internal energy based thermodynamics package using non-uniform tabulated
29  data for heat capacity vs temperature.
30 
31 Usage
32  \table
33  Property | Description
34  Hf | Heat of formation
35  Sf | Standard entropy
36  Cv | Specific heat at constant volume vs temperature table
37  \endtable
38 
39  Example of the specification of the thermodynamic properties:
40  \verbatim
41  thermodynamics
42  {
43  Hf 0;
44  Sf 0;
45  Cv
46  {
47  values
48  (
49  (200 1005)
50  (350 1010)
51  (400 1020)
52  );
53  }
54  }
55  \endverbatim
56 
57 SourceFiles
58  eIcoTabulatedThermoI.H
59  eIcoTabulatedThermo.C
60 
61 See also
62  Foam::Function1s::UniformTable
63 
64 \*---------------------------------------------------------------------------*/
65 
66 #ifndef eIcoTabulatedThermo_H
67 #define eIcoTabulatedThermo_H
68 
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 
76 // Forward declaration of friend functions and operators
77 
78 template<class EquationOfState>
79 class eIcoTabulatedThermo;
80 
81 template<class EquationOfState>
82 Ostream& operator<<
83 (
84  Ostream&,
85  const eIcoTabulatedThermo<EquationOfState>&
86 );
87 
88 
89 /*---------------------------------------------------------------------------*\
90  Class eIcoTabulatedThermo Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 template<class EquationOfState>
95 :
96  public EquationOfState
97 {
99 
100 
101  // Private Data
102 
103  //- Heat of formation
104  scalar Hf_;
105 
106  //- Standard entropy
107  scalar Sf_;
108 
109  //- Specific heat at constant volume table [J/kg/K]
110  integratedNonUniformTable Cv_;
111 
112 
113 public:
114 
115  // Constructors
116 
117  //- Construct from dictionary
119 
120  //- Construct as a named copy
121  inline eIcoTabulatedThermo(const word&, const eIcoTabulatedThermo&);
122 
123 
124  // Member Functions
125 
126  //- Return the instantiated type name
127  static word typeName()
128  {
129  return "eIcoTabulated<" + EquationOfState::typeName() + '>';
130  }
131 
132  //- Limit the temperature to be in the range Tlow_ to Thigh_
133  inline scalar limit(const scalar) const;
134 
135 
136  // Fundamental properties
137 
138  //- Heat capacity at constant volume [J/kg/K]
139  inline scalar Cv(const scalar p, const scalar T) const;
140 
141  //- Sensible internal energy [J/kg]
142  inline scalar Es(const scalar p, const scalar T) const;
143 
144  //- Absolute internal energy [J/kg]
145  inline scalar Ea(const scalar p, const scalar T) const;
146 
147  //- Enthalpy of formation [J/kg]
148  inline scalar Hf() const;
149 
150  //- Entropy [J/kg/K]
151  inline scalar S(const scalar p, const scalar T) const;
152 
153  //- Gibbs free energy of the mixture in the standard state [J/kg]
154  inline scalar Gstd(const scalar T) const;
155 
156  #include "EtoHthermo.H"
157 
158 
159  // Derivative term used for Jacobian
160 
161  //- Temperature derivative of heat capacity at constant pressure
162  inline scalar dCpdT(const scalar p, const scalar T) const;
163 
164 
165  // I-O
166 
167  //- Write to Ostream
168  void write(Ostream& os) const;
169 
170 
171  // Ostream Operator
172 
173  friend Ostream& operator<< <EquationOfState>
174  (
175  Ostream&,
176  const eIcoTabulatedThermo&
177  );
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #include "eIcoTabulatedThermoI.H"
188 
189 #ifdef NoRepository
190  #include "eIcoTabulatedThermo.C"
191 #endif
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #endif
196 
197 // ************************************************************************* //
dictionary dict
void write(Ostream &os) const
Write to Ostream.
scalar Cv(const scalar p, const scalar T) const
Heat capacity at constant volume [J/kg/K].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
static word typeName()
Return the instantiated type name.
Non-uniform tabulated property function that linearly interpolates between the values.
scalar Hf() const
Enthalpy of formation [J/kg].
A class for handling words, derived from string.
Definition: word.H:59
scalar Es(const scalar p, const scalar T) const
Sensible internal energy [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].
scalar Ea(const scalar p, const scalar T) const
Absolute internal energy [J/kg].
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
scalar S(const scalar p, const scalar T) const
Entropy [J/kg/K].
eIcoTabulatedThermo(const dictionary &dict)
Construct from dictionary.
scalar dCpdT(const scalar p, const scalar T) const
Temperature derivative of heat capacity at constant pressure.
volScalarField & p
Internal energy based thermodynamics package using non-uniform tabulated data for heat capacity vs te...
Namespace for OpenFOAM.