rhoThermo.C
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) 2011-2015 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 \*---------------------------------------------------------------------------*/
25 
26 #include "rhoThermo.H"
27 
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32  defineTypeNameAndDebug(rhoThermo, 0);
33  defineRunTimeSelectionTable(rhoThermo, fvMesh);
34 }
35 
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
39 Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const word& phaseName)
40 :
41  fluidThermo(mesh, phaseName),
42  rho_
43  (
44  IOobject
45  (
46  phasePropertyName("thermo:rho"),
47  mesh.time().timeName(),
48  mesh,
49  IOobject::NO_READ,
50  IOobject::NO_WRITE
51  ),
52  mesh,
54  ),
55 
56  psi_
57  (
58  IOobject
59  (
60  phasePropertyName("thermo:psi"),
61  mesh.time().timeName(),
62  mesh,
63  IOobject::NO_READ,
64  IOobject::NO_WRITE
65  ),
66  mesh,
67  dimensionSet(0, -2, 2, 0, 0)
68  ),
69 
70  mu_
71  (
72  IOobject
73  (
74  phasePropertyName("thermo:mu"),
75  mesh.time().timeName(),
76  mesh,
77  IOobject::NO_READ,
78  IOobject::NO_WRITE
79  ),
80  mesh,
81  dimensionSet(1, -1, -1, 0, 0)
82  )
83 {}
84 
85 
87 (
88  const fvMesh& mesh,
89  const dictionary& dict,
90  const word& phaseName
91 )
92 :
93  fluidThermo(mesh, dict, phaseName),
94  rho_
95  (
96  IOobject
97  (
98  phasePropertyName("thermo:rho"),
99  mesh.time().timeName(),
100  mesh,
103  ),
104  mesh,
105  dimDensity
106  ),
107 
108  psi_
109  (
110  IOobject
111  (
112  phasePropertyName("thermo:psi"),
113  mesh.time().timeName(),
114  mesh,
117  ),
118  mesh,
119  dimensionSet(0, -2, 2, 0, 0)
120  ),
121 
122  mu_
123  (
124  IOobject
125  (
126  phasePropertyName("thermo:mu"),
127  mesh.time().timeName(),
128  mesh,
131  ),
132  mesh,
133  dimensionSet(1, -1, -1, 0, 0)
134  )
135 {}
136 
137 
138 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
139 
141 (
142  const fvMesh& mesh,
143  const word& phaseName
144 )
145 {
146  return basicThermo::New<rhoThermo>(mesh, phaseName);
147 }
148 
149 
150 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
151 
153 {}
154 
155 
156 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
157 
159 {
160  return rho_;
161 }
162 
163 
165 {
166  return rho_.boundaryField()[patchi];
167 }
168 
169 
171 {
172  return rho_;
173 }
174 
175 
177 {
178  return psi_;
179 }
180 
181 
183 {
184  return mu_;
185 }
186 
187 
189 {
190  return mu_.boundaryField()[patchi];
191 }
192 
193 
194 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
static word phasePropertyName(const word &name, const word &phaseName)
Definition: basicThermo.H:179
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
static autoPtr< rhoThermo > New(const fvMesh &, const word &phaseName=word::null)
Selector.
Definition: rhoThermo.C:141
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Definition: Time.C:715
rhoThermo(const rhoThermo &)
Construct as copy (not implemented)
volScalarField rho_
Density field [kg/m^3].
Definition: rhoThermo.H:60
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: rhoThermo.C:182
Dimension set for the base types.
Definition: dimensionSet.H:118
volScalarField psi_
Compressibility [s^2/m^2].
Definition: rhoThermo.H:63
dynamicFvMesh & mesh
const Boundary & boundaryField() const
Return const-reference to the boundary field.
A class for handling words, derived from string.
Definition: word.H:59
Fundamental fluid thermodynamic properties.
Definition: fluidThermo.H:49
word timeName
Definition: getTimeIndex.H:3
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
const dimensionSet dimDensity
label patchi
virtual ~rhoThermo()
Destructor.
Definition: rhoThermo.C:152
volScalarField mu_
Dynamic viscosity [kg/m/s].
Definition: rhoThermo.H:66
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
A class for managing temporary objects.
Definition: PtrList.H:54
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
Definition: rhoThermo.C:158
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: rhoThermo.C:176
Namespace for OpenFOAM.
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:243
fluidThermo(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
Definition: fluidThermo.C:39