1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 A spray is a cloud of parcels
31 \*---------------------------------------------------------------------------*/
38 #include "IOPtrList.H"
39 #include "interpolation.H"
42 #include "liquidMixture.H"
44 #include "thermoPhysicsTypes.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 class atomizationModel;
54 class dispersionModel;
56 class evaporationModel;
58 class heatTransferModel;
61 class basicMultiComponentMixture;
63 /*---------------------------------------------------------------------------*\
64 Class spray Declaration
65 \*---------------------------------------------------------------------------*/
73 // References to the database and meshes
79 //- Random number generator
82 //- Acceleration due to gravity
86 // References to the physical fields
88 const volVectorField& U_;
89 const volScalarField& rho_;
90 const volScalarField& p_;
91 const volScalarField& T_;
94 //- The spray properties
95 IOdictionary sprayProperties_;
99 scalar ambientPressure_;
101 //- Ambient Temperature
102 scalar ambientTemperature_;
106 IOPtrList<injector> injectors_;
109 // References to the spray sub-models
111 autoPtr<atomizationModel> atomization_;
112 autoPtr<dragModel> drag_;
113 autoPtr<evaporationModel> evaporation_;
114 autoPtr<heatTransferModel> heatTransfer_;
115 autoPtr<wallModel> wall_;
116 autoPtr<breakupModel> breakupModel_;
117 autoPtr<collisionModel> collisionModel_;
118 autoPtr<dispersionModel> dispersionModel_;
119 autoPtr<liquidMixture> fuels_;
120 autoPtr<injectorModel> injectorModel_;
123 // Iterations to avoid errors due to too small parcels
124 // causing temperature out of range
126 //- Spray iteration dictionary
127 dictionary sprayIteration_;
129 //- Number of spray iterations
130 const label sprayIterate_;
132 //- Spray relaxation factor
133 const scalar sprayRelaxFactor_;
135 //- Minimum parcel mass
136 const scalar minimumParcelMass_;
139 //- Minimum number of lagrangian subcycles
140 const label subCycles_;
143 // Composition properties
145 const PtrList<gasThermoPhysics>& gasProperties_;
146 const basicMultiComponentMixture& composition_;
148 List<label> liquidToGasIndex_;
149 List<label> gasToLiquidIndex_;
150 List<bool> isLiquidFuel_;
153 // Necessary 2D-information
156 vector axisOfSymmetry_;
158 vector axisOfWedgeNormal_;
159 scalar angleOfWedge_;
164 dictionary interpolationSchemes_;
166 autoPtr<interpolation<vector> > UInterpolator_;
167 autoPtr<interpolation<scalar> > rhoInterpolator_;
168 autoPtr<interpolation<scalar> > pInterpolator_;
169 autoPtr<interpolation<scalar> > TInterpolator_;
172 // Spray Source Terms
181 PtrList<scalarField> srhos_;
183 //- The total mass of the injected liquid
184 scalar totalInjectedLiquidMass_;
186 //- The (total added) injected kinetic energy of the liquid
187 scalar injectedLiquidKE_;
190 // Private Member Functions
192 //- Disallow default bitwise copy construct
195 //- Disallow default bitwise assignment
196 void operator=(const spray&);
203 //- Construct from components
206 const volVectorField& U,
207 const volScalarField& rho,
208 const volScalarField& p,
209 const volScalarField& T,
210 const basicMultiComponentMixture& composition,
211 const PtrList<gasThermoPhysics>& gasProperties,
212 const dictionary& thermophysicalProperties,
213 const dimensionedVector& g,
214 bool readFields = true
225 // Spray tracking and evolution functions
227 //- Evolve the spray (move, inject and breakup)
230 //- Move the spray parcels
233 //- Inject more parcels
236 //- Primary breakup droplets
237 void atomizationLoop();
240 //- Secondary breakup droplets
246 inline const Time& runTime() const;
247 inline const fvMesh& mesh() const;
249 inline const volVectorField& U() const;
250 inline const volScalarField& rho() const;
251 inline const volScalarField& p() const;
252 inline const volScalarField& T() const;
254 inline PtrList<injector>& injectors();
255 inline const PtrList<injector>& injectors() const;
257 inline const atomizationModel& atomization() const;
258 inline const breakupModel& breakup() const;
259 inline const collisionModel& collisions() const;
260 inline const dispersionModel& dispersion() const;
261 inline const dragModel& drag() const;
262 inline const evaporationModel& evaporation() const;
263 inline const heatTransferModel& heatTransfer() const;
264 inline const injectorModel& injection() const;
265 inline const wallModel& wall() const;
267 inline tmp<volVectorField> momentumSource() const;
268 inline tmp<volScalarField> evaporationSource(const label i) const;
269 inline tmp<volScalarField> heatTransferSource() const;
271 inline Random& rndGen();
273 inline label sprayIterate() const;
274 inline scalar sprayRelaxFactor() const;
275 inline scalar minimumParcelMass() const;
277 inline label subCycles() const;
278 inline const vector& g() const;
280 inline const liquidMixture& fuels() const;
281 inline const PtrList<gasThermoPhysics>& gasProperties() const;
282 inline const basicMultiComponentMixture& composition() const;
284 inline const List<label>& liquidToGasIndex() const;
285 inline const List<label>& gasToLiquidIndex() const;
286 inline const List<bool>& isLiquidFuel() const;
288 inline const bool& twoD() const;
289 inline const vector& axisOfSymmetry() const;
290 inline const vector& axisOfWedge() const;
291 inline const vector& axisOfWedgeNormal() const;
292 inline const scalar& angleOfWedge() const;
294 inline const interpolation<vector>& UInterpolator() const;
295 inline const interpolation<scalar>& rhoInterpolator() const;
296 inline const interpolation<scalar>& pInterpolator() const;
297 inline const interpolation<scalar>& TInterpolator() const;
299 inline vectorField& sms();
300 inline const vectorField& sms() const;
302 inline scalarField& shs();
303 inline const scalarField& shs() const;
305 inline PtrList<scalarField>& srhos();
306 inline const PtrList<scalarField>& srhos() const;
308 inline const scalar& ambientPressure() const;
310 inline const scalar& ambientTemperature() const;
315 //- Returns the liquid mass that has been injected
316 scalar injectedMass(const scalar t) const;
318 //- Returns the liquid mass that will be injected by the injectors
319 scalar totalMassToInject() const;
321 //- Returns the injected enthalpy
322 scalar injectedEnthalpy(const scalar t) const;
324 //- Returns current total liquid mass in the domain
325 scalar liquidMass() const;
327 //- Returns the enthalpy of all the liquid in the domain
328 // Hdrop = Hgas - Hlat
329 scalar liquidEnthalpy() const;
331 //- Returns the enthalpy (total) of all the liquid in the domain
332 // Hdrop = Hgas - Hlat + (P-Psat)/rhoDrop;
333 scalar liquidTotalEnthalpy() const;
335 //- Returns the kinetic energy of the liquid phase
336 scalar liquidKineticEnergy() const;
338 //- Returns the injected kinetic energy of the liquid phase
339 scalar injectedLiquidKineticEnergy() const;
341 //- Returns the droplet penetration for a fraction of the
342 // liquid from nozzle 'nozzlei'.
343 // Fraction is defined between 0 and 1, where 1 represents 100%
344 scalar liquidPenetration
350 //- Returns the droplet penetration for 'prc' percent of the
351 // liquid from nozzle 0
352 scalar liquidPenetration(const scalar prc) const;
354 //- Return Sauter Mean Diameter
357 //- Return Maximum Diameter
360 //- Return Ambient Pressure
361 void calculateAmbientPressure();
363 //- Return Ambient Temperature
364 void calculateAmbientTemperature();
368 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
370 } // End namespace Foam
372 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
376 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
380 // ************************************************************************* //