sizeGroup.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2017-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::diameterModels::sizeGroup
28 
29 Description
30  This class represents a single sizeGroup belonging to a velocityGroup.
31  The main property of a sizeGroup is its representative diameter. The
32  corresponding volScalarField f<number>.<phaseName>.<populationBalanceName>
33  gives the volume fraction of the sizeGroup such that all sizeGroup fractions
34  over a velocityGroup must sum to unity. The field is either read from the
35  startTime directory if present or constructed from a reference field called
36  f.<phaseName>.<populationBalanceName> where the boundary condition types
37  must be specified. All field and boundary condition values are reset to
38  match the "value" given in the sizeGroup subdictionary.
39 
40 Usage
41  \table
42  Property | Description | Required | Default value
43  d | Representative diameter | yes |
44  value | Field and BC value | yes |
45  \endtable
46 
47  Example
48  \verbatim
49  f1
50  {
51  d 3e-3;
52  value 1.0;
53  }
54  \endverbatim
55 
56 See also
57  Foam::diameterModels::velocityGroup
58  Foam::diameterModels::populationBalanceModel
59 
60 SourceFiles
61  sizeGroup.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef sizeGroup_H
66 #define sizeGroup_H
67 
68 #include "dictionaryEntry.H"
69 #include "velocityGroup.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 namespace diameterModels
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class sizeGroup Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class sizeGroup
83 :
84  public volScalarField
85 {
86  // Private data
87 
88  //- Phase this sizeGroup belongs to
89  const phaseModel& phase_;
90 
91  //- VelocityGroup this sizeGroup belongs to
92  const velocityGroup& velocityGroup_;
93 
94  //- Representative diameter of the sizeGroup
95  const dimensionedScalar d_;
96 
97  //- Representative volume of the sizeGroup
98  const dimensionedScalar x_;
99 
100  //- Initial value and value at boundaries
101  const scalar value_;
102 
103 
104 public:
105 
106  // Constructors
107 
108  sizeGroup
109  (
110  const word& name,
111  const dictionary& dict,
112  const phaseModel& phase,
114  const fvMesh& mesh
115  );
116 
117  //- Return clone
118  autoPtr<sizeGroup> clone() const;
119 
120  //- Return a pointer to a new sizeGroup created on freestore
121  // from Istream
122  class iNew
123  {
124  const phaseModel& phase_;
125  const velocityGroup& velocityGroup_;
126 
127  public:
128 
129  iNew
130  (
131  const phaseModel& phase,
133  )
134  :
135  phase_(phase),
136  velocityGroup_(velocityGroup)
137  {}
138 
140  {
142  return autoPtr<sizeGroup>
143  (
144  new sizeGroup
145  (
146  ent.keyword(),
147  ent,
148  phase_,
149  velocityGroup_,
150  phase_.mesh()
151  )
152  );
153  }
154  };
156 
157  //- Destructor
158  virtual ~sizeGroup();
159 
160 
161  // Member Functions
162 
163  inline const word& keyword() const;
165  //- Return const-reference to the phase
166  inline const phaseModel& phase() const;
167 
168  //- Return const-reference to the velocityGroup
169  inline const velocityGroup& VelocityGroup() const;
170 
171  //- Return representative diameter of the sizeGroup
172  inline const dimensionedScalar& d() const;
173 
174  //- Return representative volume of the sizeGroup
175  inline const dimensionedScalar& x() const;
176 };
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace diameterModels
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #include "sizeGroupI.H"
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #endif
191 
192 // ************************************************************************* //
autoPtr< sizeGroup > operator()(Istream &is) const
Definition: sizeGroup.H:164
dictionary dict
const dimensionedScalar & x() const
Return representative volume of the sizeGroup.
Definition: sizeGroupI.H:52
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:195
const word & keyword() const
Definition: sizeGroupI.H:24
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)
Definition: sizeGroup.C:29
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:31
Return a pointer to a new sizeGroup created on freestore.
Definition: sizeGroup.H:147
autoPtr< sizeGroup > clone() const
Return clone.
Definition: sizeGroup.C:96
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
A class for handling words, derived from Foam::string.
Definition: word.H:63
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:474
const Mesh & mesh() const noexcept
Return mesh.
virtual ~sizeGroup()
Destructor.
Definition: sizeGroup.C:89
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:50
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
const dimensionedScalar & d() const
Return representative diameter of the sizeGroup.
Definition: sizeGroupI.H:45
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:155
const velocityGroup & VelocityGroup() const
Return const-reference to the velocityGroup.
Definition: sizeGroupI.H:38
Namespace for OpenFOAM.