absoluteEnthalpy.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2012-2017 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::absoluteEnthalpy
26 
27 Description
28  Thermodynamics mapping class to expose the absolute enthalpy functions.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef absoluteEnthalpy_H
33 #define absoluteEnthalpy_H
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
37 namespace Foam
38 {
39 
40 /*---------------------------------------------------------------------------*\
41  Class absoluteEnthalpy Declaration
42 \*---------------------------------------------------------------------------*/
43 
44 template<class Thermo>
45 class absoluteEnthalpy
46 {
47 
48 public:
49 
50  // Constructors
51 
52  //- Construct
54  {}
55 
56 
57  // Member Functions
58 
59  //- Return the instantiated type name
60  static word typeName()
61  {
62  return "absoluteEnthalpy";
63  }
64 
65  // Fundamental properties
66 
67  static word name()
68  {
69  return "ha";
70  }
71 
72  // Heat capacity at constant pressure [J/(kg K)]
73  scalar Cpv
74  (
75  const Thermo& thermo,
76  const scalar p,
77  const scalar T
78  ) const
79  {
80  return thermo.Cp(p, T);
81  }
82 
83  //- Cp/Cp []
84  scalar CpByCpv
85  (
86  const Thermo& thermo,
87  const scalar p,
88  const scalar T
89  ) const
90  {
91  return 1;
92  }
93 
94  // Absolute enthalpy [J/kg]
95  scalar HE
96  (
97  const Thermo& thermo,
98  const scalar p,
99  const scalar T
100  ) const
101  {
102  return thermo.Ha(p, T);
103  }
104 
105  //- Temperature from absolute enthalpy
106  // given an initial temperature T0
107  scalar THE
108  (
109  const Thermo& thermo,
110  const scalar h,
111  const scalar p,
112  const scalar T0
113  ) const
114  {
115  return thermo.THa(h, p, T0);
116  }
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #endif
127 
128 // ************************************************************************* //
absoluteEnthalpy()
Construct.
scalar Cpv(const Thermo &thermo, const scalar p, const scalar T) const
Thermodynamics mapping class to expose the absolute enthalpy functions.
A class for handling words, derived from string.
Definition: word.H:59
static word typeName()
Return the instantiated type name.
volScalarField & h
Planck constant.
scalar THE(const Thermo &thermo, const scalar h, const scalar p, const scalar T0) const
Temperature from absolute enthalpy.
scalar CpByCpv(const Thermo &thermo, const scalar p, const scalar T) const
Cp/Cp [].
scalar HE(const Thermo &thermo, const scalar p, const scalar T) const
Namespace for OpenFOAM.