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 #include "SortableList.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
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 
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
116 
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
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 // ************************************************************************* //
Foam::SprayCloud
Templated base class for spray cloud.
Definition: SprayCloud.H:51
cloudName
const word cloudName(propsDict.get< word >("cloud"))
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
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:49
Foam::SprayCloud::clone
virtual autoPtr< Cloud< parcelType > > clone(const word &name)
Construct and return clone based on (this) with new name.
Definition: SprayCloud.H:154
Foam::SprayCloud::parcelType
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
Definition: SprayCloud.H:72
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:109
SortableList.H
Foam::SprayCloud::cloudReset
void cloudReset(SprayCloud< CloudType > &c)
Reset state of cloud.
Definition: SprayCloud.C:59
Foam::SprayCloud::sprayCloudType
SprayCloud< CloudType > sprayCloudType
Convenience typedef for this cloud type.
Definition: SprayCloud.H:75
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:85
Foam::Cloud::particleType
ParticleType particleType
Definition: Cloud.H:114
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:26
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
SprayCloudI.H
Foam::BreakupModel
Templated break-up model class.
Definition: SprayCloud.H:50
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::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
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:163
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:69
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:106