All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 | Copyright (C) 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::thermophysicalPropertiesSelector
26 
27 Description
28  Wrapper class providing run-time selection of thermophysicalProperties
29  for the templated thermodynamics packages.
30 
31 SourceFiles
32  thermophysicalPropertiesSelectorI.H
33  thermophysicalPropertiesSelector.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef thermophysicalPropertiesSelector_H
38 #define thermophysicalPropertiesSelector_H
39 
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class thermophysicalPropertiesSelector Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class ThermophysicalProperties>
53 {
54  // Private member data
55 
56  autoPtr<ThermophysicalProperties> propertiesPtr_;
57 
58 
59 public:
60 
61  // Constructors
62 
63  //- Construct from name
65 
66  //- Construct from dictionary
68 
69 
70  // Static data
71 
72  //- Is the equation of state is incompressible i.e. rho != f(p)
73  static const bool incompressible =
74  ThermophysicalProperties::incompressible;
75 
76  //- Is the equation of state is isochoric i.e. rho = const
77  static const bool isochoric =
78  ThermophysicalProperties::isochoric;
79 
80 
81  // Member Functions
82 
83  //- Return reference to the selected physical properties class
84  inline const ThermophysicalProperties& properties() const;
85 
86 
87  // Physical constants which define the specie
88 
89  //- Molecular weight [kg/kmol]
90  inline scalar W() const;
91 
92  //- Limit the temperature to be in the range Tlow_ to Thigh_
93  inline scalar limit(const scalar T) const;
94 
95 
96  // Fundamental equation of state properties
97 
98  //- Liquid density [kg/m^3]
99  inline scalar rho(scalar p, scalar T) const;
100 
101  //- Liquid compressibility rho/p [s^2/m^2]
102  // Note: currently it is assumed the liquid is incompressible
103  inline scalar psi(scalar p, scalar T) const;
104 
105  //- Return (Cp - Cv) [J/(kg K]
106  // Note: currently it is assumed the liquid is incompressible
107  // so CpMCv 0
108  inline scalar CpMCv(scalar p, scalar T) const;
109 
110 
111  // Fundamental thermodynamic properties
112 
113  //- Heat capacity at constant pressure [J/(kg K)]
114  inline scalar Cp(const scalar p, const scalar T) const;
115 
116  //- Absolute Enthalpy [J/kg]
117  inline scalar Ha(const scalar p, const scalar T) const;
118 
119  //- Sensible enthalpy [J/kg]
120  inline scalar Hs(const scalar p, const scalar T) const;
121 
122  //- Chemical enthalpy [J/kg]
123  inline scalar Hc() const;
124 
125  // Entropy [J/(kg K)]
126  inline scalar S(const scalar p, const scalar T) const;
127 
128 
129  // Physical properties
130 
131  //- Liquid viscosity [Pa s]
132  inline scalar mu(scalar p, scalar T) const;
133 
134  //- Liquid thermal conductivity [W/(m K)]
135  inline scalar kappa(scalar p, scalar T) const;
136 
137  //- Liquid thermal diffusivity of enthalpy [kg/ms]
138  inline scalar alphah(const scalar p, const scalar T) const;
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
149 
150 #ifdef NoRepository
152 #endif
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
dictionary dict
scalar kappa(scalar p, scalar T) const
Liquid thermal conductivity [W/(m K)].
scalar Cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/(kg K)].
static const bool incompressible
Is the equation of state is incompressible i.e. rho != f(p)
thermophysicalPropertiesSelector(const word &name)
Construct from name.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
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].
scalar rho(scalar p, scalar T) const
Liquid density [kg/m^3].
scalar W() const
Molecular weight [kg/kmol].
A class for handling words, derived from string.
Definition: word.H:59
scalar Ha(const scalar p, const scalar T) const
Absolute Enthalpy [J/kg].
scalar S(const scalar p, const scalar T) const
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
scalar psi(scalar p, scalar T) const
Liquid compressibility rho/p [s^2/m^2].
const ThermophysicalProperties & properties() const
Return reference to the selected physical properties class.
scalar mu(scalar p, scalar T) const
Liquid viscosity [Pa s].
scalar limit(const scalar T) const
Limit the temperature to be in the range Tlow_ to Thigh_.
volScalarField & p
static const bool isochoric
Is the equation of state is isochoric i.e. rho = const.
scalar Hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
Namespace for OpenFOAM.
scalar Hc() const
Chemical enthalpy [J/kg].
Wrapper class providing run-time selection of thermophysicalProperties for the templated thermodynami...