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-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::nucleationModel
26 
27 Description
28  Base class for nucleation models.
29 
30 SourceFiles
31  nucleationModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef nucleationModel_H
36 #define nucleationModel_H
37 
38 #include "populationBalanceModel.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace diameterModels
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class nucleationModel Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class nucleationModel
52 {
53 protected:
54 
55  // Protected Data
56 
57  //- Reference to the populationBalanceModel
59 
60  //- Model dictionary
61  const dictionary dict_;
62 
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("nucleationModel");
68 
69 
70  // Declare run-time constructor selection table
71 
73  (
74  autoPtr,
76  dictionary,
77  (
79  const dictionary& dict
80  ),
81  (popBal, dict)
82  );
83 
84 
85  //- Class used for the read-construction of
86  // PtrLists of nucleation models
87  class iNew
88  {
89  const populationBalanceModel& popBal_;
90 
91  public:
92 
93  iNew(const populationBalanceModel& popBal)
94  :
95  popBal_(popBal)
96  {}
97 
99  {
100  word type(is);
101  dictionary dict(is);
102  return nucleationModel::New(type, popBal_, dict);
103  }
104  };
105 
106 
107  // Constructor
108 
110  (
111  const populationBalanceModel& popBal,
112  const dictionary& dict
113  );
116  {
118  return autoPtr<nucleationModel>(nullptr);
119  }
120 
121 
122  // Selector
123 
125  (
126  const word& type,
127  const populationBalanceModel& popBal,
128  const dictionary& dict
129  );
130 
131 
132  //- Destructor
133  virtual ~nucleationModel()
134  {}
135 
136 
137  // Member Functions
138 
139  //- Return reference to the populationBalanceModel
140  const populationBalanceModel& popBal() const
141  {
142  return popBal_;
143  }
144 
145  //- Return reference to model dictionary
146  const dictionary& dict() const
147  {
148  return dict_;
149  }
150 
151 
152  //- Precompute diameter independent expressions
153  virtual void precompute();
154 
155  //- Add to nucleationRate
156  virtual void addToNucleationRate
157  (
158  volScalarField& nucleationRate,
159  const label i
160  ) = 0;
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace diameterModels
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
iNew(const populationBalanceModel &popBal)
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
Class that solves the univariate population balance equation by means of a class method (also called ...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
const populationBalanceModel & popBal_
Reference to the populationBalanceModel.
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:370
autoPtr< nucleationModel > operator()(Istream &is) const
Namespace for OpenFOAM.
TypeName("nucleationModel")
Runtime type information.