psiThermo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2017 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::psiThermo
29 
30 Group
31  grpPsiThermo
32 
33 Description
34  Basic thermodynamic properties based on compressibility
35 
36 SourceFiles
37  psiThermo.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef psiThermo_H
42 #define psiThermo_H
43 
44 #include "fluidThermo.H"
45 #include "runTimeSelectionTables.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class psiThermo Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class psiThermo
57 :
58  public fluidThermo
59 {
60 
61 protected:
62 
63  // Protected data
64 
65  //- Compressibility [s^2/m^2]
67 
68  //- Dynamic viscosity [kg/m/s]
70 
71 
72  // Protected Member Functions
73 
74  //- Construct as copy (not implemented)
75  psiThermo(const psiThermo&);
76 
77 
78 public:
79 
80  //- Runtime type information
81  TypeName("psiThermo");
82 
83 
84  //- Declare run-time constructor selection table
86  (
87  autoPtr,
88  psiThermo,
89  fvMesh,
90  (const fvMesh& mesh, const word& phaseName),
91  (mesh, phaseName)
92  );
93 
94 
95  //- Declare run-time constructor selection table for dictionary based
97  (
98  autoPtr,
99  psiThermo,
100  fvMeshDictPhase,
101  (const fvMesh& mesh, const word& phaseName, const word& dictName),
102  (mesh, phaseName, dictName)
103  );
104 
105 
106  // Constructors
107 
108  //- Construct from mesh and phase name
109  psiThermo
110  (
111  const fvMesh&,
112  const word& phaseName
113  );
114 
115 
116  //- Construct from mesh,dictionary,phase name with a single temperature
117  psiThermo
118  (
119  const fvMesh&,
120  const word& phaseName,
121  const word& dictionaryName
122  );
123 
124 
125  //- Selector
126  static autoPtr<psiThermo> New
127  (
128  const fvMesh& mesh,
129  const word& phaseName=word::null
130  );
131 
132  //- Selector
133  static autoPtr<psiThermo> New
134  (
135  const fvMesh&,
136  const word& dictName,
137  const word& phaseName
138  );
139 
140 
141  //- Destructor
142  virtual ~psiThermo();
143 
144 
145  // Member functions
146 
147  // Fields derived from thermodynamic state variables
148 
149  //- Add the given density correction to the density field.
150  // Used to update the density field following pressure solution.
151  // For psiThermo does nothing.
152  virtual void correctRho
153  (
154  const volScalarField& deltaRho,
155  const dimensionedScalar& rhoMin,
157  );
158 
159  //- Add the given density correction to the density field.
160  // Used to update the density field following pressure solution
161  virtual void correctRho
162  (
163  const volScalarField& deltaRho
164  );
165 
166  //- Density [kg/m^3] - uses current value of pressure
167  virtual tmp<volScalarField> rho() const;
168 
169  //- Density for patch [kg/m^3]
170  virtual tmp<scalarField> rho(const label patchi) const;
171 
172  //- Compressibility [s^2/m^2]
173  virtual const volScalarField& psi() const;
174 
175 
176  // Access to transport state variables
177 
178  //- Dynamic viscosity of mixture [kg/m/s]
179  virtual tmp<volScalarField> mu() const;
180 
181  //- Dynamic viscosity of mixture for patch [kg/m/s]
182  virtual tmp<scalarField> mu(const label patchi) const;
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
Foam::psiThermo::psi_
volScalarField psi_
Compressibility [s^2/m^2].
Definition: psiThermo.H:65
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::psiThermo::~psiThermo
virtual ~psiThermo()
Destructor.
Definition: psiThermo.C:140
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
fluidThermo.H
Foam::fluidThermo
Fundamental fluid thermodynamic properties.
Definition: fluidThermo.H:52
Foam::psiThermo::rho
virtual tmp< volScalarField > rho() const
Density [kg/m^3] - uses current value of pressure.
Definition: psiThermo.C:146
Foam::psiThermo::correctRho
virtual void correctRho(const volScalarField &deltaRho, const dimensionedScalar &rhoMin, const dimensionedScalar &rhoMax)
Add the given density correction to the density field.
Definition: psiThermo.C:159
Foam::psiThermo::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, psiThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))
Declare run-time constructor selection table.
Foam::psiThermo
Basic thermodynamic properties based on compressibility.
Definition: psiThermo.H:55
rhoMin
const dimensionedScalar rhoMin
Definition: setRegionFluidFields.H:67
Foam::psiThermo::psiThermo
psiThermo(const psiThermo &)
Construct as copy (not implemented)
Foam::psiThermo::psi
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: psiThermo.C:172
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::dimensioned< scalar >
Foam::psiThermo::mu_
volScalarField mu_
Dynamic viscosity [kg/m/s].
Definition: psiThermo.H:68
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::psiThermo::mu
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: psiThermo.C:178
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
rhoMax
const dimensionedScalar rhoMax
Definition: setRegionFluidFields.H:66
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::word::null
static const word null
An empty word.
Definition: word.H:80
Foam::psiThermo::New
static autoPtr< psiThermo > New(const fvMesh &mesh, const word &phaseName=word::null)
Selector.
Definition: psiThermo.C:118
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::psiThermo::TypeName
TypeName("psiThermo")
Runtime type information.
Foam::dictionary::dictName
word dictName() const
The local dictionary name (final part of scoped name)
Definition: dictionaryI.H:60