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-2024 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 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class fluidThermo Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class fluidThermo
54 :
55  virtual public basicThermo,
56  public viscosity
57 {
58 public:
59 
60  // Public Classes
61 
62  //- Forward declare the implementation class
63  class implementation;
64 
65 
66  //- Runtime type information
67  TypeName("fluidThermo");
68 
69 
70  //- Declare run-time constructor selection table
72  (
73  autoPtr,
75  fvMesh,
76  (const fvMesh& mesh, const word& phaseName),
77  (mesh, phaseName)
78  );
79 
80 
81  // Selectors
82 
83  //- Standard selection based on fvMesh
85  (
86  const fvMesh&,
88  );
89 
90 
91  //- Destructor
92  virtual ~fluidThermo();
93 
94 
95  // Member Functions
96 
97  // Thermodynamic state
98 
99  //- Pressure [Pa]
100  virtual const volScalarField& p() const = 0;
101 
102  //- Pressure [Pa]
103  // Non-const access allowed for transport equations
104  virtual volScalarField& p() = 0;
105 
106  //- Compressibility [s^2/m^2]
107  virtual const volScalarField& psi() const = 0;
108 
109 
110  // Derived thermodynamic properties
111 
112  //- Rename the thermodynamic density field if stored and return
113  // This is used by solvers which create a separate continuity rho
114  // [kg/m^3]
115  virtual tmp<volScalarField> renameRho() = 0;
116 
117  //- Add the given density correction to the density field.
118  // Used to update the density field following pressure solution
119  virtual void correctRho(const volScalarField& deltaRho) = 0;
120 
121 
122  // Transport state
123 
124  //- Dynamic viscosity of mixture [kg/m/s]
125  virtual const volScalarField& mu() const = 0;
126 
127 
128  // Derived transport properties
129 
130  //- Kinematic viscosity of mixture [m^2/s]
131  tmp<volScalarField> nu() const;
132 
133  //- Kinematic viscosity of mixture for patch [m^2/s]
134  tmp<scalarField> nu(const label patchi) const;
135 };
136 
137 
138 /*---------------------------------------------------------------------------*\
139  Class fluidThermo::implementation Declaration
140 \*---------------------------------------------------------------------------*/
141 
143 :
144  virtual public fluidThermo
145 {
146 protected:
147 
148  // Protected data
149 
150  // Fields
151 
152  //- Pressure [Pa]
154 
155  //- Compressibility [s^2/m^2]
157 
158  //- Dynamic viscosity [kg/m/s]
160 
161 
162 public:
163 
164  // Constructors
165 
166  //- Construct from dictionary, mesh and phase name
167  implementation(const dictionary&, const fvMesh&, const word&);
168 
169  //- Disallow default bitwise copy construction
170  implementation(const implementation&) = delete;
171 
172 
173  //- Destructor
174  virtual ~implementation();
175 
176 
177  // Member Functions
178 
179  // Thermodynamic state
180 
181  //- Pressure [Pa]
182  virtual const volScalarField& p() const;
183 
184  //- Pressure [Pa]
185  // Non-const access allowed for transport equations
186  virtual volScalarField& p();
187 
188  //- Compressibility [s^2/m^2]
189  virtual const volScalarField& psi() const;
190 
191 
192  // Transport state
193 
194  //- Dynamic viscosity of mixture [kg/m/s]
195  virtual const volScalarField& mu() const;
196 
197 
198  // Member Operators
199 
200  //- Disallow default bitwise assignment
201  void operator=(const implementation&) = delete;
202 };
203 
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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:152
void operator=(const implementation &)=delete
Disallow default bitwise assignment.
volScalarField mu_
Dynamic viscosity [kg/m/s].
Definition: fluidThermo.H:158
volScalarField psi_
Compressibility [s^2/m^2].
Definition: fluidThermo.H:155
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:56
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:96
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