cloudGravitationalPotentialEnergy.C
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 \*---------------------------------------------------------------------------*/
25 
28 #include "shaped.H"
29 #include "massive.H"
31 
32 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36 namespace functionObjects
37 {
40  (
44  );
45 }
46 }
47 
48 
49 const Foam::word
51 
52 
53 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
54 
57 (
58  const word& name,
59  const Time& runTime,
60  const dictionary& dict
61 )
62 :
65 {}
66 
67 
68 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
69 
72 {}
73 
74 
75 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
76 
79 {
80  return wordList::null();
81 }
82 
83 
85 {
87 }
88 
89 
91 {
92  const Foam::cloud& c = cloud();
93 
95  (
96  GPEName_,
97  isCloud<clouds::massive>()
98  ? cloud<clouds::massive>().m(c.mesh())*(-g & c.mesh().position())
99  : cloud<clouds::shaped>().v(c.mesh())*(-g & c.mesh().position())
100  );
101 
102  return true;
103 }
104 
105 
107 {
109 }
110 
111 
113 {
115 }
116 
117 
118 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
static const List< word > & null()
Return a null List.
Definition: ListI.H:118
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
Definition: cloud.H:63
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Abstract base-class for Time/database functionObjects.
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.
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.
Base class for function objects that refer to a LagrangianMesh and a cloud. Used, for example,...
Function object that solves for the evolution of a cloud. Only provides one-way coupling with a finit...
ObjectType & store(const tmp< ObjectType > &tfield)
Store the given field in the objectRegistry.
bool writeObject(const word &fieldName)
Write field if present in objectRegistry.
bool clearObject(const word &fieldName)
Clear field from the objectRegistry if present.
Writes run time, CPU time and clock time and optionally the CPU and clock times per time step.
A class for handling words, derived from string.
Definition: word.H:62
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
const dimensionedScalar c
Speed of light in a vacuum.
defineTypeNameAndDebug(adjustTimeStepToCombustion, 0)
addToRunTimeSelectionTable(functionObject, adjustTimeStepToCombustion, dictionary)
Namespace for OpenFOAM.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
const UniformDimensionedField< Type > & lookupUniformDimensionedField(const objectRegistry &db, const word &name)
dictionary dict