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-2020 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  Fundamental fluid thermodynamic properties
29 
30 SourceFiles
31  fluidThermo.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef fluidThermo_H
36 #define fluidThermo_H
37 
38 #include "basicThermo.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class fluidThermo Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class fluidThermo
50 :
51  public basicThermo
52 {
53 
54 protected:
55 
56  // Fields
57 
58  //- Pressure [Pa]
60 
61 
62 public:
63 
64  //- Runtime type information
65  TypeName("fluidThermo");
66 
67 
68  //- Declare run-time constructor selection table
70  (
71  autoPtr,
73  fvMesh,
74  (const fvMesh& mesh, const word& phaseName),
75  (mesh, phaseName)
76  );
77 
78  // Constructors
79 
80  //- Construct from mesh and phase name
82  (
83  const fvMesh&,
84  const word& phaseName
85  );
86 
87  //- Construct from mesh and phase name
89  (
90  const fvMesh&,
91  const dictionary&,
92  const word& phaseName
93  );
94 
95 
96  //- Selector
98  (
99  const fvMesh&,
100  const word& phaseName=word::null
101  );
102 
103 
104  //- Destructor
105  virtual ~fluidThermo();
106 
107 
108  // Member Functions
109 
110  // Access to thermodynamic state variables
111 
112  //- Pressure [Pa]
113  // Non-const access allowed for transport equations
114  virtual volScalarField& p();
115 
116  //- Pressure [Pa]
117  virtual const volScalarField& p() const;
118 
119  //- Add the given density correction to the density field.
120  // Used to update the density field following pressure solution
121  virtual void correctRho(const volScalarField& deltaRho) = 0;
122 
123  //- Compressibility [s^2/m^2]
124  virtual const volScalarField& psi() const = 0;
125 
126 
127  // Fields derived from thermodynamic state variables
128 
129  //- Gamma = Cp/Cv []
130  virtual tmp<volScalarField> gamma() const = 0;
131 
132  //- Gamma = Cp/Cv for patch []
133  virtual tmp<scalarField> gamma
134  (
135  const scalarField& T,
136  const label patchi
137  ) const = 0;
138 
139  //- Molecular weight [kg/kmol]
140  virtual tmp<volScalarField> W() const = 0;
141 
142  //- Molecular weight for patch [kg/kmol]
143  virtual tmp<scalarField> W(const label patchi) const = 0;
144 
145 
146  // Access to transport state variables
147 
148  //- Dynamic viscosity of mixture [kg/m/s]
149  virtual tmp<volScalarField> mu() const = 0;
150 
151  //- Dynamic viscosity of mixture for patch [kg/m/s]
152  virtual tmp<scalarField> mu(const label patchi) const = 0;
153 
154  //- Kinematic viscosity of mixture [m^2/s]
155  virtual tmp<volScalarField> nu() const;
156 
157  //- Kinematic viscosity of mixture for patch [m^2/s]
158  virtual tmp<scalarField> nu(const label patchi) const;
159 
160 
161  // Fields derived from transport state variables
162 
163  //- Effective thermal turbulent diffusivity for temperature
164  // of mixture [W/m/K]
166  (
167  const volScalarField&
168  ) const = 0;
169 
170  //- Effective thermal turbulent diffusivity for temperature
171  // of mixture for patch [W/m/K]
172  virtual tmp<scalarField> kappaEff
173  (
174  const scalarField& alphat,
175  const label patchi
176  ) const = 0;
177 
178  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
180  (
181  const volScalarField& alphat
182  ) const = 0;
183 
184  //- Effective thermal turbulent diffusivity of mixture
185  // for patch [kg/m/s]
186  virtual tmp<scalarField> alphaEff
187  (
188  const scalarField& alphat,
189  const label patchi
190  ) const = 0;
191 };
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************************************************************* //
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
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:52
static autoPtr< fluidThermo > New(const fvMesh &, const word &phaseName=word::null)
Selector.
Definition: fluidThermo.C:62
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const =0
Effective thermal turbulent diffusivity of mixture [kg/m/s].
virtual volScalarField & p()
Pressure [Pa].
Definition: fluidThermo.C:79
virtual ~fluidThermo()
Destructor.
Definition: fluidThermo.C:73
virtual const volScalarField & T() const
Temperature [K].
Definition: basicThermo.C:482
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 diffusivity for temperature.
virtual tmp< volScalarField > gamma() const =0
Gamma = Cp/Cv [].
dynamicFvMesh & mesh
volScalarField & p_
Pressure [Pa].
Definition: fluidThermo.H:58
A class for handling words, derived from string.
Definition: word.H:59
Fundamental fluid thermodynamic properties.
Definition: fluidThermo.H:48
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
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:91
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.
fluidThermo(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
Definition: fluidThermo.C:39