thermophysicalPropertiesSelector.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) 2017-2018 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 the instantiated type name
84  static word typeName()
85  {
86  return
87  "thermophysicalPropertiesSelector<"
88  + ThermophysicalProperties::typeName
89  + '>';
90  }
91 
92  //- Return reference to the selected physical properties class
93  inline const ThermophysicalProperties& properties() const;
94 
95 
96  // Physical constants which define the specie
97 
98  //- Molecular weight [kg/kmol]
99  inline scalar W() const;
100 
101  //- Limit the temperature to be in the range Tlow_ to Thigh_
102  inline scalar limit(const scalar T) const;
103 
104 
105  // Fundamental equation of state properties
106 
107  //- Liquid density [kg/m^3]
108  inline scalar rho(scalar p, scalar T) const;
109 
110  //- Liquid compressibility rho/p [s^2/m^2]
111  // Note: currently it is assumed the liquid is incompressible
112  inline scalar psi(scalar p, scalar T) const;
113 
114  //- Return (Cp - Cv) [J/(kg K]
115  // Note: currently it is assumed the liquid is incompressible
116  // so CpMCv 0
117  inline scalar CpMCv(scalar p, scalar T) const;
118 
119 
120  // Fundamental thermodynamic properties
121 
122  //- Heat capacity at constant pressure [J/(kg K)]
123  inline scalar Cp(const scalar p, const scalar T) const;
124 
125  //- Absolute Enthalpy [J/kg]
126  inline scalar Ha(const scalar p, const scalar T) const;
127 
128  //- Sensible enthalpy [J/kg]
129  inline scalar Hs(const scalar p, const scalar T) const;
130 
131  //- Chemical enthalpy [J/kg]
132  inline scalar Hc() const;
133 
134  // Entropy [J/(kg K)]
135  inline scalar S(const scalar p, const scalar T) const;
136 
137 
138  // I-O
139 
140  //- Write to Ostream
141  void write(Ostream& os) const;
142 
143 
144  // Physical properties
145 
146  //- Liquid viscosity [Pa s]
147  inline scalar mu(scalar p, scalar T) const;
148 
149  //- Liquid thermal conductivity [W/(m K)]
150  inline scalar kappa(scalar p, scalar T) const;
151 
152  //- Liquid thermal diffusivity of enthalpy [kg/ms]
153  inline scalar alphah(const scalar p, const scalar T) const;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
164 
165 #ifdef NoRepository
167 #endif
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
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
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
static word typeName()
Return the instantiated type name.
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].
void write(Ostream &os) const
Write to Ostream.
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...