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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::rhoThermo
29 
30 Group
31  grpRhoThermo
32 
33 Description
34  Basic thermodynamic properties based on density
35 
36 SourceFiles
37  rhoThermo.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef rhoThermo_H
42 #define rhoThermo_H
43 
44 #include "fluidThermo.H"
45 #include "runTimeSelectionTables.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class rhoThermo Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class rhoThermo
57 :
58  public fluidThermo
59 {
60 
61 protected:
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 
82 public:
83 
84  //- Runtime type information
85  TypeName("rhoThermo");
86 
87 
88  //- Declare run-time constructor selection table
90  (
91  autoPtr,
92  rhoThermo,
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
113  rhoThermo
114  (
115  const fvMesh&,
116  const word& phaseName
117  );
118 
119  //- Construct from mesh, dictionary and phase name
120  rhoThermo
121  (
122  const fvMesh&,
123  const dictionary&,
124  const word& phaseName
125  );
126 
127  //- Construct from mesh,dictionary,phase name with a single temperature
128  rhoThermo
129  (
130  const fvMesh&,
131  const word& phaseName,
132  const word& dictionaryName
133  );
134 
135 
136  //- Selector
137  static autoPtr<rhoThermo> New
138  (
139  const fvMesh&,
140  const word& phaseName=word::null
141  );
142 
143 
144  //- Selector
145  static autoPtr<rhoThermo> New
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,
176  const dimensionedScalar& rhoMin,
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 // ************************************************************************* //
Foam::rhoThermo::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, rhoThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))
Declare run-time constructor selection table.
Foam::rhoThermo::rhoThermo
rhoThermo(const rhoThermo &)
Construct as copy (not implemented)
Foam::rhoThermo::correctRho
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
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
fluidThermo.H
Foam::fluidThermo
Fundamental fluid thermodynamic properties.
Definition: fluidThermo.H:52
Foam::rhoThermo::psi
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: rhoThermo.C:260
Foam::rhoThermo
Basic thermodynamic properties based on density.
Definition: rhoThermo.H:55
Foam::rhoThermo::rho
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
Definition: rhoThermo.C:224
Foam::rhoThermo::New
static autoPtr< rhoThermo > New(const fvMesh &, const word &phaseName=word::null)
Selector.
Definition: rhoThermo.C:197
rhoMin
const dimensionedScalar rhoMin
Definition: setRegionFluidFields.H:67
Foam::rhoThermo::~rhoThermo
virtual ~rhoThermo()
Destructor.
Definition: rhoThermo.C:218
Foam::rhoThermo::mu_
volScalarField mu_
Dynamic viscosity [kg/m/s].
Definition: rhoThermo.H:72
Foam::rhoThermo::TypeName
TypeName("rhoThermo")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::rhoThermo::psi_
volScalarField psi_
Compressibility [s^2/m^2].
Definition: rhoThermo.H:69
Foam::rhoThermo::rho_
volScalarField rho_
Density field [kg/m^3].
Definition: rhoThermo.H:66
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::dimensioned< scalar >
Foam::rhoThermo::mu
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: rhoThermo.C:266
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
rhoMax
const dimensionedScalar rhoMax
Definition: setRegionFluidFields.H:66
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::word::null
static const word null
An empty word.
Definition: word.H:80
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::dictionary::dictName
word dictName() const
The local dictionary name (final part of scoped name)
Definition: dictionaryI.H:60