rhoThermo.C
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) 2011-2021 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 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32  defineTypeNameAndDebug(rhoThermo, 0);
33  defineRunTimeSelectionTable(rhoThermo, fvMesh);
34 }
35 
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
40 (
41  const fvMesh& mesh,
42  const word& phaseName
43 )
44 :
45  rho_
46  (
47  IOobject
48  (
49  phasePropertyName("thermo:rho", phaseName),
50  mesh.time().timeName(),
51  mesh,
54  ),
55  mesh,
57  ),
58 
59  psi_
60  (
61  IOobject
62  (
63  phasePropertyName("thermo:psi", phaseName),
64  mesh.time().timeName(),
65  mesh,
68  ),
69  mesh,
70  dimensionSet(0, -2, 2, 0, 0)
71  ),
72 
73  mu_
74  (
75  IOobject
76  (
77  phasePropertyName("thermo:mu", phaseName),
78  mesh.time().timeName(),
79  mesh,
82  ),
83  mesh,
84  dimensionSet(1, -1, -1, 0, 0)
85  )
86 {}
87 
88 
90 (
91  const fvMesh& mesh,
92  const dictionary& dict,
93  const word& phaseName
94 )
95 :
96  rho_
97  (
98  IOobject
99  (
100  phasePropertyName("thermo:rho", phaseName),
101  mesh.time().timeName(),
102  mesh,
105  ),
106  mesh,
107  dimDensity
108  ),
109 
110  psi_
111  (
112  IOobject
113  (
114  phasePropertyName("thermo:psi", phaseName),
115  mesh.time().timeName(),
116  mesh,
119  ),
120  mesh,
121  dimensionSet(0, -2, 2, 0, 0)
122  ),
123 
124  mu_
125  (
126  IOobject
127  (
128  phasePropertyName("thermo:mu", phaseName),
129  mesh.time().timeName(),
130  mesh,
133  ),
134  mesh,
135  dimensionSet(1, -1, -1, 0, 0)
136  )
137 {}
138 
139 
140 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
141 
143 (
144  const fvMesh& mesh,
145  const word& phaseName
146 )
147 {
148  return basicThermo::New<rhoThermo>(mesh, phaseName);
149 }
150 
151 
152 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
153 
155 {}
156 
157 
159 {}
160 
161 
162 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
163 
165 {
166  return rho_;
167 }
168 
169 
171 (
172  const label patchi
173 ) const
174 {
175  return rho_.boundaryField()[patchi];
176 }
177 
178 
180 {
181  return rho_;
182 }
183 
184 
186 {
187  return rho_.oldTime();
188 }
189 
190 
192 {
193  rho_ += deltaRho;
194 }
195 
196 
198 {
199  return psi_;
200 }
201 
202 
204 {
205  return mu_;
206 }
207 
208 
210 (
211  const label patchi
212 ) const
213 {
214  return mu_.boundaryField()[patchi];
215 }
216 
217 
218 // ************************************************************************* //
virtual ~implementation()
Destructor.
Definition: rhoThermo.C:158
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: rhoThermo.C:197
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
static autoPtr< rhoThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: rhoThermo.C:143
virtual tmp< volScalarField > rho0() const
Old-time density [kg/m^3].
Definition: rhoThermo.C:185
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Definition: Time.C:636
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:239
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
Definition: rhoThermo.C:164
Dimension set for the base types.
Definition: dimensionSet.H:120
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
const dimensionSet dimDensity
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
implementation(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
Definition: rhoThermo.C:40
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: rhoThermo.C:203
label patchi
virtual ~rhoThermo()
Destructor.
Definition: rhoThermo.C:154
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
A class for managing temporary objects.
Definition: PtrList.H:53
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
virtual void correctRho(const volScalarField &deltaRho)
Add the given density correction to the density field.
Definition: rhoThermo.C:191
Namespace for OpenFOAM.