absoluteInternalEnergy.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) 2012-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::absoluteInternalEnergy
26 
27 Description
28  Thermodynamics mapping class to expose the absolute internal energy
29  functions.
30 
31 \*---------------------------------------------------------------------------*/
32 
33 #ifndef absoluteInternalEnergy_H
34 #define absoluteInternalEnergy_H
35 
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 
38 namespace Foam
39 {
40 
41 /*---------------------------------------------------------------------------*\
42  Class absoluteInternalEnergy Declaration
43 \*---------------------------------------------------------------------------*/
44 
45 template<class Thermo>
47 {
48 
49 public:
50 
51  // Constructors
52 
53  //- Construct
55  {}
56 
57 
58  // Member Functions
59 
60  //- Return the instantiated type name
61  static word typeName()
62  {
63  return "absoluteInternalEnergy";
64  }
65 
66 
67  // Fundamental properties
68 
69  static bool enthalpy()
70  {
71  return false;
72  }
73 
74  static word energyName()
75  {
76  return "ea";
77  }
78 
79  // Heat capacity at constant volume [J/kg/K]
80  scalar Cpv
81  (
82  const Thermo& thermo,
83  const scalar p,
84  const scalar T
85  ) const
86  {
87  return thermo.Cv(p, T);
88  }
89 
90  // Absolute internal energy [J/kg]
91  scalar he
92  (
93  const Thermo& thermo,
94  const scalar p,
95  const scalar T
96  ) const
97  {
98  return thermo.ea(p, T);
99  }
100 
101  //- Temperature from absolute internal energy
102  // given an initial temperature T0
103  scalar The
104  (
105  const Thermo& thermo,
106  const scalar e,
107  const scalar p,
108  const scalar T0
109  ) const
110  {
111  return thermo.Tea(e, p, T0);
112  }
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace Foam
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #endif
123 
124 // ************************************************************************* //
Thermodynamics mapping class to expose the absolute internal energy functions.
static word typeName()
Return the instantiated type name.
scalar he(const Thermo &thermo, const scalar p, const scalar T) const
scalar Cpv(const Thermo &thermo, const scalar p, const scalar T) const
scalar The(const Thermo &thermo, const scalar e, const scalar p, const scalar T0) const
Temperature from absolute internal energy.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
const doubleScalar e
Definition: doubleScalar.H:106
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
volScalarField & p
fluidMulticomponentThermo & thermo
Definition: createFields.H:31
scalar T0
Definition: createFields.H:22