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-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::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  // Private Member Functions
89 
90  //- Disallow default bitwise copy construct
91  SprayCloud(const SprayCloud&);
92 
93  //- Disallow default bitwise assignment
94  void operator=(const SprayCloud&);
95 
96 
97 protected:
98 
99  // Protected data
100 
101  // References to the cloud sub-models
102 
103  //- Atomization 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 SLGThermo& thermo,
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 
152  //- Construct and return clone based on (this) with new name
153  virtual autoPtr<Cloud<parcelType>> clone(const word& name)
154  {
156  (
157  new SprayCloud(*this, name)
158  );
159  }
160 
161  //- Construct and return bare clone based on (this) with new name
162  virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
163  {
165  (
166  new SprayCloud(this->mesh(), name, *this)
167  );
168  }
169 
170 
171  //- Destructor
172  virtual ~SprayCloud();
173 
174 
175  // Member Functions
176 
177  // Access
178 
179  //- Return a reference to the cloud copy
180  inline const SprayCloud& cloudCopy() const;
181 
182  //- Return const-access to the average parcel mass
183  inline scalar averageParcelMass() const;
184 
185 
186  // Check
187 
188  //- Penetration for fraction [0-1] of the current total mass
189  inline scalar penetration(const scalar fraction) const;
190 
191 
192  // Sub-models
193 
194  //- Return const-access to the atomization model
196  atomization() const;
197 
198  //- Return reference to the atomization model
200 
201  //- Return const-access to the breakup model
203  breakup() const;
204 
205  //- Return reference to the breakup model
207 
208 
209  // Cloud evolution functions
210 
211  //- Set parcel thermo properties
213  (
214  parcelType& parcel,
215  const scalar lagrangianDt
216  );
217 
218  //- Check parcel properties
220  (
221  parcelType& parcel,
222  const scalar lagrangianDt,
223  const bool fullyDescribed
224  );
225 
226  //- Store the current cloud state
227  void storeState();
228 
229  //- Reset the current cloud to the previously stored state
230  void restoreState();
231 
232  //- Evolve the spray (inject, move)
233  void evolve();
234 
235 
236  // I-O
237 
238  //- Print cloud information
239  void info();
240 };
241 
242 
243 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 
245 } // End namespace Foam
246 
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 
249 #include "SprayCloudI.H"
250 
251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 
253 #ifdef NoRepository
254  #include "SprayCloud.C"
255 #endif
256 
257 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
258 
259 #endif
260 
261 // ************************************************************************* //
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:270
const word & name() const
Return name.
Definition: IOobject.H:297
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:161
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
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: SprayCloud.H:67
virtual ~SprayCloud()
Destructor.
Definition: SprayCloud.C:146
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:107
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 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:104
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const dimensionedScalar c
Speed of light in a vacuum.
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.