AtomisationModel.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-2024 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::AtomisationModel
26 
27 Description
28  Templated atomisation model class
29 
30 SourceFiles
31  AtomisationModel.C
32  AtomisationModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef AtomisationModel_H
37 #define AtomisationModel_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 AtomisationModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class CloudType>
54 class AtomisationModel
55 :
56  public CloudSubModelBase<CloudType>
57 {
58 public:
59 
60  //- Runtime type information
61  TypeName("atomisationModel");
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,
87  const word& type
88  );
89 
90  //- Construct copy
92 
93  //- Construct and return a clone
94  virtual autoPtr<AtomisationModel<CloudType>> clone() const = 0;
95 
96 
97  //- Destructor
98  virtual ~AtomisationModel();
99 
100 
101  //- Selector
103  (
104  const dictionary& dict,
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,
137  ) const = 0;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #define makeAtomisationModel(CloudType) \
148  \
149  typedef Foam::CloudType::sprayCloudType sprayCloudType; \
150  defineNamedTemplateTypeNameAndDebug \
151  ( \
152  Foam::AtomisationModel<sprayCloudType>, \
153  0 \
154  ); \
155  \
156  namespace Foam \
157  { \
158  defineTemplateRunTimeSelectionTable \
159  ( \
160  AtomisationModel<sprayCloudType>, \
161  dictionary \
162  ); \
163  }
164 
165 
166 #define makeAtomisationModelType(SS, CloudType) \
167  \
168  typedef Foam::CloudType::sprayCloudType sprayCloudType; \
169  defineNamedTemplateTypeNameAndDebug(Foam::SS<sprayCloudType>, 0); \
170  \
171  Foam::AtomisationModel<sprayCloudType>:: \
172  adddictionaryConstructorToTable<Foam::SS<sprayCloudType>> \
173  add##SS##CloudType##sprayCloudType##ConstructorToTable_;
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 #ifdef NoRepository
179  #include "AtomisationModel.C"
180 #endif
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 #endif
185 
186 // ************************************************************************* //
Templated atomisation model class.
virtual autoPtr< AtomisationModel< CloudType > > clone() const =0
Construct and return a clone.
virtual ~AtomisationModel()
Destructor.
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, randomGenerator &rndGen) const =0
TypeName("atomisationModel")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, AtomisationModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
virtual scalar initLiquidCore() const =0
Initial value of liquidCore.
static autoPtr< AtomisationModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
virtual bool calcChi() const =0
Flag to indicate if chi needs to be calculated.
scalar Taverage(const scalar &Tliq, const scalar &Tc) const
Average temperature calculation.
AtomisationModel(CloudType &owner)
Construct null from owner.
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
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
Random number generator.
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
const dimensionedScalar sigma
Stefan-Boltzmann constant: default SI units: [W/m^2/K^4].
const dimensionedScalar mu
Atomic mass unit.
Namespace for OpenFOAM.
dimensionedScalar pos(const dimensionedScalar &ds)
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.
randomGenerator rndGen(653213)