rhoThermo.H
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-2018 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 Class
25  Foam::rhoThermo
26 
27 Description
28  Basic thermodynamic properties based on density
29 
30 SourceFiles
31  rhoThermo.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef rhoThermo_H
36 #define rhoThermo_H
37 
38 #include "fluidThermo.H"
39 #include "runTimeSelectionTables.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class rhoThermo Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class rhoThermo
51 :
52  public fluidThermo
53 {
54 
55 protected:
56 
57  // Protected data
58 
59  //- Density field [kg/m^3]
60  // Named 'rhoThermo' to avoid (potential) conflict with solver density
62 
63  //- Compressibility [s^2/m^2]
65 
66  //- Dynamic viscosity [kg/m/s]
68 
69 
70  // Protected Member Functions
71 
72  //- Construct as copy (not implemented)
73  rhoThermo(const rhoThermo&);
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("rhoThermo");
80 
81 
82  //- Declare run-time constructor selection table
84  (
85  autoPtr,
86  rhoThermo,
87  fvMesh,
88  (const fvMesh& mesh, const word& phaseName),
89  (mesh, phaseName)
90  );
91 
92 
93  // Constructors
94 
95  //- Construct from mesh and phase name
96  rhoThermo
97  (
98  const fvMesh&,
99  const word& phaseName
100  );
101 
102  //- Construct from mesh, dictionary and phase name
103  rhoThermo
104  (
105  const fvMesh&,
106  const dictionary&,
107  const word& phaseName
108  );
109 
110 
111  //- Selector
112  static autoPtr<rhoThermo> New
113  (
114  const fvMesh&,
115  const word& phaseName=word::null
116  );
117 
118 
119  //- Destructor
120  virtual ~rhoThermo();
121 
122 
123  // Member functions
124 
125  // Fields derived from thermodynamic state variables
126 
127  //- Density [kg/m^3]
128  virtual tmp<volScalarField> rho() const;
129 
130  //- Density for patch [kg/m^3]
131  virtual tmp<scalarField> rho(const label patchi) const;
132 
133  //- Return non-const access to the local density field [kg/m^3]
134  virtual volScalarField& rho();
135 
136  //- Add the given density correction to the density field.
137  // Used to update the density field following pressure solution
138  virtual void correctRho(const volScalarField& deltaRho);
139 
140  //- Compressibility [s^2/m^2]
141  virtual const volScalarField& psi() const;
142 
143 
144  // Access to transport state variables
145 
146  //- Dynamic viscosity of mixture [kg/m/s]
147  virtual tmp<volScalarField> mu() const;
148 
149  //- Dynamic viscosity of mixture for patch [kg/m/s]
150  virtual tmp<scalarField> mu(const label patchi) const;
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #endif
161 
162 // ************************************************************************* //
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:137
static autoPtr< rhoThermo > New(const fvMesh &, const word &phaseName=word::null)
Selector.
Definition: rhoThermo.C:141
TypeName("rhoThermo")
Runtime type information.
rhoThermo(const rhoThermo &)
Construct as copy (not implemented)
volScalarField rho_
Density field [kg/m^3].
Definition: rhoThermo.H:60
volScalarField psi_
Compressibility [s^2/m^2].
Definition: rhoThermo.H:63
dynamicFvMesh & mesh
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: rhoThermo.C:182
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: rhoThermo.C:188
A class for handling words, derived from string.
Definition: word.H:59
Fundamental fluid thermodynamic properties.
Definition: fluidThermo.H:49
static const word null
An empty word.
Definition: word.H:77
virtual void correctRho(const volScalarField &deltaRho)
Add the given density correction to the density field.
Definition: rhoThermo.C:176
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
Definition: rhoThermo.C:158
label patchi
declareRunTimeSelectionTable(autoPtr, rhoThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))
Declare run-time constructor selection table.
virtual ~rhoThermo()
Destructor.
Definition: rhoThermo.C:152
volScalarField mu_
Dynamic viscosity [kg/m/s].
Definition: rhoThermo.H:66
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Basic thermodynamic properties based on density.
Definition: rhoThermo.H:49
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Macros to ease declaration of run-time selection tables.
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.