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-2023 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 
100  :
101  popBal_(popBal)
102  {}
103 
105  {
106  word type(is);
107  dictionary dict(is);
108  return nucleationModel::New(type, popBal_, dict);
109  }
110  };
111 
112 
113  // Constructor
114 
116  (
118  const dictionary& dict
119  );
120 
122  {
124  return autoPtr<nucleationModel>(nullptr);
125  }
126 
127 
128  // Selector
129 
131  (
132  const word& type,
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 // ************************************************************************* //
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Class used for the read-construction of.
iNew(const populationBalanceModel &popBal)
autoPtr< nucleationModel > operator()(Istream &is) const
Base class for nucleation models.
autoPtr< nucleationModel > clone() const
virtual void precompute()
Precompute diameter independent expressions.
const dictionary & dict() const
Return reference to model dictionary.
nucleationModel(const populationBalanceModel &popBal, const dictionary &dict)
const populationBalanceModel & popBal_
Reference to the populationBalanceModel.
TypeName("nucleationModel")
Runtime type information.
const populationBalanceModel & popBal() const
Return reference to the populationBalanceModel.
virtual void addToNucleationRate(volScalarField &nucleationRate, const label i)=0
Add to nucleationRate.
const dictionary dict_
Model dictionary.
declareRunTimeSelectionTable(autoPtr, nucleationModel, dictionary,(const populationBalanceModel &popBal, const dictionary &dict),(popBal, dict))
static autoPtr< nucleationModel > New(const word &type, const populationBalanceModel &popBal, const dictionary &dict)
const velocityGroup & velGroup_
Velocity group in which the nucleation occurs.
Model for tracking the evolution of a dispersed phase size distribution due to coalescence (synonymou...
Computes the Sauter mean diameter based on a user specified size distribution, defined in terms of si...
Definition: velocityGroup.H:86
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
A class for handling words, derived from string.
Definition: word.H:62
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:353
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
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488