sensibleEnthalpy.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::sensibleEnthalpy
26 
27 Description
28  Thermodynamics mapping class to expose the sensible enthalpy functions.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef sensibleEnthalpy_H
33 #define sensibleEnthalpy_H
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
37 namespace Foam
38 {
39 
40 /*---------------------------------------------------------------------------*\
41  Class sensibleEnthalpy Declaration
42 \*---------------------------------------------------------------------------*/
43 
44 template<class Thermo>
45 class sensibleEnthalpy
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 "sensibleEnthalpy";
63  }
64 
65 
66  // Fundamental properties
67 
68  static bool enthalpy()
69  {
70  return true;
71  }
72 
73  static word energyName()
74  {
75  return "h";
76  }
77 
78  // Heat capacity at constant pressure [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.Cp(p, T);
87  }
88 
89  // Sensible enthalpy [J/kg]
90  scalar HE
91  (
92  const Thermo& thermo,
93  const scalar p,
94  const scalar T
95  ) const
96  {
97  return thermo.Hs(p, T);
98  }
99 
100  //- Temperature from sensible enthalpy
101  // given an initial temperature T0
102  scalar THE
103  (
104  const Thermo& thermo,
105  const scalar h,
106  const scalar p,
107  const scalar T0
108  ) const
109  {
110  return thermo.THs(h, p, T0);
111  }
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace Foam
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
Thermodynamics mapping class to expose the sensible enthalpy functions.
scalar HE(const Thermo &thermo, const scalar p, const scalar T) const
scalar THE(const Thermo &thermo, const scalar h, const scalar p, const scalar T0) const
Temperature from sensible enthalpy.
static word typeName()
Return the instantiated type name.
scalar Cpv(const Thermo &thermo, const scalar p, const scalar T) const
A class for handling words, derived from string.
Definition: word.H:62
const dimensionedScalar h
Planck constant.
Namespace for OpenFOAM.
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