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-2022 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 "fluidThermo.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class psiThermo Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class psiThermo
53 :
54  virtual public fluidThermo
55 {
56 public:
57 
58  // Public Classes
59 
60  //- Forward declare the implementation class
61  class implementation;
62 
63  //- Forward declare the composite class
64  class composite;
65 
66 
67  //- Runtime type information
68  TypeName("psiThermo");
69 
70 
71  //- Declare run-time constructor selection table
73  (
74  autoPtr,
75  psiThermo,
76  fvMesh,
77  (const fvMesh& mesh, const word& phaseName),
78  (mesh, phaseName)
79  );
80 
81 
82  // Selectors
83 
84  //- Standard selection based on fvMesh
85  static autoPtr<psiThermo> New
86  (
87  const fvMesh& mesh,
89  );
90 
91 
92  //- Destructor
93  virtual ~psiThermo();
94 
95 
96  // Member Functions
97 
98  // Fields derived from thermodynamic state variables
99 
100  //- Add the given density correction to the density field.
101  // Used to update the density field following pressure solution.
102  // For psiThermo does nothing.
103  virtual void correctRho(const volScalarField& deltaRho);
104 
105  //- Density [kg/m^3] - uses current value of pressure
106  virtual tmp<volScalarField> rho() const = 0;
107 
108  //- Density for patch [kg/m^3]
109  virtual tmp<scalarField> rho(const label patchi) const = 0;
110 
111  //- Return the thermodynamic density field [kg/m^3]
112  // This is used by solvers which create a separate continuity rho
113  virtual tmp<volScalarField> renameRho() = 0;
114 };
115 
116 
117 /*---------------------------------------------------------------------------*\
118  Class psiThermo::implementation Declaration
119 \*---------------------------------------------------------------------------*/
120 
122 :
123  virtual public psiThermo
124 {
125 
126 public:
127 
128  // Constructors
129 
130  //- Construct from mesh and phase name
131  implementation(const fvMesh&, const word& phaseName);
132 
133  //- Disallow default bitwise copy construction
134  implementation(const implementation&) = delete;
135 
136 
137  //- Destructor
138  virtual ~implementation();
139 
140 
141  // Member Functions
142 
143  // Fields derived from thermodynamic state variables
144 
145  //- Density [kg/m^3] - uses current value of pressure
146  virtual tmp<volScalarField> rho() const;
147 
148  //- Density for patch [kg/m^3]
149  virtual tmp<scalarField> rho(const label patchi) const;
150 
151  //- Return the thermodynamic density field [kg/m^3]
152  // This is used by solvers which create a separate continuity rho
153  virtual tmp<volScalarField> renameRho();
154 
155 
156  // Member Operators
157 
158  //- Disallow default bitwise assignment
159  void operator=(const implementation&) = delete;
160 };
161 
162 
163 /*---------------------------------------------------------------------------*\
164  Class psiThermo::composite Declaration
165 \*---------------------------------------------------------------------------*/
166 
168 :
172 {
173 public:
174 
175  // Constructors
176 
177  //- Construct from mesh and phase name
178  composite
179  (
180  const fvMesh& mesh,
181  const word& phaseName
182  )
183  :
187  {}
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
Generic GeometricField class.
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:484
virtual const word & phaseName() const
Phase name.
Definition: basicThermo.H:490
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.
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:57
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
composite(const fvMesh &mesh, const word &phaseName)
Construct from mesh and phase name.
Definition: psiThermo.H:178
virtual tmp< volScalarField > renameRho()
Return the thermodynamic density field [kg/m^3].
Definition: psiThermo.C:90
implementation(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
Definition: psiThermo.C:40
virtual ~implementation()
Destructor.
Definition: psiThermo.C:65
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:75
Base-class for fluid thermodynamic properties based on compressibility.
Definition: psiThermo.H:54
virtual void correctRho(const volScalarField &deltaRho)
Add the given density correction to the density field.
Definition: psiThermo.C:71
virtual tmp< volScalarField > renameRho()=0
Return the thermodynamic density field [kg/m^3].
virtual ~psiThermo()
Destructor.
Definition: psiThermo.C:61
static autoPtr< psiThermo > New(const fvMesh &mesh, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: psiThermo.C:50
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.
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