All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2021 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"
43 #include "dynamicTransportModel.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class fluidThermo Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class fluidThermo
55 :
56  virtual public basicThermo,
59 {
60 public:
61 
62  // Public Classes
63 
64  //- Forward declare the implementation class
65  class implementation;
66 
67 
68  //- Runtime type information
69  TypeName("fluidThermo");
70 
71 
72  //- Declare run-time constructor selection table
74  (
75  autoPtr,
77  fvMesh,
78  (const fvMesh& mesh, const word& phaseName),
79  (mesh, phaseName)
80  );
81 
82 
83  // Selectors
84 
85  //- Standard selection based on fvMesh
87  (
88  const fvMesh&,
89  const word& phaseName=word::null
90  );
91 
92 
93  //- Destructor
94  virtual ~fluidThermo();
95 
96 
97  // Member Functions
98 
99  // Access to thermodynamic state variables
100 
101  //- Pressure [Pa]
102  // Non-const access allowed for transport equations
103  virtual volScalarField& p() = 0;
104 
105  //- Pressure [Pa]
106  virtual const volScalarField& p() const = 0;
107 
108  //- Add the given density correction to the density field.
109  // Used to update the density field following pressure solution
110  virtual void correctRho(const volScalarField& deltaRho) = 0;
111 
112  //- Compressibility [s^2/m^2]
113  virtual const volScalarField& psi() const = 0;
114 
115 
116  // Fields derived from thermodynamic state variables
117 
118  //- Gamma = Cp/Cv []
119  virtual tmp<volScalarField> gamma() const = 0;
120 
121  //- Gamma = Cp/Cv for patch []
122  virtual tmp<scalarField> gamma
123  (
124  const scalarField& T,
125  const label patchi
126  ) const = 0;
127 
128  //- Molecular weight [kg/kmol]
129  virtual tmp<volScalarField> W() const = 0;
130 
131  //- Molecular weight for patch [kg/kmol]
132  virtual tmp<scalarField> W(const label patchi) const = 0;
133 
134 
135  // Access to transport state variables
136 
137  //- Dynamic viscosity of mixture [kg/m/s]
138  virtual tmp<volScalarField> mu() const = 0;
139 
140  //- Dynamic viscosity of mixture for patch [kg/m/s]
141  virtual tmp<scalarField> mu(const label patchi) const = 0;
142 
143  //- Kinematic viscosity of mixture [m^2/s]
144  virtual tmp<volScalarField> nu() const;
145 
146  //- Kinematic viscosity of mixture for patch [m^2/s]
147  virtual tmp<scalarField> nu(const label patchi) const;
148 
149 
150  // Fields derived from transport state variables
151 
152  //- Effective thermal turbulent diffusivity for temperature
153  // of mixture [W/m/K]
155  (
156  const volScalarField&
157  ) const = 0;
158 
159  //- Effective thermal turbulent diffusivity for temperature
160  // of mixture for patch [W/m/K]
161  virtual tmp<scalarField> kappaEff
162  (
163  const scalarField& alphat,
164  const label patchi
165  ) const = 0;
166 
167  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
169  (
170  const volScalarField& alphat
171  ) const = 0;
172 
173  //- Effective thermal turbulent diffusivity of mixture
174  // 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  //- Construct from mesh, dictionary and phase name
209  implementation(const fvMesh&, const dictionary&, const word& phaseName);
210 
211  //- Disallow default bitwise copy construction
212  implementation(const implementation&) = delete;
213 
214 
215  //- Destructor
216  virtual ~implementation();
217 
218 
219  // Member Functions
220 
221  // Access to thermodynamic state variables
222 
223  //- Pressure [Pa]
224  // Non-const access allowed for transport equations
225  virtual volScalarField& p();
226 
227  //- Pressure [Pa]
228  virtual const volScalarField& p() const;
229 
230 
231  // Member Operators
232 
233  //- Disallow default bitwise assignment
234  void operator=(const implementation&) = delete;
235 };
236 
237 
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 
240 } // End namespace Foam
241 
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 
244 #endif
245 
246 // ************************************************************************* //
virtual tmp< volScalarField > mu() const =0
Dynamic viscosity of mixture [kg/m/s].
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
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:63
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const =0
Effective thermal turbulent diffusivity of mixture [kg/m/s].
virtual ~fluidThermo()
Destructor.
Definition: fluidThermo.C:74
virtual volScalarField & p()=0
Pressure [Pa].
virtual void correctRho(const volScalarField &deltaRho)=0
Add the given density correction to the density field.
void operator=(const dynamicTransportModel &)=delete
Disallow default bitwise assignment.
virtual tmp< volScalarField > kappaEff(const volScalarField &) const =0
Effective thermal turbulent diffusivity for temperature.
virtual tmp< volScalarField > gamma() const =0
Gamma = Cp/Cv [].
virtual const word & phaseName() const =0
Return the phase name.
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:53
Base-class for all transport models used by the incompressible turbulence models. ...
static const word null
An empty word.
Definition: word.H:77
TypeName("fluidThermo")
Runtime type information.
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:78
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:84
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.
Base-class for all transport models used by compressible turbulence models.