All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2022 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 See also
31  Foam::diameterModels::populationBalanceModel
32 
33 SourceFiles
34  driftModel.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef driftModel_H
39 #define driftModel_H
40 
41 #include "populationBalanceModel.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 namespace diameterModels
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class driftModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class driftModel
55 {
56 protected:
57 
58  // Protected Data
59 
60  //- Reference to the populationBalanceModel
62 
63  //- Model dictionary
64  const dictionary dict_;
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("driftModel");
71 
72 
73  // Declare run-time constructor selection table
74 
76  (
77  autoPtr,
78  driftModel,
79  dictionary,
80  (
82  const dictionary& dict
83  ),
84  (popBal, dict)
85  );
86 
87 
88  //- Class used for the read-construction of
89  // PtrLists of drift models
90  class iNew
91  {
92  const populationBalanceModel& popBal_;
93 
94  public:
95 
96  iNew(const populationBalanceModel& popBal)
97  :
98  popBal_(popBal)
99  {}
102  {
103  word type(is);
104  dictionary dict(is);
105  return driftModel::New(type, popBal_, dict);
106  }
107  };
108 
109 
110  // Constructor
111 
112  driftModel
113  (
114  const populationBalanceModel& popBal,
115  const dictionary& dict
116  );
118  autoPtr<driftModel> clone() const
119  {
121  return autoPtr<driftModel>(nullptr);
122  }
123 
124 
125  // Selector
126 
127  static autoPtr<driftModel> New
128  (
129  const word& type,
130  const populationBalanceModel& popBal,
131  const dictionary& dict
132  );
133 
134 
135  //- Destructor
136  virtual ~driftModel()
137  {}
138 
139 
140  // Member Functions
141 
142  //- Return reference to the populationBalanceModel
143  const populationBalanceModel& popBal() const
144  {
145  return popBal_;
146  }
147 
148  //- Return reference to model dictionary
149  const dictionary& dict() const
150  {
151  return dict_;
152  }
153 
154  //- Precompute diameter independent expressions
155  virtual void precompute();
156 
157  //- Add to driftRate
158  virtual void addToDriftRate
159  (
160  volScalarField& driftRate,
161  const label i
162  ) = 0;
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace diameterModels
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #endif
174 
175 // ************************************************************************* //
const dictionary & dict() const
Return reference to model dictionary.
Definition: driftModel.H:148
Base class for drift models.
Definition: driftModel.H:53
virtual ~driftModel()
Destructor.
Definition: driftModel.H:135
const dictionary dict_
Model dictionary.
Definition: driftModel.H:63
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)
Model for tracking the evolution of a dispersed phase size distribution due to coalescence (synonymou...
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:142
const populationBalanceModel & popBal_
Reference to the populationBalanceModel.
Definition: driftModel.H:60
Class used for the read-construction of.
Definition: driftModel.H:89
declareRunTimeSelectionTable(autoPtr, driftModel, dictionary,(const populationBalanceModel &popBal, const dictionary &dict),(popBal, dict))
autoPtr< driftModel > operator()(Istream &is) const
Definition: driftModel.H:100
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:117
virtual void addToDriftRate(volScalarField &driftRate, const label i)=0
Add to driftRate.
iNew(const populationBalanceModel &popBal)
Definition: driftModel.H:95
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:353
TypeName("driftModel")
Runtime type information.
Namespace for OpenFOAM.