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-2024 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
158  {
160  (
161  new SprayCloud(*this, name)
162  );
163  }
164 
165  //- Construct and return bare clone based on (this) with new name
167  (
168  const word& name
169  ) const
170  {
172  (
173  new SprayCloud(this->mesh(), name, *this)
174  );
175  }
176 
177 
178  //- Destructor
179  virtual ~SprayCloud();
180 
181 
182  // Member Functions
183 
184  // Access
185 
186  //- Return a reference to the cloud copy
187  inline const SprayCloud& cloudCopy() const;
188 
189 
190  // Check
191 
192  //- Penetration for fraction [0-1] of the current total mass
193  inline scalar penetration(const scalar fraction) const;
194 
195 
196  // Sub-models
197 
198  //- Return const-access to the atomisation model
200  atomisation() const;
201 
202  //- Return reference to the atomisation model
204 
205  //- Return const-access to the breakup model
207  breakup() const;
208 
209  //- Return reference to the breakup model
211 
212 
213  // Cloud evolution functions
214 
215  //- Set parcel thermo properties
217 
218  //- Check parcel properties
220  (
221  parcelType& parcel,
222  const label injectori
223  );
224 
225  //- Store the current cloud state
226  void storeState();
227 
228  //- Reset the current cloud to the previously stored state
229  void restoreState();
230 
231  //- Evolve the spray (inject, move)
232  void evolve();
233 
234 
235  // I-O
236 
237  //- Print cloud information
238  void info();
239 
240 
241  // Member Operators
242 
243  //- Disallow default bitwise assignment
244  void operator=(const SprayCloud&) = delete;
245 };
246 
247 
248 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249 
250 } // End namespace Foam
251 
252 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
253 
254 #include "SprayCloudI.H"
255 
256 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
257 
258 #ifdef NoRepository
259  #include "SprayCloud.C"
260 #endif
261 
262 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263 
264 #endif
265 
266 // ************************************************************************* //
Templated atomisation model class.
Templated break-up model class.
Definition: BreakupModel.H:55
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:80
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:280
const word & name() const
Return name.
Definition: IOobject.H:307
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
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
virtual autoPtr< lagrangian::Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: SprayCloud.H:166
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:56
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
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)