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 
89 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
90 
92 (
93  const fvMesh& mesh,
94  const word& phaseName
95 )
96 {
97  return basicThermo::New<rhoThermo>(mesh, phaseName);
98 }
99 
100 
101 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
102 
104 {}
105 
106 
108 {}
109 
110 
111 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
112 
114 {
115  return rho_;
116 }
117 
118 
120 (
121  const label patchi
122 ) const
123 {
124  return rho_.boundaryField()[patchi];
125 }
126 
127 
129 {
130  return rho_;
131 }
132 
133 
135 {
136  return rho_.oldTime();
137 }
138 
139 
141 {
142  rho_ += deltaRho;
143 }
144 
145 
147 {
148  return psi_;
149 }
150 
151 
153 {
154  return mu_;
155 }
156 
157 
159 (
160  const label patchi
161 ) const
162 {
163  return mu_.boundaryField()[patchi];
164 }
165 
166 
167 // ************************************************************************* //
virtual ~implementation()
Destructor.
Definition: rhoThermo.C:107
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: rhoThermo.C:146
static autoPtr< rhoThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: rhoThermo.C:92
virtual tmp< volScalarField > rho0() const
Old-time density [kg/m^3].
Definition: rhoThermo.C:134
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:372
fvMesh & mesh
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
Definition: rhoThermo.C:113
Dimension set for the base types.
Definition: dimensionSet.H:121
static word timeName(const scalar, const int precision=curPrecision_)
Return time name of given scalar time.
Definition: Time.C:666
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:152
label patchi
virtual ~rhoThermo()
Destructor.
Definition: rhoThermo.C:103
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
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:98
virtual void correctRho(const volScalarField &deltaRho)
Add the given density correction to the density field.
Definition: rhoThermo.C:140
Namespace for OpenFOAM.