fluidThermo.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) 2012-2023 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::fluidThermo
26 
27 Description
28  Base-class for fluid thermodynamic properties.
29 
30 See also
31  Foam::basicThermo
32 
33 SourceFiles
34  fluidThermo.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef fluidThermo_H
39 #define fluidThermo_H
40 
41 #include "basicThermo.H"
42 #include "viscosity.H"
43 #include "viscosity.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class fluidThermo Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class fluidThermo
55 :
56  virtual public basicThermo,
57  public viscosity
58 {
59 public:
60 
61  // Public Classes
62 
63  //- Forward declare the implementation class
64  class implementation;
65 
66 
67  //- Runtime type information
68  TypeName("fluidThermo");
69 
70 
71  //- Declare run-time constructor selection table
73  (
74  autoPtr,
76  fvMesh,
77  (const fvMesh& mesh, const word& phaseName),
78  (mesh, phaseName)
79  );
80 
81 
82  // Selectors
83 
84  //- Standard selection based on fvMesh
86  (
87  const fvMesh&,
89  );
90 
91 
92  //- Destructor
93  virtual ~fluidThermo();
94 
95 
96  // Member Functions
97 
98  // Thermodynamic state
99 
100  //- Pressure [Pa]
101  virtual const volScalarField& p() const = 0;
102 
103  //- Pressure [Pa]
104  // Non-const access allowed for transport equations
105  virtual volScalarField& p() = 0;
106 
107  //- Compressibility [s^2/m^2]
108  virtual const volScalarField& psi() const = 0;
109 
110 
111  // Derived thermodynamic properties
112 
113  //- Rename the thermodynamic density field if stored and return
114  // This is used by solvers which create a separate continuity rho
115  // [kg/m^3]
116  virtual tmp<volScalarField> renameRho() = 0;
117 
118  //- Add the given density correction to the density field.
119  // Used to update the density field following pressure solution
120  virtual void correctRho(const volScalarField& deltaRho) = 0;
121 
122 
123  // Transport state
124 
125  //- Dynamic viscosity of mixture [kg/m/s]
126  virtual const volScalarField& mu() const = 0;
127 
128 
129  // Derived transport properties
130 
131  //- Kinematic viscosity of mixture [m^2/s]
132  tmp<volScalarField> nu() const;
133 
134  //- Kinematic viscosity of mixture for patch [m^2/s]
135  tmp<scalarField> nu(const label patchi) const;
136 };
137 
138 
139 /*---------------------------------------------------------------------------*\
140  Class fluidThermo::implementation Declaration
141 \*---------------------------------------------------------------------------*/
142 
144 :
145  virtual public fluidThermo
146 {
147 protected:
148 
149  // Protected data
150 
151  // Fields
152 
153  //- Pressure [Pa]
155 
156  //- Compressibility [s^2/m^2]
158 
159  //- Dynamic viscosity [kg/m/s]
161 
162 
163 public:
164 
165  // Constructors
166 
167  //- Construct from dictionary, mesh and phase name
168  implementation(const dictionary&, const fvMesh&, const word&);
169 
170  //- Disallow default bitwise copy construction
171  implementation(const implementation&) = delete;
172 
173 
174  //- Destructor
175  virtual ~implementation();
176 
177 
178  // Member Functions
179 
180  // Thermodynamic state
181 
182  //- Pressure [Pa]
183  virtual const volScalarField& p() const;
184 
185  //- Pressure [Pa]
186  // Non-const access allowed for transport equations
187  virtual volScalarField& p();
188 
189  //- Compressibility [s^2/m^2]
190  virtual const volScalarField& psi() const;
191 
192 
193  // Transport state
194 
195  //- Dynamic viscosity of mixture [kg/m/s]
196  virtual const volScalarField& mu() const;
197 
198 
199  // Member Operators
200 
201  //- Disallow default bitwise assignment
202  void operator=(const implementation&) = delete;
203 };
204 
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 } // End namespace Foam
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #endif
213 
214 // ************************************************************************* //
Generic GeometricField class.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:78
virtual const fvMesh & mesh() const =0
Return const access to the mesh.
virtual const word & phaseName() const =0
Phase name.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
virtual ~implementation()
Destructor.
Definition: fluidThermo.C:96
implementation(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
Definition: fluidThermo.C:40
volScalarField & p_
Pressure [Pa].
Definition: fluidThermo.H:153
void operator=(const implementation &)=delete
Disallow default bitwise assignment.
volScalarField mu_
Dynamic viscosity [kg/m/s].
Definition: fluidThermo.H:159
volScalarField psi_
Compressibility [s^2/m^2].
Definition: fluidThermo.H:156
virtual const volScalarField & p() const
Pressure [Pa].
Definition: fluidThermo.C:115
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: fluidThermo.C:127
virtual const volScalarField & mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: fluidThermo.C:133
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:57
declareRunTimeSelectionTable(autoPtr, fluidThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))
Declare run-time constructor selection table.
virtual tmp< volScalarField > renameRho()=0
Rename the thermodynamic density field if stored and return.
virtual void correctRho(const volScalarField &deltaRho)=0
Add the given density correction to the density field.
virtual const volScalarField & p() const =0
Pressure [Pa].
virtual const volScalarField & mu() const =0
Dynamic viscosity of mixture [kg/m/s].
tmp< volScalarField > nu() const
Kinematic viscosity of mixture [m^2/s].
Definition: fluidThermo.C:102
TypeName("fluidThermo")
Runtime type information.
virtual const volScalarField & psi() const =0
Compressibility [s^2/m^2].
virtual ~fluidThermo()
Destructor.
Definition: fluidThermo.C:92
static autoPtr< fluidThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: fluidThermo.C:81
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
A class for handling words, derived from string.
Definition: word.H:62
static const word null
An empty word.
Definition: word.H:77
label patchi
Namespace for OpenFOAM.
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