nucleationModel.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) 2018-2022 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::nucleationModel
26 
27 Description
28  Base class for nucleation models.
29 
30 See also
31  Foam::diameterModels::populationBalanceModel
32 
33 SourceFiles
34  nucleationModel.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef nucleationModel_H
39 #define nucleationModel_H
40 
41 #include "populationBalanceModel.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 namespace diameterModels
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class nucleationModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class nucleationModel
55 {
56 protected:
57 
58  // Protected Data
59 
60  //- Reference to the populationBalanceModel
62 
63  //- Model dictionary
64  const dictionary dict_;
65 
66  //- Velocity group in which the nucleation occurs
67  const velocityGroup& velGroup_;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("nucleationModel");
74 
75 
76  // Declare run-time constructor selection table
77 
79  (
80  autoPtr,
82  dictionary,
83  (
85  const dictionary& dict
86  ),
87  (popBal, dict)
88  );
89 
90 
91  //- Class used for the read-construction of
92  // PtrLists of nucleation models
93  class iNew
94  {
95  const populationBalanceModel& popBal_;
96 
97  public:
98 
99  iNew(const populationBalanceModel& popBal)
100  :
101  popBal_(popBal)
102  {}
105  {
106  word type(is);
107  dictionary dict(is);
108  return nucleationModel::New(type, popBal_, dict);
109  }
110  };
111 
112 
113  // Constructor
114 
116  (
117  const populationBalanceModel& popBal,
118  const dictionary& dict
119  );
122  {
124  return autoPtr<nucleationModel>(nullptr);
125  }
126 
127 
128  // Selector
129 
131  (
132  const word& type,
133  const populationBalanceModel& popBal,
134  const dictionary& dict
135  );
136 
137 
138  //- Destructor
139  virtual ~nucleationModel()
140  {}
141 
142 
143  // Member Functions
144 
145  //- Return reference to the populationBalanceModel
146  const populationBalanceModel& popBal() const
147  {
148  return popBal_;
149  }
150 
151  //- Return reference to model dictionary
152  const dictionary& dict() const
153  {
154  return dict_;
155  }
156 
157 
158  //- Precompute diameter independent expressions
159  virtual void precompute();
160 
161  //- Add to nucleationRate
162  virtual void addToNucleationRate
163  (
164  volScalarField& nucleationRate,
165  const label i
166  ) = 0;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace diameterModels
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
iNew(const populationBalanceModel &popBal)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Model for tracking the evolution of a dispersed phase size distribution due to coalescence (synonymou...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
const velocityGroup & velGroup_
Velocity group in which the nucleation occurs.
const populationBalanceModel & popBal_
Reference to the populationBalanceModel.
Computes the Sauter mean diameter based on a user specified size distribution, defined in terms of si...
Definition: velocityGroup.H:83
const dictionary & dict() const
Return reference to model dictionary.
Base class for nucleation models.
autoPtr< nucleationModel > clone() const
A class for handling words, derived from string.
Definition: word.H:59
virtual void addToNucleationRate(volScalarField &nucleationRate, const label i)=0
Add to nucleationRate.
const dictionary dict_
Model dictionary.
Class used for the read-construction of.
static autoPtr< nucleationModel > New(const word &type, const populationBalanceModel &popBal, const dictionary &dict)
declareRunTimeSelectionTable(autoPtr, nucleationModel, dictionary,(const populationBalanceModel &popBal, const dictionary &dict),(popBal, dict))
nucleationModel(const populationBalanceModel &popBal, const dictionary &dict)
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
virtual void precompute()
Precompute diameter independent expressions.
const populationBalanceModel & popBal() const
Return reference to the populationBalanceModel.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:353
autoPtr< nucleationModel > operator()(Istream &is) const
Namespace for OpenFOAM.
TypeName("nucleationModel")
Runtime type information.