buoyancy.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) 2022-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::solvers::buoyancy
26 
27 Description
28  Buoyancy related data for the Foam::solvers::isothermalFluid solver module
29  when solving buoyant cases with \c p_rgh and is selected based on the
30  presence of the \c p_rgh field file.
31 
32  Provides:
33  g : gravitational acceleration
34  hRef : optional reference height
35  pRef : optional reference pressure
36  ghRef : -mag(g)*hRef
37  gh : (g & h) - ghRef
38  ghf : (g & hf) - ghRef
39  p_rgh : p - rho*gh - pRef
40 
41  The \c Foam::solvers::buoyancy::New function returns an \c autoPtr<buoyancy>
42  pointer containing either a \c buoyancy class pointer if the \c p_rgh field
43  file is available otherwise a \c nullptr which can be checked using
44  the \c autoPtr::valid() member function.
45 
46 SourceFiles
47  buoyancy.C
48 
49 \*---------------------------------------------------------------------------*/
50 
51 #ifndef buoyancy_H
52 #define buoyancy_H
53 
54 #include "fvMesh.H"
55 #include "volFields.H"
56 #include "surfaceFields.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 namespace solvers
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class buoyancy Declaration
68 \*---------------------------------------------------------------------------*/
69 
70 class buoyancy
71 {
72  // Private member data
73 
74  const fvMesh& mesh;
75 
76  const Time& runTime;
77 
78 
79 public:
80 
81  // Thermophysical properties
82 
83  //- Gravitational acceleration
85 
86  //- Reference height
88 
89  //- Reference pressure
91 
92  //- -mag(g)*hRef
94 
95  //- (g & h) - ghRef
97 
98  //- (g & hf) - ghRef
100 
101  //- Buoyant pressure p - rho*gh - pRef
103 
104 
105  // Constructors
106 
107  //- Construct from the region mesh
108  buoyancy(const fvMesh& mesh);
109 
110  //- Disallow default bitwise copy construction
111  buoyancy(const buoyancy&) = delete;
112 
113 
114  // Selectors
115 
116  //- Select, construct and return the buoyancy
117  static autoPtr<buoyancy> New(const fvMesh& mesh);
118 
119 
120  //- Destructor
121  virtual ~buoyancy();
122 
123 
124  // Member Functions
125 
126  //- Update gh and ghf following mesh-motion
127  void moveMesh();
128 
129 
130  // Member Operators
131 
132  //- Disallow default bitwise assignment
133  void operator=(const buoyancy&) = delete;
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace solvers
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
Generic GeometricField class.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
Buoyancy related data for the Foam::solvers::isothermalFluid solver module when solving buoyant cases...
Definition: buoyancy.H:70
uniformDimensionedVectorField g
Gravitational acceleration.
Definition: buoyancy.H:83
uniformDimensionedScalarField hRef
Reference height.
Definition: buoyancy.H:86
volScalarField gh
(g & h) - ghRef
Definition: buoyancy.H:95
void moveMesh()
Update gh and ghf following mesh-motion.
Definition: buoyancy.C:124
volScalarField p_rgh
Buoyant pressure p - rho*gh - pRef.
Definition: buoyancy.H:101
dimensionedScalar ghRef
-mag(g)*hRef
Definition: buoyancy.H:92
buoyancy(const fvMesh &mesh)
Construct from the region mesh.
Definition: buoyancy.C:30
uniformDimensionedScalarField pRef
Reference pressure.
Definition: buoyancy.H:89
void operator=(const buoyancy &)=delete
Disallow default bitwise assignment.
virtual ~buoyancy()
Destructor.
Definition: buoyancy.C:118
static autoPtr< buoyancy > New(const fvMesh &mesh)
Select, construct and return the buoyancy.
Definition: buoyancy.C:100
surfaceScalarField ghf
(g & hf) - ghRef
Definition: buoyancy.H:98
Namespace for OpenFOAM.
Foam::surfaceFields.