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-2019 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  - atomization model
32  - break-up model
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef SprayCloud_H
37 #define SprayCloud_H
38 
39 #include "sprayCloud.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 template<class CloudType>
48 class AtomizationModel;
49 
50 template<class CloudType>
51 class BreakupModel;
52 
53 /*---------------------------------------------------------------------------*\
54  Class SprayCloud Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class CloudType>
58 class SprayCloud
59 :
60  public CloudType,
61  public sprayCloud
62 {
63 public:
64 
65  // Public Typedefs
66 
67  //- Type of cloud this cloud was instantiated for
68  typedef CloudType cloudType;
69 
70  //- Type of parcel the cloud was instantiated for
71  typedef typename CloudType::particleType parcelType;
72 
73  //- Convenience typedef for this cloud type
75 
76 
77 private:
78 
79  // Private Data
80 
81  //- Cloud copy pointer
82  autoPtr<SprayCloud<CloudType>> cloudCopyPtr_;
83 
84  //- Average parcel mass
85  scalar averageParcelMass_;
86 
87 
88 protected:
89 
90  // Protected data
91 
92  // References to the cloud sub-models
93 
94  //- Atomization model
97 
98  //- Break-up model
100 
101 
102  // Protected Member Functions
103 
104  // Initialisation
105 
106  //- Set cloud sub-models
107  void setModels();
108 
109 
110  // Cloud evolution functions
111 
112  //- Reset state of cloud
114 
115 
116 public:
117 
118  // Constructors
119 
120  //- Construct given carrier gas fields
121  SprayCloud
122  (
123  const word& cloudName,
124  const volScalarField& rho,
125  const volVectorField& U,
126  const dimensionedVector& g,
127  const SLGThermo& thermo,
128  bool readFields = true
129  );
130 
131  //- Copy constructor with new name
133 
134  //- Copy constructor with new name - creates bare cloud
135  SprayCloud
136  (
137  const fvMesh& mesh,
138  const word& name,
139  const SprayCloud<CloudType>& c
140  );
141 
142  //- Disallow default bitwise copy construction
143  SprayCloud(const SprayCloud&) = delete;
144 
145  //- Construct and return clone based on (this) with new name
146  virtual autoPtr<Cloud<parcelType>> clone(const word& name)
147  {
149  (
150  new SprayCloud(*this, name)
151  );
152  }
153 
154  //- Construct and return bare clone based on (this) with new name
155  virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
156  {
158  (
159  new SprayCloud(this->mesh(), name, *this)
160  );
161  }
162 
163 
164  //- Destructor
165  virtual ~SprayCloud();
166 
167 
168  // Member Functions
169 
170  // Access
171 
172  //- Return a reference to the cloud copy
173  inline const SprayCloud& cloudCopy() const;
174 
175  //- Return const-access to the average parcel mass
176  inline scalar averageParcelMass() const;
177 
178 
179  // Check
180 
181  //- Penetration for fraction [0-1] of the current total mass
182  inline scalar penetration(const scalar fraction) const;
183 
184 
185  // Sub-models
186 
187  //- Return const-access to the atomization model
189  atomization() const;
190 
191  //- Return reference to the atomization model
193 
194  //- Return const-access to the breakup model
196  breakup() const;
197 
198  //- Return reference to the breakup model
200 
201 
202  // Cloud evolution functions
203 
204  //- Set parcel thermo properties
206  (
207  parcelType& parcel,
208  const scalar lagrangianDt
209  );
210 
211  //- Check parcel properties
213  (
214  parcelType& parcel,
215  const scalar lagrangianDt,
216  const bool fullyDescribed
217  );
218 
219  //- Store the current cloud state
220  void storeState();
221 
222  //- Reset the current cloud to the previously stored state
223  void restoreState();
224 
225  //- Evolve the spray (inject, move)
226  void evolve();
227 
228 
229  // I-O
230 
231  //- Print cloud information
232  void info();
233 
234 
235  // Member Operators
236 
237  //- Disallow default bitwise assignment
238  void operator=(const SprayCloud&) = delete;
239 };
240 
241 
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 
244 } // End namespace Foam
245 
246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
247 
248 #include "SprayCloudI.H"
249 
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251 
252 #ifdef NoRepository
253  #include "SprayCloud.C"
254 #endif
255 
256 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
257 
258 #endif
259 
260 // ************************************************************************* //
scalar averageParcelMass() const
Return const-access to the average parcel mass.
Definition: SprayCloudI.H:69
ParcelType particleType
Definition: Cloud.H:105
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:197
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: SprayCloud.H:154
const AtomizationModel< SprayCloud< CloudType > > & atomization() const
Return const-access to the atomization model.
Definition: SprayCloudI.H:38
void restoreState()
Reset the current cloud to the previously stored state.
Definition: SprayCloud.C:210
Templated atomization model class.
Definition: SprayCloud.H:47
void setModels()
Set cloud sub-models.
Definition: SprayCloud.C:33
scalar penetration(const scalar fraction) const
Penetration for fraction [0-1] of the current total mass.
Definition: SprayCloudI.H:77
const SprayCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: SprayCloudI.H:30
rhoReactionThermo & thermo
Definition: createFields.H:28
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
Definition: SprayCloud.C:154
const dimensionedScalar & c
Speed of light in a vacuum.
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: SprayCloud.H:67
virtual ~SprayCloud()
Destructor.
Definition: SprayCloud.C:146
SprayCloud(const word &cloudName, const volScalarField &rho, const volVectorField &U, const dimensionedVector &g, const SLGThermo &thermo, bool readFields=true)
Construct given carrier gas fields.
Definition: SprayCloud.C:72
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
Definition: SprayCloud.C:177
A class for handling words, derived from string.
Definition: word.H:59
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
Definition: SLGThermo.H:62
const BreakupModel< SprayCloud< CloudType > > & breakup() const
Return const-access to the breakup model.
Definition: SprayCloudI.H:54
Templated base class for spray cloud.
Definition: SprayCloud.H:57
autoPtr< BreakupModel< SprayCloud< CloudType > > > breakupModel_
Break-up model.
Definition: SprayCloud.H:98
void evolve()
Evolve the spray (inject, move)
Definition: SprayCloud.C:218
SprayCloud< CloudType > sprayCloudType
Convenience typedef for this cloud type.
Definition: SprayCloud.H:73
void operator=(const SprayCloud &)=delete
Disallow default bitwise assignment.
void info()
Print cloud information.
Definition: SprayCloud.C:230
const fvMesh & mesh() const
Return references to the mesh.
Definition: DSMCCloudI.H:41
U
Definition: pEqn.H:72
autoPtr< AtomizationModel< SprayCloud< CloudType > > > atomizationModel_
Atomization model.
Definition: SprayCloud.H:95
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:57
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:50
Virtual abstract base class for templated SprayCloud.
Definition: sprayCloud.H:48
const dimensionedVector & g
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:69
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
Definition: SprayCloud.H:70
Namespace for OpenFOAM.