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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::SprayCloud
28
29Description
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
46namespace Foam
47{
48
49// Forward Declarations
50template<class CloudType> class AtomizationModel;
51template<class CloudType> class BreakupModel;
52template<class CloudType> class SprayCloud;
53
54
55/*---------------------------------------------------------------------------*\
56 Class SprayCloud Declaration
57\*---------------------------------------------------------------------------*/
58
59template<class CloudType>
60class SprayCloud
61:
62 public CloudType,
63 public sprayCloud
64{
65public:
66
67 // Public typedefs
68
69 //- Type of cloud this cloud was instantiated for
70 typedef CloudType cloudType;
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
79private:
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
99protected:
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
116
117 //- Set cloud sub-models
118 void setModels();
119
120
121 // Cloud evolution functions
122
123 //- Reset state of cloud
125
126
127public:
128
129 // Constructors
130
131 //- Construct given carrier gas fields
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
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
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 //- Return const-access to the average parcel mass
185 inline scalar averageParcelMass() const;
186
187
188 // Check
189
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// ************************************************************************* //
const uniformDimensionedVectorField & g
Templated atomization model class.
Templated break-up model class.
Definition: BreakupModel.H:61
ParticleType particleType
Definition: Cloud.H:114
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:37
const fvMesh & mesh() const
Return reference to the mesh.
Definition: DSMCCloudI.H:44
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:459
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:67
Templated base class for spray cloud.
Definition: SprayCloud.H:63
autoPtr< BreakupModel< SprayCloud< CloudType > > > breakupModel_
Break-up model.
Definition: SprayCloud.H:109
virtual ~SprayCloud()
Destructor.
Definition: SprayCloud.C:148
void setModels()
Set cloud sub-models.
Definition: SprayCloud.C:35
const BreakupModel< SprayCloud< CloudType > > & breakup() const
Return const-access to the breakup model.
Definition: SprayCloudI.H:57
SprayCloud< CloudType > sprayCloudType
Convenience typedef for this cloud type.
Definition: SprayCloud.H:75
void storeState()
Store the current cloud state.
Definition: SprayCloud.C:199
autoPtr< AtomizationModel< SprayCloud< CloudType > > > atomizationModel_
Atomization model.
Definition: SprayCloud.H:106
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
Definition: SprayCloud.C:156
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
Definition: SprayCloud.C:179
void cloudReset(SprayCloud< CloudType > &c)
Reset state of cloud.
Definition: SprayCloud.C:59
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
Definition: SprayCloud.H:72
const AtomizationModel< SprayCloud< CloudType > > & atomization() const
Return const-access to the atomization model.
Definition: SprayCloudI.H:41
const SprayCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: SprayCloudI.H:33
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: SprayCloud.H:69
virtual autoPtr< Cloud< parcelType > > clone(const word &name)
Construct and return clone based on (this) with new name.
Definition: SprayCloud.H:154
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 evolve()
Evolve the spray (inject, move)
Definition: SprayCloud.C:220
void info()
Print cloud information.
Definition: SprayCloud.C:232
void restoreState()
Reset the current cloud to the previously stored state.
Definition: SprayCloud.C:212
scalar penetration(const scalar fraction) const
Penetration for fraction [0-1] of the current total mass.
Definition: SprayCloudI.H:80
scalar averageParcelMass() const
Return const-access to the average parcel mass.
Definition: SprayCloudI.H:72
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Virtual abstract base class for templated SprayCloud.
Definition: sprayCloud.H:51
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
A class for handling words, derived from Foam::string.
Definition: word.H:68
U
Definition: pEqn.H:72
Namespace for OpenFOAM.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.