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 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 
61 public:
62 
63  //- Runtime type information
64  TypeName("nucleationModel");
65 
66 
67  // Declare run-time constructor selection table
68 
70  (
71  autoPtr,
73  dictionary,
74  (
76  const dictionary& dict
77  ),
78  (popBal, dict)
79  );
80 
81 
82  //- Class used for the read-construction of
83  // PtrLists of nucleation models
84  class iNew
85  {
86  const populationBalanceModel& popBal_;
87 
88  public:
89 
90  iNew(const populationBalanceModel& popBal)
91  :
92  popBal_(popBal)
93  {}
94 
96  {
97  word type(is);
98  dictionary dict(is);
99  return nucleationModel::New(type, popBal_, dict);
100  }
101  };
102 
103 
104  // Constructor
105 
107  (
108  const populationBalanceModel& popBal,
109  const dictionary& dict
110  );
113  {
115  return autoPtr<nucleationModel>(nullptr);
116  }
117 
118 
119  // Selector
120 
122  (
123  const word& type,
124  const populationBalanceModel& popBal,
125  const dictionary& dict
126  );
127 
128 
129  //- Destructor
130  virtual ~nucleationModel()
131  {}
132 
133 
134  // Member Functions
135 
136  //- Return reference to the populationBalanceModel
137  const populationBalanceModel& popBal() const
138  {
139  return popBal_;
140  }
141 
142  //- Correct diameter independent expressions
143  virtual void correct();
144 
145  //- Add to nucleationRate
146  virtual void addToNucleationRate
147  (
148  volScalarField& nucleationRate,
149  const label i
150  ) = 0;
151 };
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace diameterModels
157 } // End namespace Foam
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
iNew(const populationBalanceModel &popBal)
dictionary dict
virtual void correct()
Correct diameter independent expressions.
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:158
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.
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.
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
const populationBalanceModel & popBal() const
Return reference to the populationBalanceModel.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
autoPtr< nucleationModel > operator()(Istream &is) const
Namespace for OpenFOAM.
TypeName("nucleationModel")
Runtime type information.