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 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 
33  \table
34  Property | Description
35  Hf | Heat of formation
36  Sf | Standard entropy
37  Cv | Specific heat at constant volume 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  Cv
47  (
48  (200 1005)
49  (350 1010)
50  (400 1020)
51  );
52  }
53  \endverbatim
54 
55 SourceFiles
56  eIcoTabulatedThermoI.H
57  eIcoTabulatedThermo.C
58 
59 See also
60  Foam::Function1s::UniformTable
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef eIcoTabulatedThermo_H
65 #define eIcoTabulatedThermo_H
66 
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 
74 // Forward declaration of friend functions and operators
75 
76 template<class EquationOfState>
77 class eIcoTabulatedThermo;
78 
79 template<class EquationOfState>
80 Ostream& operator<<
81 (
82  Ostream&,
83  const eIcoTabulatedThermo<EquationOfState>&
84 );
85 
86 
87 /*---------------------------------------------------------------------------*\
88  Class eIcoTabulatedThermo Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 template<class EquationOfState>
93 :
94  public EquationOfState
95 {
97 
98 
99  // Private Data
100 
101  //- Heat of formation
102  scalar Hf_;
103 
104  //- Standard entropy
105  scalar Sf_;
106 
107  //- Specific heat at constant volume table [J/kg/K]
108  integratedNonUniformTable Cv_;
109 
110 
111 public:
112 
113  // Constructors
114 
115  //- Construct from dictionary
117 
118  //- Construct as a named copy
119  inline eIcoTabulatedThermo(const word&, const eIcoTabulatedThermo&);
120 
121 
122  // Member Functions
123 
124  //- Return the instantiated type name
125  static word typeName()
126  {
127  return "eIcoTabulated<" + EquationOfState::typeName() + '>';
128  }
129 
130  //- Limit the temperature to be in the range Tlow_ to Thigh_
131  inline scalar limit(const scalar) const;
132 
133 
134  // Fundamental properties
135 
136  //- Heat capacity at constant volume [J/kg/K]
137  inline scalar Cv(const scalar p, const scalar T) const;
138 
139  //- Sensible internal energy [J/kg]
140  inline scalar Es(const scalar p, const scalar T) const;
141 
142  //- Absolute internal energy [J/kg]
143  inline scalar Ea(const scalar p, const scalar T) const;
144 
145  //- Enthalpy of formation [J/kg]
146  inline scalar Hf() const;
147 
148  //- Entropy [J/kg/K]
149  inline scalar S(const scalar p, const scalar T) const;
150 
151  //- Gibbs free energy of the mixture in the standard state [J/kg]
152  inline scalar Gstd(const scalar T) const;
153 
154  #include "EtoHthermo.H"
155 
156 
157  // Derivative term used for Jacobian
158 
159  //- Temperature derivative of heat capacity at constant pressure
160  inline scalar dCpdT(const scalar p, const scalar T) const;
161 
162 
163  // I-O
164 
165  //- Write to Ostream
166  void write(Ostream& os) const;
167 
168 
169  // Ostream Operator
170 
171  friend Ostream& operator<< <EquationOfState>
172  (
173  Ostream&,
174  const eIcoTabulatedThermo&
175  );
176 };
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace Foam
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #include "eIcoTabulatedThermoI.H"
186 
187 #ifdef NoRepository
188  #include "eIcoTabulatedThermo.C"
189 #endif
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
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.