All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AtomizationModel.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-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::AtomizationModel
26 
27 Description
28  Templated atomization model class
29 
30 SourceFiles
31  AtomizationModel.C
32  AtomizationModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef AtomizationModel_H
37 #define AtomizationModel_H
38 
39 #include "IOdictionary.H"
40 #include "autoPtr.H"
41 #include "runTimeSelectionTables.H"
42 #include "CloudSubModelBase.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class AtomizationModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class CloudType>
54 class AtomizationModel
55 :
56  public CloudSubModelBase<CloudType>
57 {
58 public:
59 
60  //- Runtime type information
61  TypeName("atomizationModel");
62 
63  //- Declare runtime constructor selection table
65  (
66  autoPtr,
68  dictionary,
69  (
70  const dictionary& dict,
72  ),
73  (dict, owner)
74  );
75 
76 
77  // Constructors
78 
79  //- Construct null from owner
81 
82  //- Construct from dictionary
84  (
85  const dictionary& dict,
86  CloudType& owner,
87  const word& type
88  );
89 
90  //- Construct copy
91  AtomizationModel(const AtomizationModel<CloudType>& am);
92 
93  //- Construct and return a clone
94  virtual autoPtr<AtomizationModel<CloudType>> clone() const = 0;
95 
96 
97  //- Destructor
98  virtual ~AtomizationModel();
99 
100 
101  //- Selector
102  static autoPtr<AtomizationModel<CloudType>> New
103  (
104  const dictionary& dict,
105  CloudType& owner
106  );
107 
108 
109  // Member Functions
110 
111  //- Average temperature calculation
112  scalar Taverage(const scalar& Tliq, const scalar& Tc) const;
113 
114  //- Initial value of liquidCore
115  virtual scalar initLiquidCore() const = 0;
116 
117  //- Flag to indicate if chi needs to be calculated
118  virtual bool calcChi() const = 0;
119 
120  virtual void update
121  (
122  const scalar dt,
123  scalar& d,
124  scalar& liquidCore,
125  scalar& tc,
126  const scalar rho,
127  const scalar mu,
128  const scalar sigma,
129  const scalar volFlowRate,
130  const scalar rhoAv,
131  const scalar Urel,
132  const vector& pos,
133  const vector& injectionPos,
134  const scalar pAmbient,
135  const scalar chi,
136  Random& rndGen
137  ) const = 0;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 #define makeAtomizationModel(CloudType) \
148  \
149  typedef Foam::CloudType::sprayCloudType sprayCloudType; \
150  defineNamedTemplateTypeNameAndDebug \
151  ( \
152  Foam::AtomizationModel<sprayCloudType>, \
153  0 \
154  ); \
155  \
156  namespace Foam \
157  { \
158  defineTemplateRunTimeSelectionTable \
159  ( \
160  AtomizationModel<sprayCloudType>, \
161  dictionary \
162  ); \
163  }
164 
166 #define makeAtomizationModelType(SS, CloudType) \
167  \
168  typedef Foam::CloudType::sprayCloudType sprayCloudType; \
169  defineNamedTemplateTypeNameAndDebug(Foam::SS<sprayCloudType>, 0); \
170  \
171  Foam::AtomizationModel<sprayCloudType>:: \
172  adddictionaryConstructorToTable<Foam::SS<sprayCloudType>> \
173  add##SS##CloudType##sprayCloudType##ConstructorToTable_;
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #ifdef NoRepository
179  #include "AtomizationModel.C"
180 #endif
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
TypeName("atomizationModel")
Runtime type information.
DSMCCloud< dsmcParcel > CloudType
virtual scalar initLiquidCore() const =0
Initial value of liquidCore.
virtual bool calcChi() const =0
Flag to indicate if chi needs to be calculated.
const dimensionedScalar & sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
static autoPtr< AtomizationModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
declareRunTimeSelectionTable(autoPtr, AtomizationModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
const CloudType & owner() const
Return const access to the owner cloud.
Random rndGen(label(0))
dimensionedScalar pos(const dimensionedScalar &ds)
virtual void update(const scalar dt, scalar &d, scalar &liquidCore, scalar &tc, const scalar rho, const scalar mu, const scalar sigma, const scalar volFlowRate, const scalar rhoAv, const scalar Urel, const vector &pos, const vector &injectionPos, const scalar pAmbient, const scalar chi, Random &rndGen) const =0
Urel
Definition: pEqn.H:56
virtual autoPtr< AtomizationModel< CloudType > > clone() const =0
Construct and return a clone.
virtual ~AtomizationModel()
Destructor.
const dimensionedScalar & mu
Atomic mass unit.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
scalar Taverage(const scalar &Tliq, const scalar &Tc) const
Average temperature calculation.
Macros to ease declaration of run-time selection tables.
AtomizationModel(CloudType &owner)
Construct null from owner.
Namespace for OpenFOAM.