All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SprayCloud.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-2021 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::SprayCloud
26 
27 Description
28  Templated base class for spray cloud
29 
30  - sub-models:
31  - atomisation model
32  - break-up model
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef SprayCloud_H
37 #define SprayCloud_H
38 
39 #include "volFieldsFwd.H"
40 #include "fvMatricesFwd.H"
41 #include "dimensionedTypes.H"
42 #include "fvMesh.H"
43 #include "fluidThermo.H"
44 #include "Cloud.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward declaration of classes
52 template<class CloudType>
53 class AtomisationModel;
54 
55 template<class CloudType>
56 class BreakupModel;
57 
58 /*---------------------------------------------------------------------------*\
59  Class SprayCloudName Declaration
60 \*---------------------------------------------------------------------------*/
61 
63 
64 
65 /*---------------------------------------------------------------------------*\
66  Class SprayCloud Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 template<class CloudType>
70 class SprayCloud
71 :
72  public CloudType,
73  public SprayCloudName
74 {
75 public:
76 
77  // Public Typedefs
78 
79  //- Type of cloud this cloud was instantiated for
80  typedef CloudType cloudType;
81 
82  //- Type of parcel the cloud was instantiated for
83  typedef typename CloudType::particleType parcelType;
84 
85  //- Convenience typedef for this cloud type
87 
88 
89 private:
90 
91  // Private Data
92 
93  //- Cloud copy pointer
94  autoPtr<SprayCloud<CloudType>> cloudCopyPtr_;
95 
96  //- Average parcel mass
97  scalar averageParcelMass_;
98 
99 
100 protected:
101 
102  // Protected data
103 
104  // References to the cloud sub-models
105 
106  //- Atomisation model
109 
110  //- Break-up model
112 
113 
114  // Protected Member Functions
115 
116  // Initialisation
117 
118  //- Set cloud sub-models
119  void setModels();
120 
121 
122  // Cloud evolution functions
123 
124  //- Reset state of cloud
126 
127 
128 public:
129 
130  // Constructors
131 
132  //- Construct given carrier gas fields
133  SprayCloud
134  (
135  const word& cloudName,
136  const volScalarField& rho,
137  const volVectorField& U,
138  const dimensionedVector& g,
139  const fluidThermo& carrierThermo,
140  bool readFields = true
141  );
142 
143  //- Copy constructor with new name
145 
146  //- Copy constructor with new name - creates bare cloud
147  SprayCloud
148  (
149  const fvMesh& mesh,
150  const word& name,
151  const SprayCloud<CloudType>& c
152  );
153 
154  //- Disallow default bitwise copy construction
155  SprayCloud(const SprayCloud&) = delete;
156 
157  //- Construct and return clone based on (this) with new name
158  virtual autoPtr<Cloud<parcelType>> clone(const word& name)
159  {
161  (
162  new SprayCloud(*this, name)
163  );
164  }
165 
166  //- Construct and return bare clone based on (this) with new name
167  virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
168  {
170  (
171  new SprayCloud(this->mesh(), name, *this)
172  );
173  }
174 
175 
176  //- Destructor
177  virtual ~SprayCloud();
178 
179 
180  // Member Functions
181 
182  // Access
183 
184  //- Return a reference to the cloud copy
185  inline const SprayCloud& cloudCopy() const;
186 
187  //- Return const-access to the average parcel mass
188  inline scalar averageParcelMass() const;
189 
190 
191  // Check
192 
193  //- Penetration for fraction [0-1] of the current total mass
194  inline scalar penetration(const scalar fraction) const;
195 
196 
197  // Sub-models
198 
199  //- Return const-access to the atomisation model
201  atomisation() const;
202 
203  //- Return reference to the atomisation model
205 
206  //- Return const-access to the breakup model
208  breakup() const;
209 
210  //- Return reference to the breakup model
212 
213 
214  // Cloud evolution functions
215 
216  //- Set parcel thermo properties
218  (
219  parcelType& parcel,
220  const scalar lagrangianDt
221  );
222 
223  //- Check parcel properties
225  (
226  parcelType& parcel,
227  const scalar lagrangianDt,
228  const bool fullyDescribed
229  );
230 
231  //- Store the current cloud state
232  void storeState();
233 
234  //- Reset the current cloud to the previously stored state
235  void restoreState();
236 
237  //- Evolve the spray (inject, move)
238  void evolve();
239 
240 
241  // I-O
242 
243  //- Print cloud information
244  void info();
245 
246 
247  // Member Operators
248 
249  //- Disallow default bitwise assignment
250  void operator=(const SprayCloud&) = delete;
251 };
252 
253 
254 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
255 
256 } // End namespace Foam
257 
258 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
259 
260 #include "SprayCloudI.H"
261 
262 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263 
264 #ifdef NoRepository
265  #include "SprayCloud.C"
266 #endif
267 
268 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
269 
270 #endif
271 
272 // ************************************************************************* //
scalar averageParcelMass() const
Return const-access to the average parcel mass.
Definition: SprayCloudI.H:71
ParcelType particleType
Definition: Cloud.H:105
TemplateName(blendedSchemeBase)
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:276
const word & name() const
Return name.
Definition: IOobject.H:303
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the specified type.
Definition: ReadFields.C:244
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:34
void storeState()
Store the current cloud state.
Definition: SprayCloud.C:192
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: SprayCloud.H:166
void restoreState()
Reset the current cloud to the previously stored state.
Definition: SprayCloud.C:205
const AtomisationModel< SprayCloud< CloudType > > & atomisation() const
Return const-access to the atomisation model.
Definition: SprayCloudI.H:40
void setModels()
Set cloud sub-models.
Definition: SprayCloud.C:34
scalar penetration(const scalar fraction) const
Penetration for fraction [0-1] of the current total mass.
Definition: SprayCloudI.H:79
const SprayCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: SprayCloudI.H:32
Templated atomisation model class.
Definition: SprayCloud.H:52
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
Definition: SprayCloud.C:149
SprayCloud(const word &cloudName, const volScalarField &rho, const volVectorField &U, const dimensionedVector &g, const fluidThermo &carrierThermo, bool readFields=true)
Construct given carrier gas fields.
Definition: SprayCloud.C:73
const dimensionedScalar c
Speed of light in a vacuum.
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: SprayCloud.H:79
virtual ~SprayCloud()
Destructor.
Definition: SprayCloud.C:141
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
Definition: SprayCloud.C:172
A class for handling words, derived from string.
Definition: word.H:59
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:53
const BreakupModel< SprayCloud< CloudType > > & breakup() const
Return const-access to the breakup model.
Definition: SprayCloudI.H:56
Templated base class for spray cloud.
Definition: SprayCloud.H:69
autoPtr< BreakupModel< SprayCloud< CloudType > > > breakupModel_
Break-up model.
Definition: SprayCloud.H:110
void evolve()
Evolve the spray (inject, move)
Definition: SprayCloud.C:213
SprayCloud< CloudType > sprayCloudType
Convenience typedef for this cloud type.
Definition: SprayCloud.H:85
void operator=(const SprayCloud &)=delete
Disallow default bitwise assignment.
void info()
Print cloud information.
Definition: SprayCloud.C:225
const fvMesh & mesh() const
Return references to the mesh.
Definition: DSMCCloudI.H:41
Forward declarations of fvMatrix specialisations.
U
Definition: pEqn.H:72
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
void cloudReset(SprayCloud< CloudType > &c)
Reset state of cloud.
Definition: SprayCloud.C:58
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
const dimensionedVector & g
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
autoPtr< AtomisationModel< SprayCloud< CloudType > > > atomisationModel_
Atomisation model.
Definition: SprayCloud.H:107
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
Definition: SprayCloud.H:82
Namespace for OpenFOAM.