BreakupModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::BreakupModel
28 
29 Group
30  grpLagrangianIntermediateBreakupSubModels
31 
32 Description
33  Templated break-up model class
34 
35 SourceFiles
36  BreakupModel.C
37  BreakupModelNew.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef BreakupModel_H
42 #define BreakupModel_H
43 
44 #include "IOdictionary.H"
45 #include "autoPtr.H"
46 #include "runTimeSelectionTables.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class BreakupModel Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class CloudType>
58 class BreakupModel
59 :
60  public CloudSubModelBase<CloudType>
61 {
62 
63 protected:
64 
65  // Protected data
66 
68 
69  scalar y0_;
70  scalar yDot0_;
71 
72  scalar TABComega_;
73  scalar TABCmu_;
74  scalar TABtwoWeCrit_;
75 
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("breakupModel");
81 
82  //- Declare runtime constructor selection table
84  (
85  autoPtr,
87  dictionary,
88  (
89  const dictionary& dict,
90  CloudType& owner
91  ),
92  (dict, owner)
93  );
94 
95 
96  // Constructors
97 
98  //- Construct null from owner
99  BreakupModel(CloudType& owner);
100 
101  //- Construct from dictionary
103  (
104  const dictionary& dict,
105  CloudType& owner,
106  const word& type,
107  bool solveOscillationEq = false
108  );
109 
110  //- Construct copy
112 
113  //- Construct and return a clone
114  virtual autoPtr<BreakupModel<CloudType>> clone() const = 0;
115 
116 
117  //- Destructor
118  virtual ~BreakupModel();
119 
120 
121  //- Selector
123  (
124  const dictionary& dict,
125  CloudType& owner
126  );
127 
128 
129  // Access
130 
131  inline const Switch& solveOscillationEq() const
132  {
133  return solveOscillationEq_;
134  }
135 
136  inline const scalar& y0() const
137  {
138  return y0_;
139  }
140 
141  inline const scalar& yDot0() const
142  {
143  return yDot0_;
144  }
145 
146  inline const scalar& TABComega() const
147  {
148  return TABComega_;
149  }
150 
151  inline const scalar& TABCmu() const
152  {
153  return TABCmu_;
154  }
155 
156  inline const scalar& TABtwoWeCrit() const
157  {
158  return TABtwoWeCrit_;
159  }
160 
161 
162  // Member Functions
163 
164  //- Update the parcel properties and return true if a child parcel
165  // should be added
166  virtual bool update
167  (
168  const scalar dt,
169  const vector& g,
170  scalar& d,
171  scalar& tc,
172  scalar& ms,
173  scalar& nParticle,
174  scalar& KHindex,
175  scalar& y,
176  scalar& yDot,
177  const scalar d0,
178  const scalar rho,
179  const scalar mu,
180  const scalar sigma,
181  const vector& U,
182  const scalar rhoc,
183  const scalar muc,
184  const vector& Urel,
185  const scalar Urmag,
186  const scalar tMom,
187  scalar& dChild,
188  scalar& massChild
189  ) = 0;
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #define makeBreakupModel(CloudType) \
200  \
201  typedef Foam::CloudType::sprayCloudType sprayCloudType; \
202  defineNamedTemplateTypeNameAndDebug \
203  ( \
204  Foam::BreakupModel<sprayCloudType>, \
205  0 \
206  ); \
207  \
208  namespace Foam \
209  { \
210  defineTemplateRunTimeSelectionTable \
211  ( \
212  BreakupModel<sprayCloudType>, \
213  dictionary \
214  ); \
215  }
216 
217 
218 #define makeBreakupModelType(SS, CloudType) \
219  \
220  typedef Foam::CloudType::sprayCloudType sprayCloudType; \
221  defineNamedTemplateTypeNameAndDebug(Foam::SS<sprayCloudType>, 0); \
222  \
223  Foam::BreakupModel<sprayCloudType>:: \
224  adddictionaryConstructorToTable<Foam::SS<sprayCloudType>> \
225  add##SS##CloudType##sprayCloudType##ConstructorToTable_;
226 
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 #ifdef NoRepository
231  #include "BreakupModel.C"
232 #endif
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #endif
237 
238 // ************************************************************************* //
Foam::BreakupModel::solveOscillationEq_
Switch solveOscillationEq_
Definition: BreakupModel.H:66
Foam::BreakupModel::yDot0
const scalar & yDot0() const
Definition: BreakupModel.H:140
BreakupModel.C
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:70
Foam::BreakupModel::TABComega_
scalar TABComega_
Definition: BreakupModel.H:71
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::BreakupModel::TypeName
TypeName("breakupModel")
Runtime type information.
Foam::BreakupModel::solveOscillationEq
const Switch & solveOscillationEq() const
Definition: BreakupModel.H:130
Foam::constant::physicoChemical::mu
const dimensionedScalar mu
Atomic mass unit.
Definition: createFieldRefs.H:4
Urel
Urel
Definition: pEqn.H:56
rho
rho
Definition: readInitialConditions.H:96
Foam::BreakupModel::New
static autoPtr< BreakupModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: BreakupModelNew.C:36
Foam::BreakupModel::TABtwoWeCrit
const scalar & TABtwoWeCrit() const
Definition: BreakupModel.H:155
Foam::BreakupModel::clone
virtual autoPtr< BreakupModel< CloudType > > clone() const =0
Construct and return a clone.
Foam::BreakupModel::~BreakupModel
virtual ~BreakupModel()
Destructor.
Definition: BreakupModel.C:96
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::BreakupModel::TABCmu_
scalar TABCmu_
Definition: BreakupModel.H:72
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::BreakupModel::TABCmu
const scalar & TABCmu() const
Definition: BreakupModel.H:150
Foam::BreakupModel::TABComega
const scalar & TABComega() const
Definition: BreakupModel.H:145
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:24
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::BreakupModel::TABtwoWeCrit_
scalar TABtwoWeCrit_
Definition: BreakupModel.H:73
Foam::BreakupModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, BreakupModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
Foam::BreakupModel
Templated break-up model class.
Definition: SprayCloud.H:49
IOdictionary.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
U
U
Definition: pEqn.H:72
Foam::BreakupModel::update
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.
Foam::BreakupModel::yDot0_
scalar yDot0_
Definition: BreakupModel.H:69
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::Vector< scalar >
Foam::BreakupModel::y0_
scalar y0_
Definition: BreakupModel.H:68
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
sigma
dimensionedScalar sigma("sigma", dimMass/sqr(dimTime), transportProperties)
Foam::BreakupModel::BreakupModel
BreakupModel(CloudType &owner)
Construct null from owner.
Definition: BreakupModel.C:34
Foam::BreakupModel::y0
const scalar & y0() const
Definition: BreakupModel.H:135
y
scalar y
Definition: LISASMDCalcMethod1.H:14
autoPtr.H