1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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 A spray is a cloud of parcels
30 \*---------------------------------------------------------------------------*/
38 #include "IOPtrList.H"
39 #include "interpolation.H"
40 #include "liquidProperties.H"
41 #include "liquidMixtureProperties.H"
42 #include "cachedRandom.H"
43 #include "thermoPhysicsTypes.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 class atomizationModel;
53 class dispersionModel;
55 class evaporationModel;
57 class heatTransferModel;
60 class basicMultiComponentMixture;
62 /*---------------------------------------------------------------------------*\
63 Class spray Declaration
64 \*---------------------------------------------------------------------------*/
72 // References to the database and meshes
78 //- Random number generator
81 //- Acceleration due to gravity
85 // References to the physical fields
87 const volVectorField& U_;
88 const volScalarField& rho_;
89 const volScalarField& p_;
90 const volScalarField& T_;
93 //- The spray properties
94 IOdictionary sprayProperties_;
98 scalar ambientPressure_;
100 //- Ambient Temperature
101 scalar ambientTemperature_;
105 IOPtrList<injector> injectors_;
108 // References to the spray sub-models
110 autoPtr<atomizationModel> atomization_;
111 autoPtr<dragModel> drag_;
112 autoPtr<evaporationModel> evaporation_;
113 autoPtr<heatTransferModel> heatTransfer_;
114 autoPtr<wallModel> wall_;
115 autoPtr<breakupModel> breakupModel_;
116 autoPtr<collisionModel> collisionModel_;
117 autoPtr<dispersionModel> dispersionModel_;
118 autoPtr<liquidMixtureProperties> fuels_;
119 autoPtr<injectorModel> injectorModel_;
122 //- Minimum number of lagrangian subcycles
123 const label subCycles_;
126 // Composition properties
128 const PtrList<gasThermoPhysics>& gasProperties_;
129 const basicMultiComponentMixture& composition_;
131 List<label> liquidToGasIndex_;
132 List<label> gasToLiquidIndex_;
133 List<bool> isLiquidFuel_;
136 // Necessary 2D-information
139 vector axisOfSymmetry_;
141 vector axisOfWedgeNormal_;
142 scalar angleOfWedge_;
147 dictionary interpolationSchemes_;
149 autoPtr<interpolation<vector> > UInterpolator_;
150 autoPtr<interpolation<scalar> > rhoInterpolator_;
151 autoPtr<interpolation<scalar> > pInterpolator_;
152 autoPtr<interpolation<scalar> > TInterpolator_;
155 // Spray Source Terms
164 PtrList<scalarField> srhos_;
166 //- The total mass of the injected liquid
167 scalar totalInjectedLiquidMass_;
169 //- The (total added) injected kinetic energy of the liquid
170 scalar injectedLiquidKE_;
173 // Private Member Functions
175 //- Disallow default bitwise copy construct
178 //- Disallow default bitwise assignment
179 void operator=(const spray&);
186 //- Construct from components
189 const volVectorField& U,
190 const volScalarField& rho,
191 const volScalarField& p,
192 const volScalarField& T,
193 const basicMultiComponentMixture& composition,
194 const PtrList<gasThermoPhysics>& gasProperties,
195 const dictionary& thermophysicalProperties,
196 const dimensionedVector& g,
197 bool readFields = true
207 // Spray tracking and evolution functions
209 //- Evolve the spray (move, inject and breakup)
212 //- Move the spray parcels
215 //- Inject more parcels
218 //- Primary breakup droplets
219 void atomizationLoop();
222 //- Secondary breakup droplets
228 inline const Time& runTime() const;
229 inline const fvMesh& mesh() const;
231 inline const volVectorField& U() const;
232 inline const volScalarField& rho() const;
233 inline const volScalarField& p() const;
234 inline const volScalarField& T() const;
236 inline PtrList<injector>& injectors();
237 inline const PtrList<injector>& injectors() const;
239 inline const atomizationModel& atomization() const;
240 inline const breakupModel& breakup() const;
241 inline const collisionModel& collisions() const;
242 inline const dispersionModel& dispersion() const;
243 inline const dragModel& drag() const;
244 inline const evaporationModel& evaporation() const;
245 inline const heatTransferModel& heatTransfer() const;
246 inline const injectorModel& injection() const;
247 inline const wallModel& wall() const;
249 inline tmp<volVectorField> momentumSource() const;
250 inline tmp<volScalarField> evaporationSource(const label i) const;
251 inline tmp<volScalarField> heatTransferSource() const;
253 inline cachedRandom& rndGen();
254 inline label subCycles() const;
255 inline const vector& g() const;
257 inline const liquidMixtureProperties& fuels() const;
258 inline const PtrList<gasThermoPhysics>& gasProperties() const;
259 inline const basicMultiComponentMixture& composition() const;
261 inline const List<label>& liquidToGasIndex() const;
262 inline const List<label>& gasToLiquidIndex() const;
263 inline const List<bool>& isLiquidFuel() const;
265 inline bool twoD() const;
266 inline const vector& axisOfSymmetry() const;
267 inline const vector& axisOfWedge() const;
268 inline const vector& axisOfWedgeNormal() const;
269 inline scalar angleOfWedge() const;
271 inline const interpolation<vector>& UInterpolator() const;
272 inline const interpolation<scalar>& rhoInterpolator() const;
273 inline const interpolation<scalar>& pInterpolator() const;
274 inline const interpolation<scalar>& TInterpolator() const;
276 inline vectorField& sms();
277 inline const vectorField& sms() const;
279 inline scalarField& shs();
280 inline const scalarField& shs() const;
282 inline PtrList<scalarField>& srhos();
283 inline const PtrList<scalarField>& srhos() const;
285 inline scalar ambientPressure() const;
287 inline scalar ambientTemperature() const;
292 //- Returns the liquid mass that has been injected
293 scalar injectedMass(const scalar t) const;
295 //- Returns the liquid mass that will be injected by the injectors
296 scalar totalMassToInject() const;
298 //- Returns the injected enthalpy
299 scalar injectedEnthalpy(const scalar t) const;
301 //- Returns current total liquid mass in the domain
302 scalar liquidMass() const;
304 //- Returns the enthalpy of all the liquid in the domain
305 // Hdrop = Hgas - Hlat
306 scalar liquidEnthalpy() const;
308 //- Returns the enthalpy (total) of all the liquid in the domain
309 // Hdrop = Hgas - Hlat + (P-Psat)/rhoDrop;
310 scalar liquidTotalEnthalpy() const;
312 //- Returns the kinetic energy of the liquid phase
313 scalar liquidKineticEnergy() const;
315 //- Returns the injected kinetic energy of the liquid phase
316 scalar injectedLiquidKineticEnergy() const;
318 //- Returns the droplet penetration for 'prc' percent of the
319 // liquid from nozzle 'nozzlei'
320 scalar liquidPenetration
326 //- Returns the droplet penetration for 'prc' percent of the
327 // liquid from nozzle 0
328 scalar liquidPenetration(const scalar prc) const;
330 //- Return Sauter Mean Diameter
333 //- Return Maximum Diameter
336 //- Return Ambient Pressure
337 void calculateAmbientPressure();
339 //- Return Ambient Temperature
340 void calculateAmbientTemperature();
344 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
346 } // End namespace Foam
348 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
352 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
356 // ************************************************************************* //