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