rhoThermo.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2017 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::rhoThermo
29
30Group
31 grpRhoThermo
32
33Description
34 Basic thermodynamic properties based on density
35
36SourceFiles
37 rhoThermo.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef rhoThermo_H
42#define rhoThermo_H
43
44#include "fluidThermo.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class rhoThermo Declaration
54\*---------------------------------------------------------------------------*/
56class rhoThermo
57:
58 public fluidThermo
59{
60
61protected:
62
63 // Protected data
64
65 //- Density field [kg/m^3]
66 // Named 'rhoThermo' to avoid (potential) conflict with solver density
68
69 //- Compressibility [s^2/m^2]
71
72 //- Dynamic viscosity [kg/m/s]
74
75
76 // Protected Member Functions
77
78 //- Construct as copy (not implemented)
79 rhoThermo(const rhoThermo&);
80
81
82public:
83
84 //- Runtime type information
85 TypeName("rhoThermo");
86
87
88 //- Declare run-time constructor selection table
90 (
91 autoPtr,
93 fvMesh,
94 (const fvMesh& mesh, const word& phaseName),
95 (mesh, phaseName)
96 );
97
98
99 //- Declare run-time constructor selection table for dictionary based
101 (
102 autoPtr,
103 rhoThermo,
104 fvMeshDictPhase,
105 (const fvMesh& mesh, const word& phaseName, const word& dictName),
106 (mesh, phaseName, dictName)
107 );
108
109
110 // Constructors
111
112 //- Construct from mesh and phase name
114 (
115 const fvMesh&,
116 const word& phaseName
117 );
118
119 //- Construct from mesh, dictionary and phase name
121 (
122 const fvMesh&,
123 const dictionary&,
124 const word& phaseName
125 );
126
127 //- Construct from mesh,dictionary,phase name with a single temperature
129 (
130 const fvMesh&,
131 const word& phaseName,
132 const word& dictionaryName
133 );
134
135
136 //- Selector
138 (
139 const fvMesh&,
140 const word& phaseName=word::null
141 );
142
143
144 //- Selector
146 (
147 const fvMesh&,
148 const word& phaseName,
149 const word& dictName
150 );
151
152
153 //- Destructor
154 virtual ~rhoThermo();
155
156
157 // Member functions
158
159 // Fields derived from thermodynamic state variables
160
161 //- Density [kg/m^3]
162 virtual tmp<volScalarField> rho() const;
163
164 //- Density for patch [kg/m^3]
165 virtual tmp<scalarField> rho(const label patchi) const;
166
167 //- Return non-const access to the local density field [kg/m^3]
168 virtual volScalarField& rho();
169
170 //- Add the given density correction to the density field.
171 // Used to update the density field following pressure solution
172 // Limit thermo rho between rhoMin and rhoMax
173 virtual void correctRho
174 (
175 const volScalarField& deltaRho,
178 );
179
180 //- Add the given density correction to the density field.
181 // Used to update the density field following pressure solution
182 virtual void correctRho(const volScalarField& deltaRho);
183
184 //- Compressibility [s^2/m^2]
185 virtual const volScalarField& psi() const;
186
187
188 // Access to transport state variables
189
190 //- Dynamic viscosity of mixture [kg/m/s]
191 virtual tmp<volScalarField> mu() const;
192
193 //- Dynamic viscosity of mixture for patch [kg/m/s]
194 virtual tmp<scalarField> mu(const label patchi) const;
195};
196
197
198// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199
200} // End namespace Foam
201
202// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203
204#endif
205
206// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
static const word dictName
Definition: basicThermo.H:256
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Fundamental fluid thermodynamic properties.
Definition: fluidThermo.H:56
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Basic thermodynamic properties based on density.
Definition: rhoThermo.H:58
volScalarField rho_
Density field [kg/m^3].
Definition: rhoThermo.H:66
declareRunTimeSelectionTable(autoPtr, rhoThermo, fvMeshDictPhase,(const fvMesh &mesh, const word &phaseName, const word &dictName),(mesh, phaseName, dictName))
Declare run-time constructor selection table for dictionary based.
rhoThermo(const rhoThermo &)
Construct as copy (not implemented)
virtual ~rhoThermo()
Destructor.
Definition: rhoThermo.C:218
declareRunTimeSelectionTable(autoPtr, rhoThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))
Declare run-time constructor selection table.
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: rhoThermo.C:266
static autoPtr< rhoThermo > New(const fvMesh &, const word &phaseName=word::null)
Selector.
Definition: rhoThermo.C:197
volScalarField mu_
Dynamic viscosity [kg/m/s].
Definition: rhoThermo.H:72
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
Definition: rhoThermo.C:224
volScalarField psi_
Compressibility [s^2/m^2].
Definition: rhoThermo.H:69
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: rhoThermo.C:260
virtual void correctRho(const volScalarField &deltaRho, const dimensionedScalar &rhoMin, const dimensionedScalar &rhoMax)
Add the given density correction to the density field.
Definition: rhoThermo.C:243
TypeName("rhoThermo")
Runtime type information.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
const dimensionedScalar rhoMin
const dimensionedScalar rhoMax
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73