psiThermo.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) 2011-2023 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::psiThermo
26 
27 Description
28  Base-class for fluid thermodynamic properties based on compressibility.
29 
30 See also
31  Foam::basicThermo
32 
33 SourceFiles
34  psiThermo.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef psiThermo_H
39 #define psiThermo_H
40 
41 #include "PsiThermo.H"
42 #include "pureThermo.H"
43 #include "fluidThermo.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class psiThermo Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class psiThermo
55 :
56  virtual public fluidThermo
57 {
58 public:
59 
60  // Public Classes
61 
62  //- Forward declare the implementation class
63  class implementation;
64 
65  //- Forward declare the composite class
66  class composite;
67 
68 
69  // Public Typedefs
70 
71  //- The derived type
72  template<class MixtureType>
73  using DerivedThermoType =
75 
76  //- The derived name
77  static const word derivedThermoName;
78 
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  // Selectors
96 
97  //- Standard selection based on fvMesh
98  static autoPtr<psiThermo> New
99  (
100  const fvMesh& mesh,
101  const word& phaseName=word::null
102  );
103 
104 
105  //- Destructor
106  virtual ~psiThermo();
107 
108 
109  // Member Functions
110 
111  // Derived thermodynamic properties
112 
113  //- Density [kg/m^3] - uses current value of pressure
114  virtual tmp<volScalarField> rho() const = 0;
115 
116  //- Density for patch [kg/m^3]
117  virtual tmp<scalarField> rho(const label patchi) const = 0;
118 
119  //- Return the thermodynamic density field [kg/m^3]
120  // This is used by solvers which create a separate continuity rho
121  virtual tmp<volScalarField> renameRho();
122 
123  //- Add the given density correction to the density field.
124  // Used to update the density field following pressure solution.
125  // For psiThermo does nothing.
126  virtual void correctRho(const volScalarField& deltaRho);
127 };
128 
129 
130 /*---------------------------------------------------------------------------*\
131  Class psiThermo::implementation Declaration
132 \*---------------------------------------------------------------------------*/
133 
135 :
136  virtual public psiThermo
137 {
138 public:
139 
140  // Constructors
141 
142  //- Construct from dictionary, mesh and phase name
143  implementation(const dictionary&, const fvMesh&, const word&);
144 
145  //- Disallow default bitwise copy construction
146  implementation(const implementation&) = delete;
147 
148 
149  //- Destructor
150  virtual ~implementation();
151 
152 
153  // Member Functions
154 
155  // Derived thermodynamic properties
156 
157  //- Density [kg/m^3] - uses current value of pressure
158  virtual tmp<volScalarField> rho() const;
159 
160  //- Density for patch [kg/m^3]
161  virtual tmp<scalarField> rho(const label patchi) const;
162 
163 
164  // Member Operators
165 
166  //- Disallow default bitwise assignment
167  void operator=(const implementation&) = delete;
168 };
169 
170 
171 /*---------------------------------------------------------------------------*\
172  Class psiThermo::composite Declaration
173 \*---------------------------------------------------------------------------*/
174 
176 :
178  public pureThermo,
181 {
182 public:
183 
184  // Constructors
185 
186  //- Construct from dictionary, mesh and phase name
187  template<class MixtureType>
188  composite
189  (
190  const dictionary& dict,
191  const MixtureType& mixture,
192  const fvMesh& mesh,
193  const word& phaseName
194  )
195  :
199  {}
200 };
201 
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 } // End namespace Foam
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
Generic GeometricField class.
Thermo implementation based on compressibility.
Definition: PsiThermo.H:52
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
virtual const fvMesh & mesh() const
Return const access to the mesh.
Definition: basicThermo.H:496
virtual const word & phaseName() const
Phase name.
Definition: basicThermo.H:502
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 keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:57
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
composite(const dictionary &dict, const MixtureType &mixture, const fvMesh &mesh, const word &phaseName)
Construct from dictionary, mesh and phase name.
Definition: psiThermo.H:188
virtual ~implementation()
Destructor.
Definition: psiThermo.C:68
implementation(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
Definition: psiThermo.C:42
void operator=(const implementation &)=delete
Disallow default bitwise assignment.
virtual tmp< volScalarField > rho() const
Density [kg/m^3] - uses current value of pressure.
Definition: psiThermo.C:84
Base-class for fluid thermodynamic properties based on compressibility.
Definition: psiThermo.H:56
virtual tmp< volScalarField > renameRho()
Return the thermodynamic density field [kg/m^3].
Definition: psiThermo.C:74
static const word derivedThermoName
The derived name.
Definition: psiThermo.H:76
virtual void correctRho(const volScalarField &deltaRho)
Add the given density correction to the density field.
Definition: psiThermo.C:80
virtual ~psiThermo()
Destructor.
Definition: psiThermo.C:64
static autoPtr< psiThermo > New(const fvMesh &mesh, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: psiThermo.C:53
TypeName("psiThermo")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, psiThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))
Declare run-time constructor selection table.
virtual tmp< volScalarField > rho() const =0
Density [kg/m^3] - uses current value of pressure.
Base-class for multi-component thermodynamic properties.
Definition: pureThermo.H:54
A class for managing temporary objects.
Definition: tmp.H:55
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
dictionary dict