thermophysicalPropertiesSelector.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::thermophysicalPropertiesSelector
28
29Description
30 Wrapper class providing run-time selection of thermophysicalProperties
31 for the templated thermodynamics packages.
32
33SourceFiles
34 thermophysicalPropertiesSelectorI.H
35 thermophysicalPropertiesSelector.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef thermophysicalPropertiesSelector_H
40#define thermophysicalPropertiesSelector_H
41
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class thermophysicalPropertiesSelector Declaration
51\*---------------------------------------------------------------------------*/
52
53template<class ThermophysicalProperties>
55{
56 // Private member data
57
59
60
61public:
62
63 // Constructors
64
65 //- Construct from name
67
68 //- Construct from dictionary
70
71
72 // Static data
73
74 //- Is the equation of state is incompressible i.e. rho != f(p)
75 static const bool incompressible =
76 ThermophysicalProperties::incompressible;
77
78 //- Is the equation of state is isochoric i.e. rho = const
79 static const bool isochoric =
80 ThermophysicalProperties::isochoric;
81
82
83 // Member Functions
84
85 //- Return the instantiated type name
86 static word typeName()
87 {
88 return
89 "thermophysicalPropertiesSelector<"
90 + ThermophysicalProperties::typeName
91 + '>';
92 }
93
94 //- Return reference to the selected physical properties class
95 inline const ThermophysicalProperties& properties() const;
96
97
98 // Physical constants which define the specie
99
100 //- Molecular weight [kg/kmol]
101 inline scalar W() const;
102
103 //- Limit temperature to be within the range
104 inline scalar limit(const scalar T) const;
105
106
107 // Fundamental equation of state properties
108
109 //- Liquid density [kg/m^3]
110 inline scalar rho(scalar p, scalar T) const;
111
112 //- Liquid compressibility rho/p [s^2/m^2]
113 // Note: currently it is assumed the liquid is incompressible
114 inline scalar psi(scalar p, scalar T) const;
115
116 //- Return (Cp - Cv) [J/(kg K]
117 // Note: currently it is assumed the liquid is incompressible
118 // so CpMCv 0
119 inline scalar CpMCv(scalar p, scalar T) const;
120
121
122 // Fundamental thermodynamic properties
123
124 //- Heat capacity at constant pressure [J/(kg K)]
125 inline scalar Cp(const scalar p, const scalar T) const;
126
127 //- Absolute Enthalpy [J/kg]
128 inline scalar Ha(const scalar p, const scalar T) const;
129
130 //- Sensible enthalpy [J/kg]
131 inline scalar Hs(const scalar p, const scalar T) const;
132
133 //- Chemical enthalpy [J/kg]
134 inline scalar Hc() const;
135
136 //- Heat capacity at constant volume [J/(kg K)]
137 inline scalar Cv(const scalar p, const scalar T) const;
138
139 //- Sensible internal energy [J/kg]
140 inline scalar Es(const scalar p, const scalar T) const;
141
142 //- Absolute internal energy [J/kg]
143 inline scalar Ea(const scalar p, const scalar T) const;
144
145 // Entropy [J/(kg K)]
146 inline scalar S(const scalar p, const scalar T) const;
147
148
149 // Physical properties
150
151 //- Liquid viscosity [Pa s]
152 inline scalar mu(scalar p, scalar T) const;
153
154 //- Liquid thermal conductivity [W/(m K)]
155 inline scalar kappa(scalar p, scalar T) const;
156
157 //- Liquid thermal diffusivity of enthalpy [kg/ms]
158 inline scalar alphah(const scalar p, const scalar T) const;
159};
160
161
162// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163
164} // End namespace Foam
165
166// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167
169
170#ifdef NoRepository
172#endif
173
174// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175
176#endif
177
178// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Wrapper class providing run-time selection of thermophysicalProperties for the templated thermodynami...
scalar limit(const scalar T) const
Limit temperature to be within the range.
scalar Hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
static word typeName()
Return the instantiated type name.
scalar Hc() const
Chemical enthalpy [J/kg].
scalar S(const scalar p, const scalar T) const
scalar Ha(const scalar p, const scalar T) const
Absolute Enthalpy [J/kg].
scalar kappa(scalar p, scalar T) const
Liquid thermal conductivity [W/(m K)].
scalar CpMCv(scalar p, scalar T) const
Return (Cp - Cv) [J/(kg K].
scalar alphah(const scalar p, const scalar T) const
Liquid thermal diffusivity of enthalpy [kg/ms].
const ThermophysicalProperties & properties() const
Return reference to the selected physical properties class.
scalar W() const
Molecular weight [kg/kmol].
static const bool isochoric
Is the equation of state is isochoric i.e. rho = const.
static const bool incompressible
Is the equation of state is incompressible i.e. rho != f(p)
scalar Es(const scalar p, const scalar T) const
Sensible internal energy [J/kg].
scalar Ea(const scalar p, const scalar T) const
Absolute internal energy [J/kg].
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
const volScalarField & psi
const volScalarField & T
const volScalarField & mu
const volScalarField & Cv
Definition: EEqn.H:8
const volScalarField & Cp
Definition: EEqn.H:7
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
dictionary dict