SprayCloud.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::SprayCloud
28 
29 Description
30  Templated base class for spray cloud
31 
32  - sub-models:
33  - atomization model
34  - break-up model
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_SprayCloud_H
39 #define Foam_SprayCloud_H
40 
41 #include "sprayCloud.H"
42 #include "SortList.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward Declarations
50 template<class CloudType> class AtomizationModel;
51 template<class CloudType> class BreakupModel;
52 template<class CloudType> class SprayCloud;
53 
54 
55 /*---------------------------------------------------------------------------*\
56  Class SprayCloud Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class CloudType>
60 class SprayCloud
61 :
62  public CloudType,
63  public sprayCloud
64 {
65 public:
66 
67  // Public typedefs
68 
69  //- Type of cloud this cloud was instantiated for
71 
72  //- Type of parcel the cloud was instantiated for
73  typedef typename CloudType::particleType parcelType;
74 
75  //- Convenience typedef for this cloud type
77 
78 
79 private:
80 
81  // Private data
82 
83  //- Cloud copy pointer
84  autoPtr<SprayCloud<CloudType>> cloudCopyPtr_;
85 
86  //- Average parcel mass
87  scalar averageParcelMass_;
88 
89 
90  // Private Member Functions
91 
92  //- No copy construct
93  SprayCloud(const SprayCloud&) = delete;
94 
95  //- No copy assignment
96  void operator=(const SprayCloud&) = delete;
97 
98 
99 protected:
100 
101  // Protected data
102 
103  // References to the cloud sub-models
104 
105  //- Atomization model
108 
109  //- Break-up model
111 
112 
113  // Protected Member Functions
114 
115  // Initialisation
117  //- Set cloud sub-models
118  void setModels();
119 
120 
121  // Cloud evolution functions
122 
123  //- Reset state of cloud
125 
126 
127 public:
128 
129  // Constructors
130 
131  //- Construct given carrier gas fields
132  SprayCloud
133  (
134  const word& cloudName,
135  const volScalarField& rho,
136  const volVectorField& U,
137  const dimensionedVector& g,
138  const SLGThermo& thermo,
139  bool readFields = true
140  );
141 
142  //- Copy constructor with new name
144 
145  //- Copy constructor with new name - creates bare cloud
146  SprayCloud
147  (
148  const fvMesh& mesh,
149  const word& name,
150  const SprayCloud<CloudType>& c
151  );
152 
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
179  // Access
180 
181  //- Return a reference to the cloud copy
182  inline const SprayCloud& cloudCopy() const;
183 
184  //- Return const-access to the average parcel mass
185  inline scalar averageParcelMass() const;
186 
187 
188  // Check
190  //- Penetration for fraction [0-1] of the current total mass
191  inline scalar penetration(const scalar fraction) const;
192 
193 
194  // Sub-models
195 
196  //- Return const-access to the atomization model
198  atomization() const;
199 
200  //- Return reference to the atomization model
202 
203  //- Return const-access to the breakup model
205  breakup() const;
206 
207  //- Return reference to the breakup model
209 
210 
211  // Cloud evolution functions
212 
213  //- Set parcel thermo properties
215  (
216  parcelType& parcel,
217  const scalar lagrangianDt
218  );
219 
220  //- Check parcel properties
222  (
223  parcelType& parcel,
224  const scalar lagrangianDt,
225  const bool fullyDescribed
226  );
227 
228  //- Store the current cloud state
229  void storeState();
230 
231  //- Reset the current cloud to the previously stored state
232  void restoreState();
233 
234  //- Evolve the spray (inject, move)
235  void evolve();
236 
237 
238  // I-O
239 
240  //- Print cloud information
241  void info();
242 };
243 
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 } // End namespace Foam
248 
249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250 
251 #include "SprayCloudI.H"
252 
253 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254 
255 #ifdef NoRepository
256  #include "SprayCloud.C"
257 #endif
258 
259 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260 
261 #endif
262 
263 // ************************************************************************* //
scalar averageParcelMass() const
Return const-access to the average parcel mass.
Definition: SprayCloudI.H:65
ParcelType particleType
Definition: Cloud.H:130
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:621
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:30
void storeState()
Store the current cloud state.
Definition: SprayCloud.C:192
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:195
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: SprayCloud.H:189
const AtomizationModel< SprayCloud< CloudType > > & atomization() const
Return const-access to the atomization model.
Definition: SprayCloudI.H:34
void restoreState()
Reset the current cloud to the previously stored state.
Definition: SprayCloud.C:205
Templated atomization model class.
Definition: SprayCloud.H:43
void setModels()
Set cloud sub-models.
Definition: SprayCloud.C:28
scalar penetration(const scalar fraction) const
Penetration for fraction [0-1] of the current total mass.
Definition: SprayCloudI.H:73
const SprayCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: SprayCloudI.H:26
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
Definition: SprayCloud.C:149
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: SprayCloud.H:65
virtual ~SprayCloud()
Destructor.
Definition: SprayCloud.C:141
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
Definition: SprayCloud.C:172
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
A class for handling words, derived from Foam::string.
Definition: word.H:63
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
Definition: SLGThermo.H:60
const BreakupModel< SprayCloud< CloudType > > & breakup() const
Return const-access to the breakup model.
Definition: SprayCloudI.H:50
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:290
Templated base class for spray cloud.
Definition: SprayCloud.H:45
const uniformDimensionedVectorField & g
autoPtr< BreakupModel< SprayCloud< CloudType > > > breakupModel_
Break-up model.
Definition: SprayCloud.H:121
void evolve()
Evolve the spray (inject, move)
Definition: SprayCloud.C:213
SprayCloud< CloudType > sprayCloudType
Convenience typedef for this cloud type.
Definition: SprayCloud.H:75
void info()
Print cloud information.
Definition: SprayCloud.C:225
const fvMesh & mesh() const
Return reference to the mesh.
Definition: DSMCCloudI.H:37
U
Definition: pEqn.H:72
autoPtr< AtomizationModel< SprayCloud< CloudType > > > atomizationModel_
Atomization model.
Definition: SprayCloud.H:116
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:52
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Templated break-up model class.
Definition: SprayCloud.H:44
Virtual abstract base class for templated SprayCloud.
Definition: sprayCloud.H:46
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
Definition: SprayCloud.H:70
Namespace for OpenFOAM.