Loading...
Searching...
No Matches
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;
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
71
72 //- Type of parcel the cloud was instantiated for
73 typedef typename CloudType::particleType parcelType;
74
75 //- Convenience typedef for this cloud type
76 typedef SprayCloud<CloudType> sprayCloudType;
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
117 //- Set cloud sub-models
118 void setModels();
119
120
121 // Cloud evolution functions
122
123 //- Reset state of cloud
124 void cloudReset(SprayCloud<CloudType>& c);
125
126
127public:
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
143 SprayCloud(SprayCloud<CloudType>& c, const word& 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
156 {
158 (
159 new SprayCloud(*this, name)
160 );
161 }
163 //- Construct and return bare clone based on (this) with new name
164 virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
165 {
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();
234 //- Evolve the spray (inject, move)
235 void evolve();
236
237
238 // I-O
239
240 //- Print cloud information
241 void info();
242};
243
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.
ParticleType particleType
Definition Cloud.H:130
const word & cloudName() const
const fvMesh & mesh() const
autoPtr< IOobject > clone() const
Clone.
Definition IOobject.H:641
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition SLGThermo.H:63
Templated base class for spray cloud.
Definition SprayCloud.H:57
autoPtr< BreakupModel< SprayCloud< ReactingCloud< ThermoCloud< KinematicCloud< Cloud< basicSprayParcel > > > > > > > breakupModel_
Definition SprayCloud.H:121
virtual ~SprayCloud()
Destructor.
Definition SprayCloud.C:141
void setModels()
Set cloud sub-models.
Definition SprayCloud.C:28
SprayCloud(SprayCloud< CloudType > &c, const word &name)
Copy constructor with new name.
Definition SprayCloud.C:107
const BreakupModel< SprayCloud< CloudType > > & breakup() const
Return const-access to the breakup model.
Definition SprayCloudI.H:50
SprayCloud< ReactingCloud< ThermoCloud< KinematicCloud< Cloud< basicSprayParcel > > > > > sprayCloudType
Definition SprayCloud.H:75
void storeState()
Store the current cloud state.
Definition SprayCloud.C:192
AtomizationModel< SprayCloud< CloudType > > & atomization()
Return reference to the atomization model.
Definition SprayCloudI.H:42
autoPtr< AtomizationModel< SprayCloud< ReactingCloud< ThermoCloud< KinematicCloud< Cloud< basicSprayParcel > > > > > > > atomizationModel_
Definition SprayCloud.H:116
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
Definition SprayCloud.C:149
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
Definition SprayCloud.C:172
void cloudReset(SprayCloud< CloudType > &c)
Reset state of cloud.
Definition SprayCloud.C:52
ReactingCloud< ThermoCloud< KinematicCloud< Cloud< basicSprayParcel > > > >::particleType parcelType
Definition SprayCloud.H:70
const AtomizationModel< SprayCloud< CloudType > > & atomization() const
Return const-access to the atomization model.
Definition SprayCloudI.H:34
const SprayCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition SprayCloudI.H:26
ReactingCloud< ThermoCloud< KinematicCloud< Cloud< basicSprayParcel > > > > cloudType
Definition SprayCloud.H:65
virtual autoPtr< Cloud< parcelType > > clone(const word &name)
Construct and return clone based on (this) with new name.
Definition SprayCloud.H:178
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition SprayCloud.H:189
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:67
void evolve()
Evolve the spray (inject, move).
Definition SprayCloud.C:213
void info()
Print cloud information.
Definition SprayCloud.C:225
void restoreState()
Reset the current cloud to the previously stored state.
Definition SprayCloud.C:205
SprayCloud(const fvMesh &mesh, const word &name, const SprayCloud< CloudType > &c)
Copy constructor with new name - creates bare cloud.
Definition SprayCloud.C:123
scalar penetration(const scalar fraction) const
Penetration for fraction [0-1] of the current total mass.
Definition SprayCloudI.H:73
scalar averageParcelMass() const
Return const-access to the average parcel mass.
Definition SprayCloudI.H:65
BreakupModel< SprayCloud< CloudType > > & breakup()
Return reference to the breakup model.
Definition SprayCloudI.H:58
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
sprayCloud()=default
Null constructor.
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:66
U
Definition pEqn.H:72
Namespace for OpenFOAM.
DSMCCloud< dsmcParcel > CloudType
GeometricField< vector, fvPatchField, volMesh > volVectorField
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.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dimensioned< vector > dimensionedVector
Dimensioned vector obtained from generic dimensioned type.