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-2018 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 give a total breakup rate and a separate
29  daughter size distribution function.
30 
31 SourceFiles
32  breakupModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef breakupModel_H
37 #define breakupModel_H
38 
39 #include "populationBalanceModel.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace diameterModels
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class breakupModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class breakupModel
54 {
55 protected:
56 
57  // Protected data
58 
59  //- Reference to the populationBalanceModel
61 
62  //- Dictionary
64 
65  //- Daughter size distribution model
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("breakupModel");
73 
74 
75  // Declare run-time constructor selection table
76 
78  (
79  autoPtr,
81  dictionary,
82  (
84  const dictionary& dict
85  ),
86  (popBal, dict)
87  );
88 
89 
90  //- Class used for the read-construction of
91  // PtrLists of breakup models
92  class iNew
93  {
94  const populationBalanceModel& popBal_;
95 
96  public:
97 
98  iNew(const populationBalanceModel& popBal)
99  :
100  popBal_(popBal)
101  {}
104  {
105  word type(is);
106  dictionary dict(is);
107  return breakupModel::New(type, popBal_, dict);
108  }
109  };
110 
111 
112  // Constructor
113 
115  (
116  const populationBalanceModel& popBal,
117  const dictionary& dict
118  );
121  {
123  return autoPtr<breakupModel>(nullptr);
124  }
125 
126 
127  // Selector
128 
130  (
131  const word& type,
132  const populationBalanceModel& popBal,
133  const dictionary& dict
134  );
135 
136 
137  //- Destructor
138  virtual ~breakupModel()
139  {}
140 
141 
142  // Member Functions
143 
144  //- Return reference to the populationBalanceModel
145  const populationBalanceModel& popBal() const
146  {
147  return popBal_;
148  }
149 
150  //- Return const-reference to daughter size distribution pointer
152  {
153  return dsd_;
154  }
155 
156  //- Return reference to daughter size distribution pointer
158  {
159  return dsd_;
160  }
161 
162  //- Correct diameter independent expressions
163  virtual void correct();
164 
165  //- Set total breakupRate
166  virtual void setBreakupRate
167  (
168  volScalarField& breakupRate,
169  const label i
170  ) = 0;
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace diameterModels
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
dictionary dict
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
autoPtr< breakupModel > clone() const
Definition: breakupModel.H:119
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
Class that solves the univariate population balance equation by means of a class method (also called ...
const autoPtr< daughterSizeDistributionModel > & dsdPtr() const
Return const-reference to daughter size distribution pointer.
Definition: breakupModel.H:150
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
dictionary dict_
Dictionary.
Definition: breakupModel.H:62
virtual ~breakupModel()
Destructor.
Definition: breakupModel.H:137
Base class for breakup models which give a total breakup rate and a separate daughter size distributi...
Definition: breakupModel.H:52
breakupModel(const populationBalanceModel &popBal, const dictionary &dict)
TypeName("breakupModel")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
static autoPtr< breakupModel > New(const word &type, const populationBalanceModel &popBal, const dictionary &dict)
autoPtr< daughterSizeDistributionModel > dsd_
Daughter size distribution model.
Definition: breakupModel.H:65
const populationBalanceModel & popBal_
Reference to the populationBalanceModel.
Definition: breakupModel.H:59
virtual void setBreakupRate(volScalarField &breakupRate, const label i)=0
Set total breakupRate.
Class used for the read-construction of.
Definition: breakupModel.H:91
const populationBalanceModel & popBal() const
Return reference to the populationBalanceModel.
Definition: breakupModel.H:144
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
virtual void correct()
Correct diameter independent expressions.
autoPtr< breakupModel > operator()(Istream &is) const
Definition: breakupModel.H:102
declareRunTimeSelectionTable(autoPtr, breakupModel, dictionary,(const populationBalanceModel &popBal, const dictionary &dict),(popBal, dict))
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
iNew(const populationBalanceModel &popBal)
Definition: breakupModel.H:97
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
Namespace for OpenFOAM.