cloudFunctionObject.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::cloudFunctionObject
26 
27 Description
28  Base class for function objects that refer to a cloud. Provides hooks into
29  the cloud solution process. Not a function object in itself. Must be mixed
30  in.
31 
32 SourceFiles
33  cloudFunctionObject.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef cloudFunctionObject_functionObject_H
38 #define cloudFunctionObject_functionObject_H
39 
41 #include "fvMeshFunctionObject.H"
42 #include "LagrangianFieldsFwd.H"
43 #include "LagrangianSubFieldsFwd.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 class cloud;
51 
52 namespace functionObjects
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class cloudFunctionObject Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 {
61 private:
62 
63  // Private Data
64 
65  //- Reference to the function object
66  const functionObject& function_;
67 
68  //- Reference to the cloud
69  const Foam::cloud& cloud_;
70 
71 
72 protected:
73 
74  // Protected Member Functions
75 
76  //- Determine whether the cloud is of the given type
77  template<class Cloud>
78  bool isCloud() const;
79 
80  //- Get a reference to the cloud
81  template<class Cloud = Foam::cloud>
82  const Cloud& cloud() const;
83 
84 
85 public:
86 
87  //- Runtime type information
88  TypeName("cloudFunctionObject");
89 
90 
91  // Constructors
92 
93  //- Construct from a Lagrangian mesh function object
95 
96  //- Construct from an fvMesh function object and a dictionary
98  (
99  const fvMeshFunctionObject&,
100  const dictionary& dict
101  );
102 
103  //- Disallow default bitwise copy construction
105  (
106  const cloudFunctionObject&
107  ) = delete;
108 
109 
110  //- Destructor
111  virtual ~cloudFunctionObject();
112 
113 
114  // Member Functions
115 
116  //- Return the cloud
117  const Foam::cloud& cloud() const;
118 
119  //- Hook before solution steps
120  virtual void preSolve();
121 
122  //- Solve equations and/or update continually changing properties
123  virtual void calculate
124  (
125  const LagrangianSubScalarField& deltaT,
126  const bool final
127  );
128 
129  //- Hook before all face crossings
130  virtual void preCrossFaces
131  (
133  );
134 
135  //- Hook before face crossings of a specific sub-mesh
136  virtual void preCrossFaces
137  (
138  const LagrangianSubScalarSubField& fraction
139  );
140 
141  //- Hook following face crossings of a specific sub-mesh
142  virtual void postCrossFaces
143  (
144  const LagrangianSubScalarSubField& fraction
145  );
146 
147  //- Hook after all face crossings
148  virtual void postCrossFaces
149  (
151  );
152 
153  //- Hook following solution steps
154  virtual void postSolve();
155 
156 
157  // Member Operators
158 
159  //- Disallow default bitwise assignment
160  void operator=(const cloudFunctionObject&) = delete;
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace functionObjects
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #ifdef NoRepository
173 #endif
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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.
Base class for function objects relating to a Lagrangian mesh.
Base class for function objects that refer to a cloud. Provides hooks into the cloud solution process...
virtual void postSolve()
Hook following solution steps.
void operator=(const cloudFunctionObject &)=delete
Disallow default bitwise assignment.
TypeName("cloudFunctionObject")
Runtime type information.
virtual void postCrossFaces(const LagrangianSubScalarSubField &fraction)
Hook following face crossings of a specific sub-mesh.
bool isCloud() const
Determine whether the cloud is of the given type.
cloudFunctionObject(const LagrangianMeshFunctionObject &)
Construct from a Lagrangian mesh function object.
virtual void preSolve()
Hook before solution steps.
virtual void calculate(const LagrangianSubScalarField &deltaT, const bool final)
Solve equations and/or update continually changing properties.
const Cloud & cloud() const
Get a reference to the cloud.
virtual void preCrossFaces(const LagrangianScalarInternalDynamicField &fraction)
Hook before all face crossings.
Specialisation of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Namespace for OpenFOAM.
dictionary dict