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) 2011-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::BreakupModel
26 
27 Description
28  Templated break-up model class
29 
30 SourceFiles
31  BreakupModel.C
32  BreakupModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef BreakupModel_H
37 #define BreakupModel_H
38 
39 #include "IOdictionary.H"
40 #include "autoPtr.H"
41 #include "runTimeSelectionTables.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class BreakupModel Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class CloudType>
53 class BreakupModel
54 :
55  public CloudSubModelBase<CloudType>
56 {
57 
58 protected:
59 
60  // Protected data
61 
63 
64  scalar y0_;
65  scalar yDot0_;
66 
67  scalar TABComega_;
68  scalar TABCmu_;
69  scalar TABtwoWeCrit_;
70 
71 
72 public:
73 
74  //- Runtime type information
75  TypeName("breakupModel");
76 
77  //- Declare runtime constructor selection table
79  (
80  autoPtr,
82  dictionary,
83  (
84  const dictionary& dict,
86  ),
87  (dict, owner)
88  );
89 
90 
91  // Constructors
92 
93  //- Construct null from owner
95 
96  //- Construct from dictionary
98  (
99  const dictionary& dict,
100  CloudType& owner,
101  const word& type,
102  bool solveOscillationEq = false
103  );
104 
105  //- Construct copy
107 
108  //- Construct and return a clone
109  virtual autoPtr<BreakupModel<CloudType>> clone() const = 0;
110 
111 
112  //- Destructor
113  virtual ~BreakupModel();
114 
115 
116  //- Selector
118  (
119  const dictionary& dict,
121  );
122 
123 
124  // Access
125 
126  inline const Switch& solveOscillationEq() const
127  {
128  return solveOscillationEq_;
129  }
130 
131  inline const scalar& y0() const
132  {
133  return y0_;
134  }
135 
136  inline const scalar& yDot0() const
137  {
138  return yDot0_;
139  }
140 
141  inline const scalar& TABComega() const
142  {
143  return TABComega_;
144  }
145 
146  inline const scalar& TABCmu() const
147  {
148  return TABCmu_;
149  }
150 
151  inline const scalar& TABtwoWeCrit() const
152  {
153  return TABtwoWeCrit_;
154  }
155 
156 
157  // Member Functions
158 
159  //- Update the parcel properties and return true if a child parcel
160  // should be added
161  virtual bool update
162  (
163  const scalar dt,
164  const vector& g,
165  scalar& d,
166  scalar& tc,
167  scalar& ms,
168  scalar& nParticle,
169  scalar& KHindex,
170  scalar& y,
171  scalar& yDot,
172  const scalar d0,
173  const scalar rho,
174  const scalar mu,
175  const scalar sigma,
176  const vector& U,
177  const scalar rhoc,
178  const scalar muc,
179  const vector& Urel,
180  const scalar Urmag,
181  const scalar tMom,
182  const label injectori,
183  scalar& dChild,
184  scalar& massChild
185  ) = 0;
186 };
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace Foam
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #define makeBreakupModel(CloudType) \
196  \
197  typedef Foam::CloudType::sprayCloudType sprayCloudType; \
198  defineNamedTemplateTypeNameAndDebug \
199  ( \
200  Foam::BreakupModel<sprayCloudType>, \
201  0 \
202  ); \
203  \
204  namespace Foam \
205  { \
206  defineTemplateRunTimeSelectionTable \
207  ( \
208  BreakupModel<sprayCloudType>, \
209  dictionary \
210  ); \
211  }
212 
213 
214 #define makeBreakupModelType(SS, CloudType) \
215  \
216  typedef Foam::CloudType::sprayCloudType sprayCloudType; \
217  defineNamedTemplateTypeNameAndDebug(Foam::SS<sprayCloudType>, 0); \
218  \
219  Foam::BreakupModel<sprayCloudType>:: \
220  adddictionaryConstructorToTable<Foam::SS<sprayCloudType>> \
221  add##SS##CloudType##sprayCloudType##ConstructorToTable_;
222 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 #ifdef NoRepository
227  #include "BreakupModel.C"
228 #endif
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 #endif
233 
234 // ************************************************************************* //
scalar y
Templated break-up model class.
Definition: BreakupModel.H:55
static autoPtr< BreakupModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
const scalar & TABtwoWeCrit() const
Definition: BreakupModel.H:150
const scalar & y0() const
Definition: BreakupModel.H:130
declareRunTimeSelectionTable(autoPtr, BreakupModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
virtual bool update(const scalar dt, const vector &g, scalar &d, scalar &tc, scalar &ms, scalar &nParticle, scalar &KHindex, scalar &y, scalar &yDot, const scalar d0, const scalar rho, const scalar mu, const scalar sigma, const vector &U, const scalar rhoc, const scalar muc, const vector &Urel, const scalar Urmag, const scalar tMom, const label injectori, scalar &dChild, scalar &massChild)=0
Update the parcel properties and return true if a child parcel.
const scalar & yDot0() const
Definition: BreakupModel.H:135
const scalar & TABComega() const
Definition: BreakupModel.H:140
const scalar & TABCmu() const
Definition: BreakupModel.H:145
const Switch & solveOscillationEq() const
Definition: BreakupModel.H:125
BreakupModel(CloudType &owner)
Construct null from owner.
Definition: BreakupModel.C:32
virtual ~BreakupModel()
Destructor.
Definition: BreakupModel.C:93
TypeName("breakupModel")
Runtime type information.
virtual autoPtr< BreakupModel< CloudType > > clone() const =0
Construct and return a clone.
Switch solveOscillationEq_
Definition: BreakupModel.H:61
Base class for cloud sub-models.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:80
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
A class for handling words, derived from string.
Definition: word.H:62
U
Definition: pEqn.H:72
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
const dimensionedScalar mu
Atomic mass unit.
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
Macros to ease declaration of run-time selection tables.