nucleationModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::diameterModels::nucleationModel
28 
29 Description
30  Base class for nucleation models.
31 
32 SourceFiles
33  nucleationModel.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef nucleationModel_H
38 #define nucleationModel_H
39 
40 #include "populationBalanceModel.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace diameterModels
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class nucleationModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class nucleationModel
54 {
55 protected:
56 
57  // Protected data
58 
59  //- Reference to the populationBalanceModel
61 
62 
63 public:
64 
65  //- Runtime type information
66  TypeName("nucleationModel");
67 
68 
69  // Declare run-time constructor selection table
70 
72  (
73  autoPtr,
75  dictionary,
76  (
78  const dictionary& dict
79  ),
80  (popBal, dict)
81  );
82 
83 
84  //- Class used for the read-construction of
85  // PtrLists of nucleation models
86  class iNew
87  {
88  const populationBalanceModel& popBal_;
89 
90  public:
91 
93  :
94  popBal_(popBal)
95  {}
96 
98  {
99  word type(is);
100  dictionary dict(is);
101  return nucleationModel::New(type, popBal_, dict);
102  }
103  };
104 
105 
106  // Constructor
107 
109  (
111  const dictionary& dict
112  );
113 
115  {
117  return autoPtr<nucleationModel>(nullptr);
118  }
119 
120 
121  // Selector
122 
124  (
125  const word& type,
127  const dictionary& dict
128  );
129 
130 
131  //- Destructor
132  virtual ~nucleationModel() = default;
133 
134 
135  // Member Functions
136 
137  //- Return reference to the populationBalanceModel
138  const populationBalanceModel& popBal() const
139  {
140  return popBal_;
141  }
142 
143  //- Correct diameter independent expressions
144  virtual void correct();
145 
146  //- Add to nucleationRate
147  virtual void addToNucleationRate
148  (
149  volScalarField& nucleationRate,
150  const label i
151  ) = 0;
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace diameterModels
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
populationBalanceModel.H
Foam::diameterModels::nucleationModel::TypeName
TypeName("nucleationModel")
Runtime type information.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::diameterModels::nucleationModel::addToNucleationRate
virtual void addToNucleationRate(volScalarField &nucleationRate, const label i)=0
Add to nucleationRate.
Foam::diameterModels::nucleationModel
Base class for nucleation models.
Definition: nucleationModel.H:52
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::diameterModels::nucleationModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, nucleationModel, dictionary,(const populationBalanceModel &popBal, const dictionary &dict),(popBal, dict))
Foam::diameterModels::nucleationModel::clone
autoPtr< nucleationModel > clone() const
Definition: nucleationModel.H:113
Foam::diameterModels::nucleationModel::nucleationModel
nucleationModel(const populationBalanceModel &popBal, const dictionary &dict)
Definition: nucleationModel.C:74
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::diameterModels::populationBalanceModel
Class that solves the univariate population balance equation by means of a class method (also called ...
Definition: populationBalanceModel.H:179
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::diameterModels::nucleationModel::popBal_
const populationBalanceModel & popBal_
Reference to the populationBalanceModel.
Definition: nucleationModel.H:59
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::diameterModels::nucleationModel::iNew::operator()
autoPtr< nucleationModel > operator()(Istream &is) const
Definition: nucleationModel.H:96
Foam::diameterModels::nucleationModel::iNew::iNew
iNew(const populationBalanceModel &popBal)
Definition: nucleationModel.H:91
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::diameterModels::nucleationModel::~nucleationModel
virtual ~nucleationModel()=default
Destructor.
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::diameterModels::nucleationModel::correct
virtual void correct()
Correct diameter independent expressions.
Definition: nucleationModel.C:85
Foam::diameterModels::nucleationModel::iNew
Class used for the read-construction of.
Definition: nucleationModel.H:85
Foam::diameterModels::nucleationModel::popBal
const populationBalanceModel & popBal() const
Return reference to the populationBalanceModel.
Definition: nucleationModel.H:137
Foam::diameterModels::nucleationModel::New
static autoPtr< nucleationModel > New(const word &type, const populationBalanceModel &popBal, const dictionary &dict)
Definition: nucleationModel.C:48