All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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-2020 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
94  BreakupModel(CloudType& 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,
120  CloudType& owner
121  );
122 
123 
124  // Access
126  inline const Switch& solveOscillationEq() const
127  {
128  return solveOscillationEq_;
129  }
131  inline const scalar& y0() const
132  {
133  return y0_;
134  }
136  inline const scalar& yDot0() const
137  {
138  return yDot0_;
139  }
141  inline const scalar& TABComega() const
142  {
143  return TABComega_;
144  }
146  inline const scalar& TABCmu() const
147  {
148  return TABCmu_;
149  }
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  scalar& dChild,
183  scalar& massChild
184  ) = 0;
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 #define makeBreakupModel(CloudType) \
195  \
196  typedef Foam::CloudType::sprayCloudType sprayCloudType; \
197  defineNamedTemplateTypeNameAndDebug \
198  ( \
199  Foam::BreakupModel<sprayCloudType>, \
200  0 \
201  ); \
202  \
203  namespace Foam \
204  { \
205  defineTemplateRunTimeSelectionTable \
206  ( \
207  BreakupModel<sprayCloudType>, \
208  dictionary \
209  ); \
210  }
211 
213 #define makeBreakupModelType(SS, CloudType) \
214  \
215  typedef Foam::CloudType::sprayCloudType sprayCloudType; \
216  defineNamedTemplateTypeNameAndDebug(Foam::SS<sprayCloudType>, 0); \
217  \
218  Foam::BreakupModel<sprayCloudType>:: \
219  adddictionaryConstructorToTable<Foam::SS<sprayCloudType>> \
220  add##SS##CloudType##sprayCloudType##ConstructorToTable_;
221 
222 
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 
225 #ifdef NoRepository
226  #include "BreakupModel.C"
227 #endif
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 #endif
232 
233 // ************************************************************************* //
BreakupModel(CloudType &owner)
Construct null from owner.
Definition: BreakupModel.C:32
const scalar & TABComega() const
Definition: BreakupModel.H:140
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
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, scalar &dChild, scalar &massChild)=0
Update the parcel properties and return true if a child parcel.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
virtual autoPtr< BreakupModel< CloudType > > clone() const =0
Construct and return a clone.
const scalar & TABtwoWeCrit() const
Definition: BreakupModel.H:150
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
const CloudType & owner() const
Return const access to the owner cloud.
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
scalar y
A class for handling words, derived from string.
Definition: word.H:59
declareRunTimeSelectionTable(autoPtr, BreakupModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
static autoPtr< BreakupModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
TypeName("breakupModel")
Runtime type information.
Urel
Definition: pEqn.H:60
const dimensionedScalar mu
Atomic mass unit.
const scalar & y0() const
Definition: BreakupModel.H:130
Switch solveOscillationEq_
Definition: BreakupModel.H:61
virtual ~BreakupModel()
Destructor.
Definition: BreakupModel.C:93
U
Definition: pEqn.H:72
const Switch & solveOscillationEq() const
Definition: BreakupModel.H:125
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
Templated break-up model class.
Definition: SprayCloud.H:55
Macros to ease declaration of run-time selection tables.
const dimensionedVector & g
const scalar & TABCmu() const
Definition: BreakupModel.H:145
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Namespace for OpenFOAM.
const scalar & yDot0() const
Definition: BreakupModel.H:135