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-2022 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 
97 protected:
98 
99  // Protected data
100 
101  // References to the cloud sub-models
102 
103  //- Atomisation model
106 
107  //- Break-up model
109 
110 
111  // Protected Member Functions
112 
113  // Initialisation
114 
115  //- Set cloud sub-models
116  void setModels();
117 
118 
119  // Cloud evolution functions
120 
121  //- Reset state of cloud
123 
124 
125 public:
126 
127  // Constructors
128 
129  //- Construct given carrier gas fields
130  SprayCloud
131  (
132  const word& cloudName,
133  const volScalarField& rho,
134  const volVectorField& U,
135  const dimensionedVector& g,
136  const fluidThermo& carrierThermo,
137  bool readFields = true
138  );
139 
140  //- Copy constructor with new name
142 
143  //- Copy constructor with new name - creates bare cloud
144  SprayCloud
145  (
146  const fvMesh& mesh,
147  const word& name,
148  const SprayCloud<CloudType>& c
149  );
150 
151  //- Disallow default bitwise copy construction
152  SprayCloud(const SprayCloud&) = delete;
153 
154  //- Construct and return clone based on (this) with new name
155  virtual autoPtr<Cloud<parcelType>> clone(const word& name)
156  {
158  (
159  new SprayCloud(*this, name)
160  );
161  }
162 
163  //- Construct and return bare clone based on (this) with new name
164  virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
165  {
167  (
168  new SprayCloud(this->mesh(), name, *this)
169  );
170  }
171 
172 
173  //- Destructor
174  virtual ~SprayCloud();
175 
176 
177  // Member Functions
178 
179  // Access
180 
181  //- Return a reference to the cloud copy
182  inline const SprayCloud& cloudCopy() const;
183 
184 
185  // Check
186 
187  //- Penetration for fraction [0-1] of the current total mass
188  inline scalar penetration(const scalar fraction) const;
189 
190 
191  // Sub-models
192 
193  //- Return const-access to the atomisation model
195  atomisation() const;
196 
197  //- Return reference to the atomisation model
199 
200  //- Return const-access to the breakup model
202  breakup() const;
203 
204  //- Return reference to the breakup model
206 
207 
208  // Cloud evolution functions
209 
210  //- Set parcel thermo properties
212  (
213  parcelType& parcel,
214  const scalar lagrangianDt
215  );
216 
217  //- Check parcel properties
219  (
220  parcelType& parcel,
221  const scalar lagrangianDt,
222  const bool fullyDescribed
223  );
224 
225  //- Store the current cloud state
226  void storeState();
227 
228  //- Reset the current cloud to the previously stored state
229  void restoreState();
230 
231  //- Evolve the spray (inject, move)
232  void evolve();
233 
234 
235  // I-O
236 
237  //- Print cloud information
238  void info();
239 
240 
241  // Member Operators
242 
243  //- Disallow default bitwise assignment
244  void operator=(const SprayCloud&) = delete;
245 };
246 
247 
248 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249 
250 } // End namespace Foam
251 
252 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
253 
254 #include "SprayCloudI.H"
255 
256 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
257 
258 #ifdef NoRepository
259  #include "SprayCloud.C"
260 #endif
261 
262 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263 
264 #endif
265 
266 // ************************************************************************* //
ParcelType particleType
Definition: Cloud.H:128
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:288
const word & name() const
Return name.
Definition: IOobject.H:315
U
Definition: pEqn.H:72
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:185
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: SprayCloud.H:163
void restoreState()
Reset the current cloud to the previously stored state.
Definition: SprayCloud.C:198
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:72
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:142
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:134
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
Definition: SprayCloud.C:165
A class for handling words, derived from string.
Definition: word.H:59
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:53
TemplateName(FvFaceCellWave)
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:107
void evolve()
Evolve the spray (inject, move)
Definition: SprayCloud.C:206
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:218
const fvMesh & mesh() const
Return references to the mesh.
Definition: DSMCCloudI.H:41
Forward declarations of fvMatrix specialisations.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
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:104
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
Definition: SprayCloud.H:82
Namespace for OpenFOAM.