populationBalanceSetSizeDistribution.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) 2024 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::populationBalanceSetSizeDistribution
26 
27 Description
28  Sets the population balance size distribution by overwriting the values in
29  the size-group fraction fields with values obtained by integrating a given
30  distribution.
31 
32  This function will only execute in post-processing mode.
33 
34  Example of function object specification:
35  \verbatim
36  populationBalanceSetSizeDistribution
37  {
38  type populationBalanceSetSizeDistribution;
39  libs ("libmultiphaseEulerFunctionObjects.so");
40 
41  populationBalance bubbles;
42 
43  //phase air1; // <-- alternative to specifying
44  // 'populationBalance' if only a single phase's
45  // size group fractions are to be set
46 
47  distribution
48  {
49  type tabulatedDensity;
50  Q 3;
51  file "constant/initialDistribution.bubbles";
52  }
53  }
54  \endverbatim
55 
56 Usage
57  \table
58  Property | Description | Required | Default
59  populationBalance | population balance name | if phase is not \
60  specified |
61  phase | phase name | if populationBalance is \
62  not specified |
63  distribution | the distribution | yes |
64  \endtable
65 
66 See also
67  Foam::diameterModels::populationBalanceModel
68  Foam::functionObjects::fvMeshFunctionObject
69  Foam::functionObject
70 
71 SourceFiles
72  populationBalanceSetSizeDistribution.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef populationBalanceSetSizeDistribution_H
77 #define populationBalanceSetSizeDistribution_H
78 
79 #include "fvMeshFunctionObject.H"
80 #include "populationBalanceModel.H"
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 namespace functionObjects
87 {
88 
89 /*---------------------------------------------------------------------------*\
90  Class populationBalanceSetSizeDistribution Declaration
91 \*---------------------------------------------------------------------------*/
92 
93 class populationBalanceSetSizeDistribution
94 :
95  public fvMeshFunctionObject
96 {
97 private:
98 
99  // Private Data
100 
101  //- Name of the population balance
102  const word popBalName_;
103 
104  //- Name of the phase
105  const word phaseName_;
106 
107  //- Distribution
108  autoPtr<distribution> distribution_;
109 
110 
111 public:
112 
113  //- Runtime type information
114  TypeName("populationBalanceSetSizeDistribution");
115 
116 
117  // Constructors
118 
119  //- Construct from Time and dictionary
121  (
122  const word& name,
123  const Time& runTime,
124  const dictionary& dict
125  );
126 
127  //- Disallow default bitwise copy construction
129  (
131  ) = delete;
132 
133 
134  //- Destructor
136 
137 
138  // Member Functions
139 
140  //- Return the list of fields required
141  virtual wordList fields() const
142  {
143  return wordList::null();
144  }
145 
146  //- Execute. Does nothing.
147  virtual bool execute();
148 
149  //- Calculate and write the size group fraction fields
150  virtual bool write();
151 
152 
153  // Member Operators
154 
155  //- Disallow default bitwise assignment
156  void operator=(const populationBalanceSetSizeDistribution&) = delete;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace functionObjects
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
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
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.
Sets the population balance size distribution by overwriting the values in the size-group fraction fi...
void operator=(const populationBalanceSetSizeDistribution &)=delete
Disallow default bitwise assignment.
virtual wordList fields() const
Return the list of fields required.
TypeName("populationBalanceSetSizeDistribution")
Runtime type information.
populationBalanceSetSizeDistribution(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual bool write()
Calculate and write the size group fraction fields.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict