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-2022 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 {
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("rho", phaseName),
50  mesh.time().name(),
51  mesh,
52  IOobject::NO_READ,
53  IOobject::NO_WRITE
54  ),
55  mesh,
57  )
58 {}
59 
60 
61 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
62 
64 (
65  const fvMesh& mesh,
66  const word& phaseName
67 )
68 {
69  return basicThermo::New<rhoThermo>(mesh, phaseName);
70 }
71 
72 
73 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
74 
76 {}
77 
78 
80 {}
81 
82 
83 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
84 
86 {
87  return rho_;
88 }
89 
90 
92 (
93  const label patchi
94 ) const
95 {
96  return rho_.boundaryField()[patchi];
97 }
98 
99 
101 {
102  rho_.rename(phasePropertyName(Foam::typedName<rhoThermo>("rho")));
103  return rho_;
104 }
105 
106 
108 {
109  return rho_;
110 }
111 
112 
114 {
115  rho_ += deltaRho;
116 }
117 
118 
119 // ************************************************************************* //
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
static word phasePropertyName(const word &name, const word &phaseName)
Name of a property for a given phase.
Definition: basicThermo.H:150
virtual const fvMesh & mesh() const =0
Return const access to the mesh.
virtual const word & phaseName() const =0
Phase name.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
virtual tmp< volScalarField > renameRho()
Rename and return the thermodynamic density field [kg/m^3].
Definition: rhoThermo.C:100
virtual void correctRho(const volScalarField &deltaRho)
Add the given density correction to the density field.
Definition: rhoThermo.C:113
implementation(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
Definition: rhoThermo.C:40
virtual ~implementation()
Destructor.
Definition: rhoThermo.C:79
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
Definition: rhoThermo.C:85
Base-class for fluid thermodynamic properties based on density.
Definition: rhoThermo.H:55
virtual ~rhoThermo()
Destructor.
Definition: rhoThermo.C:75
static autoPtr< rhoThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: rhoThermo.C:64
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
label patchi
Namespace for OpenFOAM.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
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
const dimensionSet dimDensity
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47