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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::thermophysicalPropertiesSelector
28 
29 Description
30  Wrapper class providing run-time selection of thermophysicalProperties
31  for the templated thermodynamics packages.
32 
33 SourceFiles
34  thermophysicalPropertiesSelectorI.H
35  thermophysicalPropertiesSelector.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef thermophysicalPropertiesSelector_H
40 #define thermophysicalPropertiesSelector_H
41 
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class thermophysicalPropertiesSelector Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class ThermophysicalProperties>
55 {
56  // Private member data
57 
58  autoPtr<ThermophysicalProperties> propertiesPtr_;
59 
60 
61 public:
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 // ************************************************************************* //
thermophysicalPropertiesSelector.C
Foam::thermophysicalPropertiesSelector::typeName
static word typeName()
Return the instantiated type name.
Definition: thermophysicalPropertiesSelector.H:85
p
volScalarField & p
Definition: createFieldRefs.H:8
thermophysicalProperties.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::thermophysicalPropertiesSelector::S
scalar S(const scalar p, const scalar T) const
Definition: thermophysicalPropertiesSelectorI.H:177
Foam::thermophysicalPropertiesSelector::mu
scalar mu(scalar p, scalar T) const
Liquid viscosity [Pa s].
Definition: thermophysicalPropertiesSelectorI.H:189
Foam::thermophysicalPropertiesSelector::Ea
scalar Ea(const scalar p, const scalar T) const
Absolute internal energy [J/kg].
Definition: thermophysicalPropertiesSelectorI.H:165
Foam::thermophysicalPropertiesSelector::Cv
scalar Cv(const scalar p, const scalar T) const
Heat capacity at constant volume [J/(kg K)].
Definition: thermophysicalPropertiesSelectorI.H:141
Foam::thermophysicalPropertiesSelector::psi
scalar psi(scalar p, scalar T) const
Liquid compressibility rho/p [s^2/m^2].
Definition: thermophysicalPropertiesSelectorI.H:73
Foam::thermophysicalPropertiesSelector::Hs
scalar Hs(const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
Definition: thermophysicalPropertiesSelectorI.H:121
Foam::thermophysicalPropertiesSelector::Es
scalar Es(const scalar p, const scalar T) const
Sensible internal energy [J/kg].
Definition: thermophysicalPropertiesSelectorI.H:153
Foam::thermophysicalPropertiesSelector::properties
const ThermophysicalProperties & properties() const
Return reference to the selected physical properties class.
Definition: thermophysicalPropertiesSelectorI.H:33
Foam::thermophysicalPropertiesSelector::limit
scalar limit(const scalar T) const
Limit temperature to be within the range.
Definition: thermophysicalPropertiesSelectorI.H:50
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::thermophysicalPropertiesSelector::Hc
scalar Hc() const
Chemical enthalpy [J/kg].
Definition: thermophysicalPropertiesSelectorI.H:132
Foam::thermophysicalPropertiesSelector::kappa
scalar kappa(scalar p, scalar T) const
Liquid thermal conductivity [W/(m K)].
Definition: thermophysicalPropertiesSelectorI.H:201
Foam::thermophysicalPropertiesSelector::alphah
scalar alphah(const scalar p, const scalar T) const
Liquid thermal diffusivity of enthalpy [kg/ms].
Definition: thermophysicalPropertiesSelectorI.H:213
Foam::thermophysicalPropertiesSelector::isochoric
static const bool isochoric
Is the equation of state is isochoric i.e. rho = const.
Definition: thermophysicalPropertiesSelector.H:78
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::thermophysicalPropertiesSelector::Cp
scalar Cp(const scalar p, const scalar T) const
Heat capacity at constant pressure [J/(kg K)].
Definition: thermophysicalPropertiesSelectorI.H:97
Foam::thermophysicalPropertiesSelector::incompressible
static const bool incompressible
Is the equation of state is incompressible i.e. rho != f(p)
Definition: thermophysicalPropertiesSelector.H:74
Foam::thermophysicalPropertiesSelector::CpMCv
scalar CpMCv(scalar p, scalar T) const
Return (Cp - Cv) [J/(kg K].
Definition: thermophysicalPropertiesSelectorI.H:85
Foam::thermophysicalPropertiesSelector::thermophysicalPropertiesSelector
thermophysicalPropertiesSelector(const word &name)
Construct from name.
Definition: thermophysicalPropertiesSelector.C:35
Foam::autoPtr< ThermophysicalProperties >
thermophysicalPropertiesSelectorI.H
Foam::thermophysicalPropertiesSelector::rho
scalar rho(scalar p, scalar T) const
Liquid density [kg/m^3].
Definition: thermophysicalPropertiesSelectorI.H:61
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::thermophysicalPropertiesSelector::Ha
scalar Ha(const scalar p, const scalar T) const
Absolute Enthalpy [J/kg].
Definition: thermophysicalPropertiesSelectorI.H:109
Foam::thermophysicalPropertiesSelector::W
scalar W() const
Molecular weight [kg/kmol].
Definition: thermophysicalPropertiesSelectorI.H:41
Foam::thermophysicalPropertiesSelector
Wrapper class providing run-time selection of thermophysicalProperties for the templated thermodynami...
Definition: thermophysicalPropertiesSelector.H:53