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-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::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 {
98  // Private Typedefs
99 
100  //- Table type
101  typedef Function1s::integratedNonUniformTable 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 volume table [J/kg/K]
114 
115 
116 public:
117 
118  // Constructors
119 
120  //- Construct from name and dictionary
121  eIcoTabulatedThermo(const word& name, const dictionary& dict);
122 
123  //- Construct as a named copy
124  inline eIcoTabulatedThermo(const word&, const eIcoTabulatedThermo&);
125 
126 
127  // Member Functions
128 
129  //- Return the instantiated type name
130  static word typeName()
131  {
132  return "eIcoTabulated<" + EquationOfState::typeName() + '>';
133  }
134 
135  //- Limit the temperature to be in the range Tlow_ to Thigh_
136  inline scalar limit(const scalar) const;
137 
138 
139  // Fundamental properties
140 
141  //- Heat capacity at constant volume [J/kg/K]
142  inline scalar Cv(const scalar p, const scalar T) const;
143 
144  //- Sensible internal energy [J/kg]
145  inline scalar Es(const scalar p, const scalar T) const;
146 
147  //- Absolute internal energy [J/kg]
148  inline scalar Ea(const scalar p, const scalar T) const;
149 
150  //- Enthalpy of formation [J/kg]
151  inline scalar Hf() const;
152 
153  //- Entropy [J/kg/K]
154  inline scalar S(const scalar p, const scalar T) const;
155 
156  //- Gibbs free energy of the mixture in the standard state [J/kg]
157  inline scalar Gstd(const scalar T) const;
158 
159  #include "EtoHthermo.H"
160 
161 
162  // Derivative term used for Jacobian
163 
164  //- Temperature derivative of heat capacity at constant pressure
165  inline scalar dCpdT(const scalar p, const scalar T) const;
166 
167 
168  // I-O
169 
170  //- Write to Ostream
171  void write(Ostream& os) const;
172 
173 
174  // Ostream Operator
175 
176  friend Ostream& operator<< <EquationOfState>
177  (
178  Ostream&,
179  const eIcoTabulatedThermo&
180  );
181 };
182 
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 } // End namespace Foam
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #include "eIcoTabulatedThermoI.H"
191 
192 #ifdef NoRepository
193  #include "eIcoTabulatedThermo.C"
194 #endif
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
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
Internal energy based thermodynamics package using non-uniform tabulated data for heat capacity vs te...
scalar Hf() const
Enthalpy of formation [J/kg].
eIcoTabulatedThermo(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.
void write(Ostream &os) const
Write to Ostream.
scalar S(const scalar p, const scalar T) const
Entropy [J/kg/K].
scalar Cv(const scalar p, const scalar T) const
Heat capacity at constant volume [J/kg/K].
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 Es(const scalar p, const scalar T) const
Sensible internal energy [J/kg].
scalar Ea(const scalar p, const scalar T) const
Absolute internal energy [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