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-2018 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 diameter. 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 Usage
39  \table
40  Property | Description | Required | Default value
41  d | Representative diameter | yes |
42  value | Field and BC value | yes |
43  \endtable
44 
45  Example
46  \verbatim
47  f1
48  {
49  d 3e-3;
50  value 1.0;
51  }
52  \endverbatim
53 
54 See also
55  Foam::diameterModels::velocityGroup
56  Foam::diameterModels::populationBalanceModel
57 
58 SourceFiles
59  sizeGroup.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef sizeGroup_H
64 #define sizeGroup_H
65 
66 #include "dictionaryEntry.H"
67 #include "velocityGroup.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 namespace diameterModels
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class sizeGroup Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class sizeGroup
81 :
82  public volScalarField
83 {
84  // Private data
85 
86  //- Phase this sizeGroup belongs to
87  const phaseModel& phase_;
88 
89  //- VelocityGroup this sizeGroup belongs to
90  const velocityGroup& velocityGroup_;
91 
92  //- Representative diameter of the sizeGroup
93  const dimensionedScalar d_;
94 
95  //- Representative volume of the sizeGroup
96  const dimensionedScalar x_;
97 
98  //- Initial value and value at boundaries
99  const scalar value_;
100 
101 
102 public:
103 
104  // Constructors
105 
106  sizeGroup
107  (
108  const word& name,
109  const dictionary& dict,
110  const phaseModel& phase,
112  const fvMesh& mesh
113  );
114 
115  //- Return clone
116  autoPtr<sizeGroup> clone() const;
117 
118  //- Return a pointer to a new sizeGroup created on freestore
119  // from Istream
120  class iNew
121  {
122  const phaseModel& phase_;
123  const velocityGroup& velocityGroup_;
124 
125  public:
126 
127  iNew
128  (
129  const phaseModel& phase,
131  )
132  :
133  phase_(phase),
134  velocityGroup_(velocityGroup)
135  {}
136 
138  {
140  return autoPtr<sizeGroup>
141  (
143  (
144  ent.keyword(),
145  ent,
146  phase_,
147  velocityGroup_,
148  phase_.mesh()
149  )
150  );
151  }
152  };
153 
154 
155  //- Destructor
156  virtual ~sizeGroup();
157 
158 
159  // Member Functions
160 
161  inline const word& keyword() const;
162 
163  //- Return const-reference to the phase
164  inline const phaseModel& phase() const;
165 
166  //- Return const-reference to the velocityGroup
167  inline const velocityGroup& VelocityGroup() const;
168 
169  //- Return representative diameter of the sizeGroup
170  inline const dimensionedScalar& d() const;
171 
172  //- Return representative volume of the sizeGroup
173  inline const dimensionedScalar& x() const;
174 };
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace diameterModels
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #include "sizeGroupI.H"
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
autoPtr< sizeGroup > operator()(Istream &is) const
Definition: sizeGroup.H:151
dictionary dict
const word & name() const
Return name.
Definition: IOobject.H:297
const dimensionedScalar & x() const
Return representative volume of the sizeGroup.
Definition: sizeGroupI.H:57
const keyType & keyword() const
Return keyword.
Definition: entry.H:123
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
const word & keyword() const
Definition: sizeGroupI.H:29
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
static const dictionary null
Null dictionary.
Definition: dictionary.H:202
sizeGroup(const word &name, const dictionary &dict, const phaseModel &phase, const velocityGroup &velocityGroup, const fvMesh &mesh)
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:134
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
virtual ~sizeGroup()
Destructor.
autoPtr< sizeGroup > clone() const
Return clone.
A class for handling words, derived from string.
Definition: word.H:59
const Mesh & mesh() const
Return mesh.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
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
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
const dimensionedScalar & d() const
Return representative diameter of the sizeGroup.
Definition: sizeGroupI.H:50
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:142
const velocityGroup & VelocityGroup() const
Return const-reference to the velocityGroup.
Definition: sizeGroupI.H:43
Namespace for OpenFOAM.