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 // ************************************************************************* //
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::rhoThermo::rhoThermo
rhoThermo(const rhoThermo &)
Construct as copy (not implemented)
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::dimDensity
const dimensionSet dimDensity
Foam::defineRunTimeSelectionTable
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Foam::fluidThermo
Fundamental fluid thermodynamic properties.
Definition: fluidThermo.H:49
Foam::dimensionSet
Dimension set for the base types.
Definition: dimensionSet.H:116
Foam::rhoThermo::psi
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: rhoThermo.C:176
Foam::IOobject::NO_WRITE
@ NO_WRITE
Definition: IOobject.H:118
rhoThermo.H
Foam::label
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
Foam::IOobject::NO_READ
@ NO_READ
Definition: IOobject.H:111
Foam::rhoThermo::New
static autoPtr< rhoThermo > New(const fvMesh &, const word &phaseName=word::null)
Selector.
Definition: rhoThermo.C:141
Foam::rhoThermo::~rhoThermo
virtual ~rhoThermo()
Destructor.
Definition: rhoThermo.C:152
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::rhoThermo::mu
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: rhoThermo.C:182
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::autoPtr< Foam::rhoThermo >
Foam::rhoThermo::rho
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
Definition: rhoThermo.C:158
Foam::Time::timeName
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Definition: Time.C:741
patchi
label patchi
Definition: getPatchFieldScalar.H:1
timeName
word timeName
Definition: getTimeIndex.H:3
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:243
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)