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-2022 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&,
88  const word& phaseName=word::null
89  );
90 
91 
92  //- Destructor
93  virtual ~fluidThermo();
94 
95 
96  // Member Functions
97 
98  // Access to thermodynamic state variables
99 
100  //- Pressure [Pa]
101  // Non-const access allowed for transport equations
102  virtual volScalarField& p() = 0;
103 
104  //- Pressure [Pa]
105  virtual const volScalarField& p() const = 0;
106 
107  //- Add the given density correction to the density field.
108  // Used to update the density field following pressure solution
109  virtual void correctRho(const volScalarField& deltaRho) = 0;
110 
111  //- Compressibility [s^2/m^2]
112  virtual const volScalarField& psi() const = 0;
113 
114 
115  // Fields derived from thermodynamic state variables
116 
117  //- Gamma = Cp/Cv []
118  virtual tmp<volScalarField> gamma() const = 0;
119 
120  //- Gamma = Cp/Cv for patch []
121  virtual tmp<scalarField> gamma
122  (
123  const scalarField& T,
124  const label patchi
125  ) const = 0;
126 
127  //- Molecular weight [kg/kmol]
128  virtual tmp<volScalarField> W() const = 0;
129 
130  //- Molecular weight for patch [kg/kmol]
131  virtual tmp<scalarField> W(const label patchi) const = 0;
132 
133 
134  // Access to transport state variables
135 
136  //- Dynamic viscosity of mixture [kg/m/s]
137  virtual tmp<volScalarField> mu() const = 0;
138 
139  //- Dynamic viscosity of mixture for patch [kg/m/s]
140  virtual tmp<scalarField> mu(const label patchi) const = 0;
141 
142  //- Kinematic viscosity of mixture [m^2/s]
143  virtual tmp<volScalarField> nu() const;
144 
145  //- Kinematic viscosity of mixture for patch [m^2/s]
146  virtual tmp<scalarField> nu(const label patchi) const;
147 
148 
149  // Fields derived from transport state variables
150 
151  //- Effective thermal turbulent conductivity of mixture
152  // for patch [W/m/K]
154  (
155  const volScalarField&
156  ) const = 0;
157 
158  //- Effective thermal turbulent conductivity of mixture
159  // for patch [W/m/K]
160  virtual tmp<scalarField> kappaEff
161  (
162  const scalarField& alphat,
163  const label patchi
164  ) const = 0;
165 
166  //- Effective turbulent thermal diffusivity of energy
167  // of mixture [kg/m/s]
169  (
170  const volScalarField& alphat
171  ) const = 0;
172 
173  //- Effective turbulent thermal diffusivity of energy
174  // of mixture for patch [kg/m/s]
175  virtual tmp<scalarField> alphaEff
176  (
177  const scalarField& alphat,
178  const label patchi
179  ) const = 0;
180 };
181 
182 
183 /*---------------------------------------------------------------------------*\
184  Class fluidThermo::implementation Declaration
185 \*---------------------------------------------------------------------------*/
188 :
189  virtual public fluidThermo
190 {
191 protected:
192 
193  // Protected data
194 
195  // Fields
196 
197  //- Pressure [Pa]
198  volScalarField& p_;
199 
200 
201 public:
202 
203  // Constructors
204 
205  //- Construct from mesh and phase name
206  implementation(const fvMesh&, const word& phaseName);
207 
208  //- Disallow default bitwise copy construction
209  implementation(const implementation&) = delete;
210 
211 
212  //- Destructor
213  virtual ~implementation();
214 
215 
216  // Member Functions
217 
218  // Access to thermodynamic state variables
219 
220  //- Pressure [Pa]
221  // Non-const access allowed for transport equations
222  virtual volScalarField& p();
223 
224  //- Pressure [Pa]
225  virtual const volScalarField& p() const;
226 
227 
228  // Member Operators
229 
230  //- Disallow default bitwise assignment
231  void operator=(const implementation&) = delete;
232 };
233 
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 } // End namespace Foam
238 
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 
241 #endif
242 
243 // ************************************************************************* //
virtual tmp< volScalarField > mu() const =0
Dynamic viscosity of mixture [kg/m/s].
Base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:77
static autoPtr< fluidThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: fluidThermo.C:52
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const =0
Effective turbulent thermal diffusivity of energy.
void operator=(const viscosity &)=delete
Disallow default bitwise assignment.
virtual ~fluidThermo()
Destructor.
Definition: fluidThermo.C:63
fvMesh & mesh
virtual volScalarField & p()=0
Pressure [Pa].
virtual void correctRho(const volScalarField &deltaRho)=0
Add the given density correction to the density field.
virtual tmp< volScalarField > kappaEff(const volScalarField &) const =0
Effective thermal turbulent conductivity of mixture.
virtual tmp< volScalarField > gamma() const =0
Gamma = Cp/Cv [].
virtual const word & phaseName() const =0
Phase name.
A class for handling words, derived from string.
Definition: word.H:59
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:53
static const word null
An empty word.
Definition: word.H:77
TypeName("fluidThermo")
Runtime type information.
Abstract base class for all fluid physical properties.
Definition: viscosity.H:49
virtual tmp< volScalarField > W() const =0
Molecular weight [kg/kmol].
label patchi
virtual const volScalarField & T() const =0
Temperature [K].
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
virtual const volScalarField & psi() const =0
Compressibility [s^2/m^2].
virtual tmp< volScalarField > nu() const
Kinematic viscosity of mixture [m^2/s].
Definition: fluidThermo.C:73
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
declareRunTimeSelectionTable(autoPtr, fluidThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))
Declare run-time constructor selection table.
Namespace for OpenFOAM.