sizeGroup.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-2020 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::sizeGroup
26 
27 Description
28  This class represents a single sizeGroup belonging to a velocityGroup.
29  The main property of a sizeGroup is its representative volume. The
30  corresponding volScalarField f'number'.'phaseName'.'populationBalanceName'
31  gives the volume fraction of the sizeGroup such that all sizeGroup fractions
32  over a velocityGroup must sum to unity. The field is either read from the
33  startTime directory if present or constructed from a reference field called
34  f.'phaseName'.'populationBalanceName' where the boundary condition types
35  must be specified. All field and boundary condition values are reset to
36  match the 'value' given in the sizeGroup subdictionary.
37 
38  The corresponding physical diameter that is representative for the class is
39  computed by a separate shapeModel, specified in the velocityGroupCoeffs
40  dictionary.
41 
42 Usage
43  \table
44  Property | Description | Required | Default value
45  dSph | Sphere equivalent diameter | yes | none
46  value | Field and BC value | yes | none
47  \endtable
48 
49  Example
50  \verbatim
51  f1
52  {
53  ds 3e-3;
54  value 1.0;
55  }
56  \endverbatim
57 
58 See also
59  Foam::diameterModels::velocityGroup
60  Foam::diameterModels::populationBalanceModel
61 
62 SourceFiles
63  sizeGroup.C
64 
65 \*---------------------------------------------------------------------------*/
66 
67 #ifndef sizeGroup_H
68 #define sizeGroup_H
69 
70 #include "dictionaryEntry.H"
71 #include "velocityGroup.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 namespace diameterModels
78 {
79 
80 class shapeModel;
81 
82 /*---------------------------------------------------------------------------*\
83  Class sizeGroup Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class sizeGroup
87 :
88  public volScalarField
89 {
90 private:
91 
92  // Private Data
93 
94  dictionary dict_;
95 
96  //- Phase this sizeGroup belongs to
97  const phaseModel& phase_;
98 
99  //- VelocityGroup this sizeGroup belongs to
100  const velocityGroup& velocityGroup_;
101 
102  //- Sphere equivalent diameter of the sizeGroup
103  const dimensionedScalar dSph_;
104 
105  //- Representative volume of the sizeGroup
106  const dimensionedScalar x_;
107 
108  //- Initial value and value at boundaries
109  const scalar value_;
110 
111  //- Label of this sizeGroup within the corresponding populationBalance
112  mutable autoPtr<label> i_;
113 
114  //- Model for describing the representative shape of the elements in the
115  // sizeGroup
116  autoPtr<shapeModel> shapeModel_;
117 
118 
119 public:
120 
121  // Constructors
122 
123  sizeGroup
124  (
125  const word& name,
126  const dictionary& dict,
127  const phaseModel& phase,
129  const fvMesh& mesh
130  );
131 
132  //- Return clone
133  autoPtr<sizeGroup> clone() const;
134 
135  //- Return a pointer to a new sizeGroup created on freestore
136  // from Istream
137  class iNew
138  {
139  const phaseModel& phase_;
140  const velocityGroup& velocityGroup_;
141 
142  public:
143 
144  iNew
145  (
146  const phaseModel& phase,
148  )
149  :
150  phase_(phase),
151  velocityGroup_(velocityGroup)
152  {}
153 
155  {
157  return autoPtr<sizeGroup>
158  (
160  (
161  ent.keyword(),
162  ent,
163  phase_,
164  velocityGroup_,
165  phase_.mesh()
166  )
167  );
168  }
169  };
170 
171 
172  //- Destructor
173  virtual ~sizeGroup();
174 
175 
176  // Member Functions
177 
178  //- Return const-reference to the dictionary
179  inline const dictionary& dict() const;
180 
181  //- Return const-reference to the phase
182  inline const phaseModel& phase() const;
183 
184  //- Return const-reference to the velocityGroup
185  inline const velocityGroup& VelocityGroup() const;
186 
187  //- Return representative spherical diameter of the sizeGroup
188  inline const dimensionedScalar& dSph() const;
189 
190  //- Return representative volume of the sizeGroup
191  inline const dimensionedScalar& x() const;
192 
193  //- Return reference to diameterModel of the phase
195 
196  //- Return const-reference to diameterModel of the phase
197  inline const autoPtr<shapeModel>& shapeModelPtr() const;
198 
199  //- Return label of the sizeGroup within the population balance
200  const autoPtr<label>& i() const;
201 
202  //- Return representative surface area of the sizeGroup
203  const tmp<volScalarField> a() const;
204 
205  //- Return representative diameter of the sizeGroup
206  const tmp<volScalarField> d() const;
207 
208  //- Correct secondary properties
209  void correct();
210 };
211 
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 } // End namespace diameterModels
216 } // End namespace Foam
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 #include "sizeGroupI.H"
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
autoPtr< sizeGroup > operator()(Istream &is) const
Definition: sizeGroup.H:168
const word & name() const
Return name.
Definition: IOobject.H:303
const dimensionedScalar & x() const
Return representative volume of the sizeGroup.
Definition: sizeGroupI.H:57
const keyType & keyword() const
Return keyword.
Definition: entry.H:123
const dimensionedScalar & dSph() const
Return representative spherical diameter of the sizeGroup.
Definition: sizeGroupI.H:50
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
sizeGroup(const word &name, const dictionary &dict, const phaseModel &phase, const velocityGroup &velocityGroup, const fvMesh &mesh)
const tmp< volScalarField > d() const
Return representative diameter of the sizeGroup.
This diameterModel is intended for use with a populationBalanceModel in order to simulate polydispers...
A keyword and a list of tokens is a &#39;dictionaryEntry&#39;.
const phaseModel & phase() const
Return const-reference to the phase.
Definition: sizeGroupI.H:36
Return a pointer to a new sizeGroup created on freestore.
Definition: sizeGroup.H:151
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
void correct()
Correct secondary properties.
const tmp< volScalarField > a() const
Return representative surface area of the sizeGroup.
virtual ~sizeGroup()
Destructor.
autoPtr< sizeGroup > clone() const
Return clone.
A class for handling words, derived from string.
Definition: word.H:59
static const dictionary null
Null dictionary.
Definition: dictionary.H:242
const Mesh & mesh() const
Return mesh.
const dictionary & dict() const
Return const-reference to the dictionary.
Definition: sizeGroupI.H:29
autoPtr< shapeModel > & shapeModelPtr()
Return reference to diameterModel of the phase.
Definition: sizeGroupI.H:64
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phase.H:52
const autoPtr< label > & i() const
Return label of the sizeGroup within the population balance.
A class for managing temporary objects.
Definition: PtrList.H:53
Single incompressible phase derived from the phase-fraction. Used as part of the multiPhaseMixture fo...
Definition: phaseModel.H:53
iNew(const phaseModel &phase, const velocityGroup &velocityGroup)
Definition: sizeGroup.H:159
const velocityGroup & VelocityGroup() const
Return const-reference to the velocityGroup.
Definition: sizeGroupI.H:43
Namespace for OpenFOAM.