cloudGravitationalPotentialEnergy.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) 2025 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::functionObjects::cloudGravitationalPotentialEnergy
26 
27 Description
28  Function to compute and write the gravitational potential energy field for
29  a cloud
30 
31 Usage
32  \table
33  Property | Description | Required? | Default
34  cloud | Name of the cloud | yes |
35  \endtable
36 
37  Example specification:
38  \verbatim
39  cloudGravitationalPotentialEnergy1
40  {
41  type cloudGravitationalPotentialEnergy;
42  libs ("libLagrangianCloudFunctionObjects.so");
43  cloud cloud;
44  }
45  \endverbatim
46 
47 SourceFiles
48  cloudGravitationalPotentialEnergy.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef cloudGravitationalPotentialEnergy_functionObject_H
53 #define cloudGravitationalPotentialEnergy_functionObject_H
54 
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 namespace functionObjects
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class cloudGravitationalPotentialEnergy Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 class cloudGravitationalPotentialEnergy
69 :
70  public cloudLagrangianMeshFunctionObject
71 {
72 private:
73 
74  // Private Member Data
75 
76  //- Gravitational acceleration
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("cloudGravitationalPotentialEnergy");
84 
85 
86  // Public Static Data
87 
88  //- The name of the gravitational potential energy field
89  static const word GPEName_;
90 
91 
92  // Constructors
93 
94  //- Construct from Time and dictionary
96  (
97  const word& name,
98  const Time& runTime,
99  const dictionary& dict
100  );
101 
102  //- Disallow default bitwise copy construction
104  (
106  ) = delete;
107 
108 
109  //- Destructor
111 
112 
113  // Member Functions
114 
115  //- Return the list of fields required
116  virtual wordList fields() const;
117 
118  //- Hook before solution steps
119  virtual void preSolve();
120 
121  //- Calculate and store the gravitational potential energy
122  virtual bool execute();
123 
124  //- Write the gravitational potential energy
125  virtual bool write();
126 
127  //- Clear the gravitational potential energy
128  virtual bool clear();
129 
130 
131  // Member Operators
132 
133  //- Disallow default bitwise assignment
134  void operator=(const cloudGravitationalPotentialEnergy&) = delete;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace functionObjects
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
const word & name() const
Return the name of this functionObject.
Function to compute and write the gravitational potential energy field for a cloud.
cloudGravitationalPotentialEnergy(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual wordList fields() const
Return the list of fields required.
static const word GPEName_
The name of the gravitational potential energy field.
void operator=(const cloudGravitationalPotentialEnergy &)=delete
Disallow default bitwise assignment.
virtual bool clear()
Clear the gravitational potential energy.
virtual bool execute()
Calculate and store the gravitational potential energy.
virtual bool write()
Write the gravitational potential energy.
TypeName("cloudGravitationalPotentialEnergy")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict