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 SprayCloud_H
39 #define SprayCloud_H
40 
41 #include "sprayCloud.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward Declarations
49 template<class CloudType> class AtomizationModel;
50 template<class CloudType> class BreakupModel;
51 template<class CloudType> class SprayCloud;
52 
53 
54 /*---------------------------------------------------------------------------*\
55  Class SprayCloud Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class CloudType>
59 class SprayCloud
60 :
61  public CloudType,
62  public sprayCloud
63 {
64 public:
65 
66  // Public typedefs
67 
68  //- Type of cloud this cloud was instantiated for
69  typedef CloudType cloudType;
70 
71  //- Type of parcel the cloud was instantiated for
72  typedef typename CloudType::particleType parcelType;
73 
74  //- Convenience typedef for this cloud type
76 
77 
78 private:
79 
80  // Private data
81 
82  //- Cloud copy pointer
83  autoPtr<SprayCloud<CloudType>> cloudCopyPtr_;
84 
85  //- Average parcel mass
86  scalar averageParcelMass_;
87 
88 
89  // Private Member Functions
90 
91  //- No copy construct
92  SprayCloud(const SprayCloud&) = delete;
93 
94  //- No copy assignment
95  void operator=(const SprayCloud&) = delete;
96 
97 
98 protected:
99 
100  // Protected data
101 
102  // References to the cloud sub-models
103 
104  //- Atomization model
107 
108  //- Break-up model
110 
111 
112  // Protected Member Functions
113 
114  // Initialisation
115 
116  //- Set cloud sub-models
117  void setModels();
118 
119 
120  // Cloud evolution functions
121 
122  //- Reset state of cloud
124 
125 
126 public:
127 
128  // Constructors
129 
130  //- Construct given carrier gas fields
131  SprayCloud
132  (
133  const word& cloudName,
134  const volScalarField& rho,
135  const volVectorField& U,
136  const dimensionedVector& g,
137  const SLGThermo& thermo,
138  bool readFields = true
139  );
140 
141  //- Copy constructor with new name
143 
144  //- Copy constructor with new name - creates bare cloud
145  SprayCloud
146  (
147  const fvMesh& mesh,
148  const word& name,
149  const SprayCloud<CloudType>& c
150  );
151 
152 
153  //- Construct and return clone based on (this) with new name
154  virtual autoPtr<Cloud<parcelType>> clone(const word& name)
155  {
157  (
158  new SprayCloud(*this, name)
159  );
160  }
161 
162  //- Construct and return bare clone based on (this) with new name
163  virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
164  {
166  (
167  new SprayCloud(this->mesh(), name, *this)
168  );
169  }
170 
171 
172  //- Destructor
173  virtual ~SprayCloud();
174 
175 
176  // Member Functions
177 
178  // Access
179 
180  //- Return a reference to the cloud copy
181  inline const SprayCloud& cloudCopy() const;
182 
183  //- Return const-access to the average parcel mass
184  inline scalar averageParcelMass() const;
185 
186 
187  // Check
188 
189  //- Penetration for fraction [0-1] of the current total mass
190  inline scalar penetration(const scalar fraction) const;
191 
192 
193  // Sub-models
194 
195  //- Return const-access to the atomization model
197  atomization() const;
198 
199  //- Return reference to the atomization model
201 
202  //- Return const-access to the breakup model
204  breakup() const;
205 
206  //- Return reference to the breakup model
208 
209 
210  // Cloud evolution functions
211 
212  //- Set parcel thermo properties
214  (
215  parcelType& parcel,
216  const scalar lagrangianDt
217  );
218 
219  //- Check parcel properties
221  (
222  parcelType& parcel,
223  const scalar lagrangianDt,
224  const bool fullyDescribed
225  );
226 
227  //- Store the current cloud state
228  void storeState();
229 
230  //- Reset the current cloud to the previously stored state
231  void restoreState();
232 
233  //- Evolve the spray (inject, move)
234  void evolve();
235 
236 
237  // I-O
238 
239  //- Print cloud information
240  void info();
241 };
242 
243 
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
245 
246 } // End namespace Foam
247 
248 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249 
250 #include "SprayCloudI.H"
251 
252 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
253 
254 #ifdef NoRepository
255  #include "SprayCloud.C"
256 #endif
257 
258 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
259 
260 #endif
261 
262 // ************************************************************************* //
Foam::SprayCloud
Templated base class for spray cloud.
Definition: SprayCloud.H:50
cloudName
const word cloudName(propsDict.get< word >("cloud"))
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::SLGThermo
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:64
Foam::SprayCloud::storeState
void storeState()
Store the current cloud state.
Definition: SprayCloud.C:199
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::AtomizationModel
Templated atomization model class.
Definition: SprayCloud.H:48
Foam::SprayCloud::clone
virtual autoPtr< Cloud< parcelType > > clone(const word &name)
Construct and return clone based on (this) with new name.
Definition: SprayCloud.H:153
Foam::SprayCloud::parcelType
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
Definition: SprayCloud.H:71
rho
rho
Definition: readInitialConditions.H:88
Foam::SprayCloud::restoreState
void restoreState()
Reset the current cloud to the previously stored state.
Definition: SprayCloud.C:212
Foam::sprayCloud
Virtual abstract base class for templated SprayCloud.
Definition: sprayCloud.H:50
Foam::SprayCloud::info
void info()
Print cloud information.
Definition: SprayCloud.C:232
Foam::SprayCloud::breakupModel_
autoPtr< BreakupModel< SprayCloud< CloudType > > > breakupModel_
Break-up model.
Definition: SprayCloud.H:108
Foam::SprayCloud::cloudReset
void cloudReset(SprayCloud< CloudType > &c)
Reset state of cloud.
Definition: SprayCloud.C:59
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::SprayCloud::sprayCloudType
SprayCloud< CloudType > sprayCloudType
Convenience typedef for this cloud type.
Definition: SprayCloud.H:74
Foam::SprayCloud::checkParcelProperties
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
Definition: SprayCloud.C:179
SprayCloud.C
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::SprayCloud::cloudCopy
const SprayCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: SprayCloudI.H:33
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::dimensioned< vector >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam::Cloud::particleType
ParticleType particleType
Definition: Cloud.H:113
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:24
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
SprayCloudI.H
Foam::BreakupModel
Templated break-up model class.
Definition: SprayCloud.H:49
Foam::readFields
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Definition: ReadFieldsTemplates.C:312
Foam::SprayCloud::~SprayCloud
virtual ~SprayCloud()
Destructor.
Definition: SprayCloud.C:148
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
U
U
Definition: pEqn.H:72
Foam::SprayCloud::setParcelThermoProperties
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
Definition: SprayCloud.C:156
Foam::SprayCloud::evolve
void evolve()
Evolve the spray (inject, move)
Definition: SprayCloud.C:220
Foam::SprayCloud::averageParcelMass
scalar averageParcelMass() const
Return const-access to the average parcel mass.
Definition: SprayCloudI.H:72
Foam::SprayCloud::atomization
const AtomizationModel< SprayCloud< CloudType > > & atomization() const
Return const-access to the atomization model.
Definition: SprayCloudI.H:41
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::SprayCloud::cloneBare
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: SprayCloud.H:162
Foam::SprayCloud::breakup
const BreakupModel< SprayCloud< CloudType > > & breakup() const
Return const-access to the breakup model.
Definition: SprayCloudI.H:57
Foam::SprayCloud::cloudType
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: SprayCloud.H:68
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::SprayCloud::setModels
void setModels()
Set cloud sub-models.
Definition: SprayCloud.C:35
sprayCloud.H
Foam::SprayCloud::penetration
scalar penetration(const scalar fraction) const
Penetration for fraction [0-1] of the current total mass.
Definition: SprayCloudI.H:80
Foam::SprayCloud::atomizationModel_
autoPtr< AtomizationModel< SprayCloud< CloudType > > > atomizationModel_
Atomization model.
Definition: SprayCloud.H:105