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-2026 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 word derivedThermoName()
78  {
79  return "hePsiThermo";
80  }
81 
82 
83  //- Runtime type information
84  TypeName("psiThermo");
85 
86 
87  //- Declare run-time constructor selection table
89  (
90  autoPtr,
91  psiThermo,
92  fvMesh,
93  (const fvMesh& mesh, const word& phaseName),
94  (mesh, phaseName)
95  );
96 
97 
98  // Selectors
99 
100  //- Standard selection based on fvMesh
101  static autoPtr<psiThermo> New
102  (
103  const fvMesh& mesh,
104  const word& phaseName=word::null
105  );
106 
107 
108  //- Destructor
109  virtual ~psiThermo();
110 
111 
112  // Member Functions
113 
114  // Derived thermodynamic properties
115 
116  //- Density [kg/m^3] - uses current value of pressure
117  virtual tmp<volScalarField> rho() const = 0;
118 
119  //- Density for patch [kg/m^3]
120  virtual tmp<scalarField> rho(const label patchi) const = 0;
121 
122  //- Return the thermodynamic density field [kg/m^3]
123  // This is used by solvers which create a separate continuity rho
124  virtual tmp<volScalarField> renameRho();
125 
126  //- Update the density corresponding to the given pressure change
127  // Used to update the density field following pressure solution
128  // For psiThermo does nothing.
129  virtual void correctRho(const volScalarField& dp);
130 };
131 
132 
133 /*---------------------------------------------------------------------------*\
134  Class psiThermo::implementation Declaration
135 \*---------------------------------------------------------------------------*/
136 
138 :
139  virtual public psiThermo
140 {
141 public:
142 
143  // Constructors
144 
145  //- Construct from dictionary, mesh and phase name
146  implementation(const dictionary&, const fvMesh&, const word&);
147 
148  //- Disallow default bitwise copy construction
149  implementation(const implementation&) = delete;
150 
151 
152  //- Destructor
153  virtual ~implementation();
154 
155 
156  // Member Functions
157 
158  // Derived thermodynamic properties
159 
160  //- Density [kg/m^3] - uses current value of pressure
161  virtual tmp<volScalarField> rho() const;
162 
163  //- Density for patch [kg/m^3]
164  virtual tmp<scalarField> rho(const label patchi) const;
165 
166 
167  // Member Operators
168 
169  //- Disallow default bitwise assignment
170  void operator=(const implementation&) = delete;
171 };
172 
173 
174 /*---------------------------------------------------------------------------*\
175  Class psiThermo::composite Declaration
176 \*---------------------------------------------------------------------------*/
177 
179 :
181  public pureThermo,
184 {
185 public:
186 
187  // Constructors
188 
189  //- Construct from dictionary, mesh and phase name
190  composite
191  (
192  const dictionary& dict,
193  const fvMesh& mesh,
194  const word& phaseName
195  )
196  :
200  {}
201 
202  //- Construct from dictionary, mesh and phase name
203  template<class MixtureType>
204  composite
205  (
206  const dictionary& dict,
207  const MixtureType& mixture,
208  const fvMesh& mesh,
209  const word& phaseName
210  )
211  :
215  {}
216 };
217 
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 } // End namespace Foam
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 #endif
226 
227 // ************************************************************************* //
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:539
virtual const word & phaseName() const
Phase name.
Definition: basicThermo.H:545
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:56
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
composite(const dictionary &dict, const fvMesh &mesh, const word &phaseName)
Construct from dictionary, mesh and phase name.
Definition: psiThermo.H:190
virtual ~implementation()
Destructor.
Definition: psiThermo.C:66
implementation(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
Definition: psiThermo.C:40
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:82
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:72
static word derivedThermoName()
The derived name.
Definition: psiThermo.H:76
virtual ~psiThermo()
Destructor.
Definition: psiThermo.C:62
static autoPtr< psiThermo > New(const fvMesh &mesh, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: psiThermo.C:51
TypeName("psiThermo")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, psiThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))
Declare run-time constructor selection table.
virtual void correctRho(const volScalarField &dp)
Update the density corresponding to the given pressure change.
Definition: psiThermo.C:78
virtual tmp< volScalarField > rho() const =0
Density [kg/m^3] - uses current value of pressure.
Base-class for pure (i.e., single-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:63
static const word null
An empty word.
Definition: word.H:78
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