SprayCloud.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::SprayCloud
26 
27 Description
28  Templated base class for spray cloud
29 
30  - sub-models:
31  - atomisation model
32  - break-up model
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef SprayCloud_H
37 #define SprayCloud_H
38 
39 #include "volFieldsFwd.H"
40 #include "fvMatricesFwd.H"
41 #include "dimensionedTypes.H"
42 #include "fvMesh.H"
43 #include "fluidThermo.H"
44 #include "globalIndex.H"
45 #include "Cloud.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward declaration of classes
53 
54 template<class CloudType>
55 class AtomisationModel;
56 
57 template<class CloudType>
58 class BreakupModel;
59 
60 /*---------------------------------------------------------------------------*\
61  Class SprayCloudName Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 
66 
67 /*---------------------------------------------------------------------------*\
68  Class SprayCloud Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 template<class CloudType>
72 class SprayCloud
73 :
74  public CloudType,
75  public SprayCloudName
76 {
77 public:
78 
79  // Public Typedefs
80 
81  //- Type of cloud this cloud was instantiated for
82  typedef CloudType cloudType;
83 
84  //- Type of parcel the cloud was instantiated for
85  typedef typename CloudType::particleType parcelType;
86 
87  //- Convenience typedef for this cloud type
89 
90 
91 private:
92 
93  // Private Data
94 
95  //- Cloud copy pointer
96  autoPtr<SprayCloud<CloudType>> cloudCopyPtr_;
97 
98 
99 protected:
100 
101  // Protected data
102 
103  // References to the cloud sub-models
104 
105  //- Atomisation 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 fluidThermo& carrierThermo,
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  //- Disallow default bitwise copy construction
154  SprayCloud(const SprayCloud&) = delete;
155 
156  //- Construct and return clone based on (this) with new name
157  virtual autoPtr<Cloud<parcelType>> clone(const word& name)
158  {
160  (
161  new SprayCloud(*this, name)
162  );
163  }
164 
165  //- Construct and return bare clone based on (this) with new name
166  virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
167  {
169  (
170  new SprayCloud(this->mesh(), name, *this)
171  );
172  }
173 
174 
175  //- Destructor
176  virtual ~SprayCloud();
177 
178 
179  // Member Functions
180 
181  // Access
182 
183  //- Return a reference to the cloud copy
184  inline const SprayCloud& cloudCopy() 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 atomisation model
197  atomisation() const;
198 
199  //- Return reference to the atomisation 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  //- Check parcel properties
217  (
218  parcelType& parcel,
219  const label injectori
220  );
221 
222  //- Store the current cloud state
223  void storeState();
224 
225  //- Reset the current cloud to the previously stored state
226  void restoreState();
227 
228  //- Evolve the spray (inject, move)
229  void evolve();
230 
231 
232  // I-O
233 
234  //- Print cloud information
235  void info();
236 
237 
238  // Member Operators
239 
240  //- Disallow default bitwise assignment
241  void operator=(const SprayCloud&) = delete;
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 // ************************************************************************* //
Templated atomisation model class.
Templated break-up model class.
Definition: BreakupModel.H:55
ParcelType particleType
Definition: Cloud.H:128
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:79
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:34
const fvMesh & mesh() const
Return references to the mesh.
Definition: DSMCCloudI.H:41
Generic GeometricField class.
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:283
const word & name() const
Return name.
Definition: IOobject.H:310
Templated base class for spray cloud.
Definition: SprayCloud.H:75
autoPtr< BreakupModel< SprayCloud< CloudType > > > breakupModel_
Break-up model.
Definition: SprayCloud.H:109
virtual ~SprayCloud()
Destructor.
Definition: SprayCloud.C:135
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:56
SprayCloud< CloudType > sprayCloudType
Convenience typedef for this cloud type.
Definition: SprayCloud.H:87
void storeState()
Store the current cloud state.
Definition: SprayCloud.C:187
void cloudReset(SprayCloud< CloudType > &c)
Reset state of cloud.
Definition: SprayCloud.C:59
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: SprayCloud.H:165
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
Definition: SprayCloud.H:84
autoPtr< AtomisationModel< SprayCloud< CloudType > > > atomisationModel_
Atomisation model.
Definition: SprayCloud.H:106
const SprayCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: SprayCloudI.H:32
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: SprayCloud.H:81
void evolve()
Evolve the spray (inject, move)
Definition: SprayCloud.C:208
SprayCloud(const word &cloudName, const volScalarField &rho, const volVectorField &U, const dimensionedVector &g, const fluidThermo &carrierThermo, bool readFields=true)
Construct given carrier gas fields.
Definition: SprayCloud.C:74
void info()
Print cloud information.
Definition: SprayCloud.C:220
void restoreState()
Reset the current cloud to the previously stored state.
Definition: SprayCloud.C:200
void operator=(const SprayCloud &)=delete
Disallow default bitwise assignment.
void checkParcelProperties(parcelType &parcel, const label injectori)
Check parcel properties.
Definition: SprayCloud.C:165
scalar penetration(const scalar fraction) const
Penetration for fraction [0-1] of the current total mass.
Definition: SprayCloudI.H:72
const AtomisationModel< SprayCloud< CloudType > > & atomisation() const
Return const-access to the atomisation model.
Definition: SprayCloudI.H:40
void setParcelThermoProperties(parcelType &parcel)
Set parcel thermo properties.
Definition: SprayCloud.C:143
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:57
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
A class for handling words, derived from string.
Definition: word.H:62
Forward declarations of fvMatrix specialisations.
U
Definition: pEqn.H:72
const dimensionedScalar c
Speed of light in a vacuum.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the specified type.
Definition: ReadFields.C:244
TemplateName(FvFaceCellWave)