cloudFlux.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::cloudFlux
26 
27 Description
28  Base class for functions which generate the flux of a cloud
29 
30 SourceFiles
31  cloudFlux.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cloudFlux_functionObject_H
36 #define cloudFlux_functionObject_H
37 
38 #include "LagrangianPatchField.H"
40 #include "surfaceFields.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace functionObjects
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class cloudFlux Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class cloudFlux
54 :
56 {
57 private:
58 
59  // Private Data
60 
61  //- Flux field
62  surfaceScalarField phi_;
63 
64 
65  // Private Member Functions
66 
67  //- Return the property for which to compute the flux
69  (
70  const LagrangianSubScalarSubField& fraction
71  ) const = 0;
72 
73  //- Helper for crossing patch faces in either direction
74  void crossPatchFaces
75  (
76  const LagrangianSubScalarSubField& fraction,
77  const label sign
78  );
79 
80 
81 public:
82 
83  //- Runtime type information
84  TypeName("cloudFlux");
85 
86 
87  // Constructors
88 
89  //- Construct from Time and dictionary
90  cloudFlux
91  (
92  const word& name,
93  const Time& runTime,
94  const dictionary& dict,
95  const word& phiName,
96  const dimensionSet& qDims
97  );
98 
99  //- Disallow default bitwise copy construction
100  cloudFlux(const cloudFlux&) = delete;
101 
102 
103  //- Destructor
104  virtual ~cloudFlux();
105 
106 
107  // Member Functions
108 
109  //- Return the list of fields required
110  virtual wordList fields() const;
111 
112  //- Return false so this function does not execute at the start
113  virtual bool executeAtStart() const;
114 
115  //- Do nothing. Everything happens in faces crossing hooks.
116  virtual bool execute();
117 
118  //- Hook before solution steps
119  virtual void preSolve();
120 
121  //- Hook before face crossings of a specific sub-mesh
122  virtual void preCrossFaces
123  (
124  const LagrangianSubScalarSubField& fraction
125  );
126 
127  //- Hook following face crossings of a specific sub-mesh
128  virtual void postCrossFaces
129  (
130  const LagrangianSubScalarSubField& fraction
131  );
132 
133  //- Write the number flux
134  virtual bool write();
135 
136  //- Clear the number flux
137  virtual bool clear();
138 
139 
140  // Member Operators
141 
142  //- Disallow default bitwise assignment
143  void operator=(const cloudFlux&) = delete;
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 } // End namespace functionObjects
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #endif
155 
156 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
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
Dimension set for the base types.
Definition: dimensionSet.H:125
const word & name() const
Return the name of this functionObject.
Base class for functions which generate the flux of a cloud.
Definition: cloudFlux.H:55
cloudFlux(const word &name, const Time &runTime, const dictionary &dict, const word &phiName, const dimensionSet &qDims)
Construct from Time and dictionary.
Definition: cloudFlux.C:85
virtual ~cloudFlux()
Destructor.
Definition: cloudFlux.C:114
virtual wordList fields() const
Return the list of fields required.
Definition: cloudFlux.C:120
virtual bool executeAtStart() const
Return false so this function does not execute at the start.
Definition: cloudFlux.C:126
virtual void postCrossFaces(const LagrangianSubScalarSubField &fraction)
Hook following face crossings of a specific sub-mesh.
Definition: cloudFlux.C:180
virtual bool clear()
Clear the number flux.
Definition: cloudFlux.C:197
void operator=(const cloudFlux &)=delete
Disallow default bitwise assignment.
virtual void preSolve()
Hook before solution steps.
Definition: cloudFlux.C:132
virtual bool execute()
Do nothing. Everything happens in faces crossing hooks.
Definition: cloudFlux.C:138
TypeName("cloudFlux")
Runtime type information.
virtual void preCrossFaces(const LagrangianSubScalarSubField &fraction)
Hook before face crossings of a specific sub-mesh.
Definition: cloudFlux.C:145
virtual bool write()
Write the number flux.
Definition: cloudFlux.C:191
Base class for function objects that refer to an fvMesh and a cloud. Used, for example,...
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dimensionedScalar sign(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dictionary dict
Foam::surfaceFields.