populationBalance.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) 2017-2026 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::diameterModels::populationBalance
26 
27 Description
28  This diameter model computes the diameter from multiple size group
29  diameters and fractions provided by an associated population balance model.
30 
31  This model requires the name of the population balance model to be
32  specified, and will trigger construction of said population balance model.
33  The number of groups associated with the phase is also specified here. The
34  sizes/diameters themselves, as well as all models relating to evolution of
35  the size distribution (i.e., coalescence and breakup) are specified for
36  population balance model and not for this diameter model.
37 
38 Usage
39  Excerpt from an exemplary phaseProperties dictionary:
40  \verbatim
41  diameterModel
42  {
43  type populationBalance;
44 
45  populationBalance bubbles;
46 
47  nGroups 10;
48  }
49  \endverbatim
50 
51 See also
52  Foam::populationBalanceModel
53 
54 SourceFiles
55  populationBalance.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef populationBalance_H
60 #define populationBalance_H
61 
62 #include "diameterModel.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 
69 // Forward declaration of classes
70 class populationBalanceModel;
71 
72 namespace diameterModels
73 {
74 
75 /*---------------------------------------------------------------------------*\
76  Class populationBalance Declaration
77 \*---------------------------------------------------------------------------*/
78 
80 :
81  public diameterModel
82 {
83  // Private Data
84 
85  //- Name of the populationBalance this populationBalance belongs to
86  word popBalName_;
87 
88  //- Pointer to the populationBalance this populationBalance belongs to
89  mutable const populationBalanceModel* popBalPtr_;
90 
91  //- The number of groups associated with this phase
92  const label nGroups_;
93 
94  //- Index of the first group of this phase
95  mutable label iFirst_;
96 
97  //- Sauter-mean diameter of the phase
98  volScalarField d_;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("populationBalance");
105 
106 
107  // Constructors
108 
109  //- Construct from dictionary and phase
111  (
112  const dictionary& diameterProperties,
113  const phaseModel& phase
114  );
115 
116 
117  //- Destructor
118  virtual ~populationBalance();
119 
120 
121  // Member Functions
122 
123  //- Return name of populationBalance this populationBalance belongs to
124  inline const word& popBalName() const;
125 
126  //- Return the populationBalance this populationBalance belongs to
127  const populationBalanceModel& popBal() const;
128 
129  //- Return the number of groups in this phase
130  inline label nGroups() const;
131 
132  //- Return the index of the first group of this phase
133  label iFirst() const;
134 
135  //- Return the index of the last group of this phase
136  inline label iLast() const;
137 
138  //- Get the diameter field
139  virtual tmp<volScalarField> d() const;
140 
141  //- Get the surface area per unit volume field
142  virtual tmp<volScalarField> Av() const;
143 
144  //- ...
146 
147  //- Correct the model
148  virtual void correct();
149 
150  //- Read diameter properties dictionary
151  virtual bool read(const dictionary& diameterProperties);
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace diameterModels
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #include "populationBalanceI.H"
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
Generic GeometricField class.
Abstract base-class for dispersed-phase particle diameter models.
Definition: diameterModel.H:52
const phaseModel & phase() const
Return the phase.
virtual bool read()
Read diameter properties dictionary.
Definition: diameterModel.C:62
This diameter model computes the diameter from multiple size group diameters and fractions provided b...
virtual void correct()
Correct the model.
populationBalance(const dictionary &diameterProperties, const phaseModel &phase)
Construct from dictionary and phase.
label iLast() const
Return the index of the last group of this phase.
label iFirst() const
Return the index of the first group of this phase.
virtual tmp< volScalarField > d() const
Get the diameter field.
const populationBalanceModel & popBal() const
Return the populationBalance this populationBalance belongs to.
TypeName("populationBalance")
Runtime type information.
label nGroups() const
Return the number of groups in this phase.
virtual tmp< volScalarField > Av() const
Get the surface area per unit volume field.
const word & popBalName() const
Return name of populationBalance this populationBalance belongs to.
tmp< volScalarField::Internal > fSum() const
...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Model for tracking the evolution of a dispersed phase size distribution due to coalescence (synonymou...
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
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