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-2018 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 word energyName()
69  {
70  return "e";
71  }
72 
73  //- Heat capacity at constant volume [J/(kg K)]
74  scalar Cpv
75  (
76  const Thermo& thermo,
77  const scalar p,
78  const scalar T
79  ) const
80  {
81  return thermo.Cv(p, T);
82  }
83 
84  //- Cp/Cv []
85  scalar CpByCpv
86  (
87  const Thermo& thermo,
88  const scalar p,
89  const scalar T
90  ) const
91  {
92  return thermo.gamma(p, T);
93  }
94 
95  //- Sensible internal energy [J/kg]
96  scalar HE
97  (
98  const Thermo& thermo,
99  const scalar p,
100  const scalar T
101  ) const
102  {
103  return thermo.Es(p, T);
104  }
105 
106  //- Temperature from sensible internal energy
107  // given an initial temperature T0
108  scalar THE
109  (
110  const Thermo& thermo,
111  const scalar e,
112  const scalar p,
113  const scalar T0
114  ) const
115  {
116  return thermo.TEs(e, p, T0);
117  }
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
scalar CpByCpv(const Thermo &thermo, const scalar p, const scalar T) const
Cp/Cv [].
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:98
Namespace for OpenFOAM.