driftModel.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) 2017-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::driftModel
26 
27 Description
28  Base class for drift models.
29 
30 SourceFiles
31  driftModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef driftModel_H
36 #define driftModel_H
37 
38 #include "populationBalanceModel.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace diameterModels
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class driftModel Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class driftModel
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("driftModel");
68 
69 
70  // Declare run-time constructor selection table
71 
73  (
74  autoPtr,
75  driftModel,
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 drift 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 driftModel::New(type, popBal_, dict);
103  }
104  };
105 
106 
107  // Constructor
108 
109  driftModel
110  (
111  const populationBalanceModel& popBal,
112  const dictionary& dict
113  );
115  autoPtr<driftModel> clone() const
116  {
118  return autoPtr<driftModel>(nullptr);
119  }
120 
121 
122  // Selector
123 
124  static autoPtr<driftModel> New
125  (
126  const word& type,
127  const populationBalanceModel& popBal,
128  const dictionary& dict
129  );
130 
131 
132  //- Destructor
133  virtual ~driftModel()
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  //- Precompute diameter independent expressions
152  virtual void precompute();
153 
154  //- Add to driftRate
155  virtual void addToDriftRate
156  (
157  volScalarField& driftRate,
158  const label i
159  ) = 0;
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace diameterModels
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
const dictionary & dict() const
Return reference to model dictionary.
Definition: driftModel.H:145
Base class for drift models.
Definition: driftModel.H:50
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
virtual ~driftModel()
Destructor.
Definition: driftModel.H:132
const dictionary dict_
Model dictionary.
Definition: driftModel.H:60
virtual void precompute()
Precompute diameter independent expressions.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
driftModel(const populationBalanceModel &popBal, const dictionary &dict)
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() const
Return reference to the populationBalanceModel.
Definition: driftModel.H:139
const populationBalanceModel & popBal_
Reference to the populationBalanceModel.
Definition: driftModel.H:57
Class used for the read-construction of.
Definition: driftModel.H:86
declareRunTimeSelectionTable(autoPtr, driftModel, dictionary,(const populationBalanceModel &popBal, const dictionary &dict),(popBal, dict))
autoPtr< driftModel > operator()(Istream &is) const
Definition: driftModel.H:97
static autoPtr< driftModel > New(const word &type, const populationBalanceModel &popBal, const dictionary &dict)
A class for handling words, derived from string.
Definition: word.H:59
autoPtr< driftModel > clone() const
Definition: driftModel.H:114
virtual void addToDriftRate(volScalarField &driftRate, const label i)=0
Add to driftRate.
iNew(const populationBalanceModel &popBal)
Definition: driftModel.H:92
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
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:370
TypeName("driftModel")
Runtime type information.
Namespace for OpenFOAM.