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-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::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  writeControl writeTime;
45  }
46  \endverbatim
47 
48 SourceFiles
49  cloudGravitationalPotentialEnergy.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef cloudGravitationalPotentialEnergy_functionObject_H
54 #define cloudGravitationalPotentialEnergy_functionObject_H
55 
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace Foam
61 {
62 namespace functionObjects
63 {
64 
65 /*---------------------------------------------------------------------------*\
66  Class cloudGravitationalPotentialEnergy Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 class cloudGravitationalPotentialEnergy
70 :
71  public cloudLagrangianMeshFunctionObject
72 {
73 private:
74 
75  // Private Data
76 
77  //- Gravitational acceleration
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("cloudGravitationalPotentialEnergy");
85 
86 
87  // Public Static Data
88 
89  //- The name of the gravitational potential energy field
90  static const word GPEName_;
91 
92 
93  // Constructors
94 
95  //- Construct from Time and dictionary
97  (
98  const word& name,
99  const Time& runTime,
100  const dictionary& dict
101  );
102 
103  //- Disallow default bitwise copy construction
105  (
107  ) = delete;
108 
109 
110  //- Destructor
112 
113 
114  // Member Functions
115 
116  //- Return the list of fields required
117  virtual wordList fields() const;
118 
119  //- Hook before solution steps
120  virtual void preSolve();
121 
122  //- Calculate and store the gravitational potential energy
123  virtual bool execute();
124 
125  //- Write the gravitational potential energy
126  virtual bool write();
127 
128  //- Clear the gravitational potential energy
129  virtual bool clear();
130 
131 
132  // Member Operators
133 
134  //- Disallow default bitwise assignment
135  void operator=(const cloudGravitationalPotentialEnergy&) = delete;
136 };
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace functionObjects
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
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:63
Namespace for OpenFOAM.
dictionary dict