breakupModel.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::breakupModel
26 
27 Description
28  Base class for breakup models which provide a total breakup rate and a
29  separate daughter size distribution function.
30 
31 See also
32  Foam::diameterModels::populationBalanceModel
33 
34 SourceFiles
35  breakupModel.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef breakupModel_H
40 #define breakupModel_H
41 
42 #include "populationBalanceModel.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 namespace diameterModels
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class breakupModel Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class breakupModel
57 {
58 protected:
59 
60  // Protected Data
61 
62  //- Reference to the populationBalanceModel
64 
65  //- Dictionary
67 
68  //- Daughter size distribution model
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("breakupModel");
76 
77 
78  // Declare run-time constructor selection table
79 
81  (
82  autoPtr,
84  dictionary,
85  (
87  const dictionary& dict
88  ),
89  (popBal, dict)
90  );
91 
92 
93  //- Class used for the read-construction of
94  // PtrLists of breakup models
95  class iNew
96  {
97  const populationBalanceModel& popBal_;
98 
99  public:
100 
102  :
103  popBal_(popBal)
104  {}
105 
107  {
108  word type(is);
109  dictionary dict(is);
110  return breakupModel::New(type, popBal_, dict);
111  }
112  };
113 
114 
115  // Constructor
116 
118  (
120  const dictionary& dict
121  );
122 
124  {
126  return autoPtr<breakupModel>(nullptr);
127  }
128 
129 
130  // Selector
131 
133  (
134  const word& type,
136  const dictionary& dict
137  );
138 
139 
140  //- Destructor
141  virtual ~breakupModel()
142  {}
143 
144 
145  // Member Functions
146 
147  //- Return reference to the populationBalanceModel
148  const populationBalanceModel& popBal() const
149  {
150  return popBal_;
151  }
152 
153  //- Return const-reference to daughter size distribution pointer
155  {
156  return dsd_;
157  }
158 
159  //- Return reference to daughter size distribution pointer
161  {
162  return dsd_;
163  }
164 
165  //- Precompute diameter independent expressions
166  virtual void precompute();
167 
168  //- Set total breakupRate
169  virtual void setBreakupRate
170  (
171  volScalarField& breakupRate,
172  const label i
173  ) = 0;
174 };
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace diameterModels
180 } // End namespace Foam
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
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: breakupModel.H:95
iNew(const populationBalanceModel &popBal)
Definition: breakupModel.H:100
autoPtr< breakupModel > operator()(Istream &is) const
Definition: breakupModel.H:105
Base class for breakup models which provide a total breakup rate and a separate daughter size distrib...
Definition: breakupModel.H:56
virtual void precompute()
Precompute diameter independent expressions.
Definition: breakupModel.C:87
virtual void setBreakupRate(volScalarField &breakupRate, const label i)=0
Set total breakupRate.
autoPtr< daughterSizeDistributionModel > dsd_
Daughter size distribution model.
Definition: breakupModel.H:68
declareRunTimeSelectionTable(autoPtr, breakupModel, dictionary,(const populationBalanceModel &popBal, const dictionary &dict),(popBal, dict))
autoPtr< breakupModel > clone() const
Definition: breakupModel.H:122
static autoPtr< breakupModel > New(const word &type, const populationBalanceModel &popBal, const dictionary &dict)
Definition: breakupModel.C:44
dictionary dict_
Dictionary.
Definition: breakupModel.H:65
const populationBalanceModel & popBal_
Reference to the populationBalanceModel.
Definition: breakupModel.H:62
const autoPtr< daughterSizeDistributionModel > & dsdPtr() const
Return const-reference to daughter size distribution pointer.
Definition: breakupModel.H:153
const populationBalanceModel & popBal() const
Return reference to the populationBalanceModel.
Definition: breakupModel.H:147
virtual ~breakupModel()
Destructor.
Definition: breakupModel.H:140
breakupModel(const populationBalanceModel &popBal, const dictionary &dict)
Definition: breakupModel.C:73
TypeName("breakupModel")
Runtime type information.
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
dictionary dict