cloud_functionObject.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::cloud
26 
27 Description
28  Function object that solves for the evolution of a cloud. Only provides
29  one-way coupling with a finite-volume carrier phase. The carrier phase
30  affects the cloud, but the cloud does not affect the carrier phase.
31 
32 SourceFiles
33  cloud_functionObject.C
34  cloud_functionObjectTemplates.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef cloud_functionObject_H
39 #define cloud_functionObject_H
40 
41 #include "regionFunctionObject.H"
42 #include "cloud.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 namespace functionObjects
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class cloud Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class cloud
56 :
58 {
59  // Private Data
60 
61  //- The cloud
62  autoPtr<Foam::cloud> cloudPtr_;
63 
64 
65 protected:
66 
67  // Protected Classes
68 
69  //- Empty template class used to template the constructor on the type
70  // of the cloud
71  template<class Type>
72  class Cloud
73  {};
74 
75 
76  // Protected Constructors
77 
78  //- Construct from components
79  template<class Type>
80  cloud
81  (
82  const word& name,
83  const Time& runTime,
84  const dictionary& dict,
85  const Cloud<Type>&
86  );
87 
88 
89 public:
90 
91  // Public Static Data
92 
93  //- Run-time type information
94  TypeName("cloud");
95 
96 
97  //- Destructor
98  virtual ~cloud();
99 
100 
101  // Member Functions
102 
103  //- Return the list of fields required
104  virtual wordList fields() const;
105 
106  //- Return false so that this function does not execute at the start
107  virtual bool executeAtStart() const;
108 
109  //- Solve the cloud
110  virtual bool execute();
111 
112  //- Dummy write
113  virtual bool write();
114 
115 
116  // Mesh changes
117 
118  //- Update for mesh motion
119  virtual void movePoints(const polyMesh&);
120 
121  //- Update topology using the given map
122  virtual void topoChange(const polyTopoChangeMap&);
123 
124  //- Update from another mesh using the given map
125  virtual void mapMesh(const polyMeshMap&);
126 
127  //- Redistribute or update using the given distribution map
128  virtual void distribute(const polyDistributionMap&);
129 };
130 
131 
132 /*---------------------------------------------------------------------------*\
133  Class Cloud Declaration
134 \*---------------------------------------------------------------------------*/
135 
136 template<class Type>
137 class Cloud
138 :
139  public cloud
140 {
141 public:
142 
143  // Public Static Data
144 
145  //- Run-time type information
146  TypeName("Cloud");
147 
148 
149  // Constructors
150 
151  //- Construct from components
152  Cloud
153  (
154  const word& name,
155  const Time& runTime,
156  const dictionary& dict
157  );
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace functionObjects
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #ifdef NoRepository
170 #endif
171 
172 
173 #define makeCloudFunctionObject(Type) \
174  \
175  typedef Cloud<clouds::Type> Type##CloudFunctionObject; \
176  \
177  defineTemplateTypeNameAndDebugWithName \
178  ( \
179  Type##CloudFunctionObject, \
180  (clouds::Type::typeName + "Cloud").c_str(), \
181  0 \
182  ); \
183  \
184  addToRunTimeSelectionTable \
185  ( \
186  functionObject, \
187  Type##CloudFunctionObject, \
188  dictionary \
189  );
190 
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
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.
TypeName("Cloud")
Run-time type information.
Cloud(const word &name, const Time &runTime, const dictionary &dict)
Construct from components.
Empty template class used to template the constructor on the type.
Function object that solves for the evolution of a cloud. Only provides one-way coupling with a finit...
virtual wordList fields() const
Return the list of fields required.
virtual bool executeAtStart() const
Return false so that this function does not execute at the start.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
cloud(const word &name, const Time &runTime, const dictionary &dict, const Cloud< Type > &)
Construct from components.
TypeName("cloud")
Run-time type information.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
virtual void movePoints(const polyMesh &)
Update for mesh motion.
virtual bool execute()
Solve the cloud.
virtual bool write()
Dummy write.
Specialisation of Foam::functionObject for a region.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
Definition: polyMeshMap.H:51
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict