1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011-2011 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
28 Reacing spray parcel, with added functionality for atomization and breakup
30 \*---------------------------------------------------------------------------*/
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 template<class ParcelType>
45 template<class ParcelType>
49 const SprayParcel<ParcelType>&
52 /*---------------------------------------------------------------------------*\
53 Class SprayParcel Declaration
54 \*---------------------------------------------------------------------------*/
56 template<class ParcelType>
66 // Spray parcel properties
68 //- Initial droplet diameter
71 //- Injection position
74 //- Part of liquid core ( >0.5=liquid, <0.5=droplet )
77 //- Index for KH Breakup
80 //- Spherical deviation
83 //- Rate of change of spherical deviation
86 //- Characteristic time (used in atomization and/or breakup model)
89 //- Stripped parcel mass due to breakup
92 //- Injected from injector (needed e.g. for calculating distance
96 //- Momentum relaxation time (needed for calculating parcel acc.)
99 //- Passive scalar (extra variable to be defined by user)
105 // Static data members
107 //- String representation of properties
108 static string propHeader;
110 //- Runtime type information
111 TypeName("SprayParcel");
116 //- Construct from owner, position, and cloud owner
117 // Other properties initialised as null
120 const polyMesh& mesh,
121 const vector& position,
123 const label tetFaceI,
127 //- Construct from components
130 const polyMesh& mesh,
131 const vector& position,
133 const label tetFaceI,
136 const scalar nParticle0,
138 const scalar dTarget0,
141 const vector& angularMomentum0,
142 const vector& torque0,
143 const scalarField& Y0,
144 const scalar liquidCore,
145 const scalar KHindex,
150 const scalar injector,
153 const typename ParcelType::constantProperties& constProps
156 //- Construct from Istream
159 const polyMesh& mesh,
161 bool readFields = true
164 //- Construct as a copy
167 const SprayParcel& p,
171 //- Construct as a copy
172 SprayParcel(const SprayParcel& p);
174 //- Construct and return a (basic particle) clone
175 virtual autoPtr<particle> clone() const
177 return autoPtr<particle>(new SprayParcel<ParcelType>(*this));
180 //- Construct and return a (basic particle) clone
181 virtual autoPtr<particle> clone(const polyMesh& mesh) const
183 return autoPtr<particle>
185 new SprayParcel<ParcelType>(*this, mesh)
189 //- Factory class to read-construct particles used for
193 const polyMesh& mesh_;
197 iNew(const polyMesh& mesh)
202 autoPtr<SprayParcel<ParcelType> > operator()(Istream& is) const
204 return autoPtr<SprayParcel<ParcelType> >
206 new SprayParcel<ParcelType>(mesh_, is, true)
216 //- Return const access to initial droplet diameter
217 inline scalar d0() const;
219 //- Return const access to initial droplet position
220 inline const vector& position0() const;
222 //- Return const access to liquid core
223 inline scalar liquidCore() const;
225 //- Return const access to Kelvin-Helmholtz breakup index
226 inline scalar KHindex() const;
228 //- Return const access to spherical deviation
229 inline scalar y() const;
231 //- Return const access to rate of change of spherical deviation
232 inline scalar yDot() const;
234 //- Return const access to atomization characteristic time
235 inline scalar tc() const;
237 //- Return const access to stripped parcel mass
238 inline scalar ms() const;
240 //- Return const access to injector id
241 inline scalar injector() const;
243 //- Return const access to momentum relaxation time
244 inline scalar tMom() const;
246 //- Return const access to passive user scalar
247 inline scalar user() const;
252 //- Return access to initial droplet diameter
255 //- Return access to initial droplet position
256 inline vector& position0();
258 //- Return access to liquid core
259 inline scalar& liquidCore();
261 //- Return access to Kelvin-Helmholtz breakup index
262 inline scalar& KHindex();
264 //- Return access to spherical deviation
267 //- Return access to rate of change of spherical deviation
268 inline scalar& yDot();
270 //- Return access to atomization characteristic time
273 //- Return access to stripped parcel mass
276 //- Return access to injector id
277 inline scalar& injector();
279 //- Return access to momentum relaxation time
280 inline scalar& tMom();
282 //- Return access to passive user scalar
283 inline scalar& user();
286 // Main calculation loop
289 template<class TrackData>
297 //- Correct parcel properties according to atomization model
298 template<class TrackData>
306 //- Correct parcel properties according to breakup model
307 template<class TrackData>
315 //- Correct cell values using latest transfer information
316 template<class TrackData>
317 void cellValueSourceCorrection
324 //- Correct surface values due to emitted species
325 template<class TrackData>
326 void correctSurfaceValues
331 const scalarField& Cs,
338 //- Update parcel properties over the time interval
339 template<class TrackData>
347 //- Calculate the chi-factor for flash-boiling for the
349 template<class TrackData>
356 //- Solve the TAB equation
357 template<class TrackData>
368 template<class CloudType, class CompositionType>
369 static void readFields
372 const CompositionType& compModel
375 //- Read - no composition
376 template<class CloudType>
377 static void readFields(CloudType& c);
380 template<class CloudType, class CompositionType>
381 static void writeFields
384 const CompositionType& compModel
387 //- Write - composition supplied
388 template<class CloudType>
389 static void writeFields(const CloudType& c);
394 friend Ostream& operator<< <ParcelType>
397 const SprayParcel<ParcelType>&
402 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
404 } // End namespace Foam
406 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
408 #include "SprayParcelI.H"
410 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
413 #include "SprayParcel.C"
417 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
421 // ************************************************************************* //