sensibleInternalEnergy.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-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::sensibleInternalEnergy
26 
27 Description
28  Thermodynamics mapping class to expose the sensible internal energy
29  functions.
30 
31 \*---------------------------------------------------------------------------*/
32 
33 #ifndef sensibleInternalEnergy_H
34 #define sensibleInternalEnergy_H
35 
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 
38 namespace Foam
39 {
40 
41 /*---------------------------------------------------------------------------*\
42  Class sensibleInternalEnergy 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 "sensibleInternalEnergy";
64  }
65 
66  // Fundamental properties
67 
68  static bool enthalpy()
69  {
70  return false;
71  }
72 
73  static word energyName()
74  {
75  return "e";
76  }
77 
78  //- Heat capacity at constant volume [J/kg/K]
79  scalar Cpv
80  (
81  const Thermo& thermo,
82  const scalar p,
83  const scalar T
84  ) const
85  {
86  return thermo.Cv(p, T);
87  }
88 
89  //- Sensible internal energy [J/kg]
90  scalar HE
91  (
92  const Thermo& thermo,
93  const scalar p,
94  const scalar T
95  ) const
96  {
97  return thermo.Es(p, T);
98  }
99 
100  //- Temperature from sensible internal energy
101  // given an initial temperature T0
102  scalar THE
103  (
104  const Thermo& thermo,
105  const scalar e,
106  const scalar p,
107  const scalar T0
108  ) const
109  {
110  return thermo.TEs(e, p, T0);
111  }
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace Foam
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
scalar Cpv(const Thermo &thermo, const scalar p, const scalar T) const
Heat capacity at constant volume [J/kg/K].
scalar HE(const Thermo &thermo, const scalar p, const scalar T) const
Sensible internal energy [J/kg].
A class for handling words, derived from string.
Definition: word.H:59
scalar THE(const Thermo &thermo, const scalar e, const scalar p, const scalar T0) const
Temperature from sensible internal energy.
static word typeName()
Return the instantiated type name.
Thermodynamics mapping class to expose the sensible internal energy functions.
const doubleScalar e
Elementary charge.
Definition: doubleScalar.H:105
Namespace for OpenFOAM.
scalar T0
Definition: createFields.H:22