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 | Copyright (C) 2011-2013 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  - atomization model
32  - break-up model
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef SprayCloud_H
37 #define SprayCloud_H
38 
39 #include "sprayCloud.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 template<class CloudType>
48 class AtomizationModel;
49 
50 template<class CloudType>
51 class BreakupModel;
52 
53 /*---------------------------------------------------------------------------*\
54  Class SprayCloud Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class CloudType>
58 class SprayCloud
59 :
60  public CloudType,
61  public sprayCloud
62 {
63 public:
64 
65  // Public typedefs
66 
67  //- Type of cloud this cloud was instantiated for
68  typedef CloudType cloudType;
69 
70  //- Type of parcel the cloud was instantiated for
71  typedef typename CloudType::particleType parcelType;
72 
73  //- Convenience typedef for this cloud type
75 
76 
77 private:
78 
79  // Private data
80 
81  //- Cloud copy pointer
83 
84  //- Average parcel mass
85  scalar averageParcelMass_;
86 
87 
88  // Private Member Functions
89 
90  //- Disallow default bitwise copy construct
91  SprayCloud(const SprayCloud&);
92 
93  //- Disallow default bitwise assignment
94  void operator=(const SprayCloud&);
95 
96 
97 protected:
98 
99  // Protected data
100 
101  // References to the cloud sub-models
102 
103  //- Atomization model
106 
107  //- Break-up model
109 
110 
111  // Protected Member Functions
112 
113  // Initialisation
114 
115  //- Set cloud sub-models
116  void setModels();
117 
118 
119  // Cloud evolution functions
120 
121  //- Reset state of cloud
123 
124 
125 public:
126 
127  // Constructors
128 
129  //- Construct given carrier gas fields
130  SprayCloud
131  (
132  const word& cloudName,
133  const volScalarField& rho,
134  const volVectorField& U,
135  const dimensionedVector& g,
136  const SLGThermo& thermo,
137  bool readFields = true
138  );
139 
140  //- Copy constructor with new name
142 
143  //- Copy constructor with new name - creates bare cloud
144  SprayCloud
145  (
146  const fvMesh& mesh,
147  const word& name,
148  const SprayCloud<CloudType>& c
149  );
150 
151 
152  //- Construct and return clone based on (this) with new name
153  virtual autoPtr<Cloud<parcelType> > clone(const word& name)
154  {
156  (
157  new SprayCloud(*this, name)
158  );
159  }
160 
161  //- Construct and return bare clone based on (this) with new name
162  virtual autoPtr<Cloud<parcelType> > cloneBare(const word& name) const
163  {
165  (
166  new SprayCloud(this->mesh(), name, *this)
167  );
168  }
169 
170 
171  //- Destructor
172  virtual ~SprayCloud();
173 
174 
175  // Member Functions
176 
177  // Access
178 
179  //- Return a reference to the cloud copy
180  inline const SprayCloud& cloudCopy() const;
181 
182  //- Return const-access to the average parcel mass
183  inline scalar averageParcelMass() const;
184 
185 
186  // Sub-models
187 
188  //- Return const-access to the atomization model
190  atomization() const;
191 
192  //- Return reference to the atomization model
194 
195  //- Return const-access to the breakup model
196  inline const BreakupModel<SprayCloud<CloudType> >&
197  breakup() const;
198 
199  //- Return reference to the breakup model
201 
202 
203  // Cloud evolution functions
204 
205  //- Set parcel thermo properties
207  (
208  parcelType& parcel,
209  const scalar lagrangianDt
210  );
211 
212  //- Check parcel properties
214  (
215  parcelType& parcel,
216  const scalar lagrangianDt,
217  const bool fullyDescribed
218  );
219 
220  //- Store the current cloud state
221  void storeState();
222 
223  //- Reset the current cloud to the previously stored state
224  void restoreState();
225 
226  //- Evolve the spray (inject, move)
227  void evolve();
228 
229 
230  // I-O
231 
232  //- Print cloud information
233  void info();
234 };
235 
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 } // End namespace Foam
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 #include "SprayCloudI.H"
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #ifdef NoRepository
248 # include "SprayCloud.C"
249 #endif
250 
251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 
253 #endif
254 
255 // ************************************************************************* //
Foam::SprayCloud
Templated base class for spray cloud.
Definition: SprayCloud.H:57
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::SLGThermo
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:62
Foam::SprayCloud::storeState
void storeState()
Store the current cloud state.
Definition: SprayCloud.C:195
Foam::SprayCloud::operator=
void operator=(const SprayCloud &)
Disallow default bitwise assignment.
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:47
g
const dimensionedVector & g
Definition: setRegionFluidFields.H:33
Foam::SprayCloud::clone
virtual autoPtr< Cloud< parcelType > > clone(const word &name)
Construct and return clone based on (this) with new name.
Definition: SprayCloud.H:152
Foam::SprayCloud::parcelType
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
Definition: SprayCloud.H:70
Foam::SprayCloud::cloudCopyPtr_
autoPtr< SprayCloud< CloudType > > cloudCopyPtr_
Cloud copy pointer.
Definition: SprayCloud.H:81
Foam::SprayCloud::breakup
const BreakupModel< SprayCloud< CloudType > > & breakup() const
Return const-access to the breakup model.
Definition: SprayCloudI.H:54
Foam::readFields
This function object reads fields from the time directories and adds them to the mesh database for fu...
Definition: readFields.H:104
Foam::SprayCloud::restoreState
void restoreState()
Reset the current cloud to the previously stored state.
Definition: SprayCloud.C:208
Foam::sprayCloud
Virtual abstract base class for templated SprayCloud.
Definition: sprayCloud.H:48
U
U
Definition: pEqn.H:46
Foam::SprayCloud::info
void info()
Print cloud information.
Definition: SprayCloud.C:229
Foam::SprayCloud::breakupModel_
autoPtr< BreakupModel< SprayCloud< CloudType > > > breakupModel_
Break-up model.
Definition: SprayCloud.H:107
Foam::DSMCCloud::cloudName
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:34
Foam::SprayCloud::cloudReset
void cloudReset(SprayCloud< CloudType > &c)
Reset state of cloud.
Definition: SprayCloud.C:57
Foam::DSMCCloud::mesh
const fvMesh & mesh() const
Return refernce to the mesh.
Definition: DSMCCloudI.H:41
Foam::SprayCloud::sprayCloudType
SprayCloud< CloudType > sprayCloudType
Convenience typedef for this cloud type.
Definition: SprayCloud.H:73
Foam::SprayCloud::checkParcelProperties
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
Definition: SprayCloud.C:175
SprayCloud.C
Foam::SprayCloud::atomization
const AtomizationModel< SprayCloud< CloudType > > & atomization() const
Return const-access to the atomization model.
Definition: SprayCloudI.H:38
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Foam::SprayCloud::cloudCopy
const SprayCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: SprayCloudI.H:30
Foam::dimensioned
Generic dimensioned Type class.
Definition: dimensionedScalarFwd.H:41
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam::Cloud< ParcelType >::particleType
ParticleType particleType
Definition: Cloud.H:114
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
SprayCloudI.H
Foam::BreakupModel
Templated break-up model class.
Definition: SprayCloud.H:50
Foam::SprayCloud::SprayCloud
SprayCloud(const SprayCloud &)
Disallow default bitwise copy construct.
rho
rho
Definition: pEqn.H:3
Foam::SprayCloud::~SprayCloud
virtual ~SprayCloud()
Destructor.
Definition: SprayCloud.C:145
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::SprayCloud::setParcelThermoProperties
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
Definition: SprayCloud.C:153
Foam::SprayCloud::averageParcelMass_
scalar averageParcelMass_
Average parcel mass.
Definition: SprayCloud.H:84
Foam::SprayCloud::evolve
void evolve()
Evolve the spray (inject, move)
Definition: SprayCloud.C:216
Foam::SprayCloud::averageParcelMass
scalar averageParcelMass() const
Return const-access to the average parcel mass.
Definition: SprayCloudI.H:69
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:161
Foam::SprayCloud::cloudType
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: SprayCloud.H:67
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::SprayCloud::setModels
void setModels()
Set cloud sub-models.
Definition: SprayCloud.C:33
sprayCloud.H
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Foam::SprayCloud::atomizationModel_
autoPtr< AtomizationModel< SprayCloud< CloudType > > > atomizationModel_
Atomization model.
Definition: SprayCloud.H:104