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-2023 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 
97  :
98  popBal_(popBal)
99  {}
100 
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  (
115  const dictionary& dict
116  );
117 
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,
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 // ************************************************************************* //
Generic GeometricField class.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Class used for the read-construction of.
Definition: driftModel.H:90
iNew(const populationBalanceModel &popBal)
Definition: driftModel.H:95
autoPtr< driftModel > operator()(Istream &is) const
Definition: driftModel.H:100
Base class for drift models.
Definition: driftModel.H:54
virtual void precompute()
Precompute diameter independent expressions.
Definition: driftModel.C:86
const dictionary & dict() const
Return reference to model dictionary.
Definition: driftModel.H:148
const populationBalanceModel & popBal_
Reference to the populationBalanceModel.
Definition: driftModel.H:60
declareRunTimeSelectionTable(autoPtr, driftModel, dictionary,(const populationBalanceModel &popBal, const dictionary &dict),(popBal, dict))
TypeName("driftModel")
Runtime type information.
const populationBalanceModel & popBal() const
Return reference to the populationBalanceModel.
Definition: driftModel.H:142
autoPtr< driftModel > clone() const
Definition: driftModel.H:117
const dictionary dict_
Model dictionary.
Definition: driftModel.H:63
driftModel(const populationBalanceModel &popBal, const dictionary &dict)
Definition: driftModel.C:74
virtual ~driftModel()
Destructor.
Definition: driftModel.H:135
static autoPtr< driftModel > New(const word &type, const populationBalanceModel &popBal, const dictionary &dict)
Definition: driftModel.C:45
virtual void addToDriftRate(volScalarField &driftRate, const label i)=0
Add to driftRate.
Model for tracking the evolution of a dispersed phase size distribution due to coalescence (synonymou...
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
A class for handling words, derived from string.
Definition: word.H:62
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:381
Namespace for OpenFOAM.
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
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488