FreeFOAM The Cross-Platform CFD Toolkit
spray.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) 1991-2010 OpenCFD Ltd.
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::spray
26 
27 Description
28  A spray is a cloud of parcels
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef spray_H
33 #define spray_H
34 
35 #include <dieselSpray/parcel.H>
36 #include <dieselSpray/injector.H>
37 #include <OpenFOAM/IOPtrList.H>
39 #include <liquids/liquid.H>
40 #include <OpenFOAM/autoPtr.H>
42 #include <OpenFOAM/Random.H>
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 class atomizationModel;
51 class breakupModel;
52 class collisionModel;
53 class dispersionModel;
54 class dragModel;
55 class evaporationModel;
56 class injectorModel;
57 class heatTransferModel;
58 class wallModel;
59 
60 class basicMultiComponentMixture;
61 
62 /*---------------------------------------------------------------------------*\
63  Class spray Declaration
64 \*---------------------------------------------------------------------------*/
65 
66 class spray
67 :
68  public Cloud<parcel>
69 {
70  // Private data
71 
72  // References to the database and meshes
73 
74  const Time& runTime_;
75  scalar time0_;
76  const fvMesh& mesh_;
77 
78  //- Random number generator
79  Random rndGen_;
80 
81  //- Acceleration due to gravity
82  const vector& g_;
83 
84 
85  // References to the physical fields
86 
87  const volVectorField& U_;
88  const volScalarField& rho_;
89  const volScalarField& p_;
90  const volScalarField& T_;
91 
92 
93  //- The spray properties
94  IOdictionary sprayProperties_;
95 
96 
97  //- Ambient Pressure
98  scalar ambientPressure_;
99 
100  //- Ambient Temperature
101  scalar ambientTemperature_;
102 
103 
104  //- The injectors
105  IOPtrList<injector> injectors_;
106 
107 
108  // References to the spray sub-models
109 
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<liquidMixture> fuels_;
119  autoPtr<injectorModel> injectorModel_;
120 
121 
122  //- Minimum number of lagrangian subcycles
123  const label subCycles_;
124 
125 
126  // Composition properties
127 
128  const PtrList<gasThermoPhysics>& gasProperties_;
129  const basicMultiComponentMixture& composition_;
130 
131  List<label> liquidToGasIndex_;
132  List<label> gasToLiquidIndex_;
133  List<bool> isLiquidFuel_;
134 
135 
136  // Necessary 2D-information
137 
138  bool twoD_;
139  vector axisOfSymmetry_;
140  vector axisOfWedge_;
141  vector axisOfWedgeNormal_;
142  scalar angleOfWedge_;
143 
144 
145  // Interpolation
146 
147  dictionary interpolationSchemes_;
148 
149  autoPtr<interpolation<vector> > UInterpolator_;
150  autoPtr<interpolation<scalar> > rhoInterpolator_;
151  autoPtr<interpolation<scalar> > pInterpolator_;
152  autoPtr<interpolation<scalar> > TInterpolator_;
153 
154 
155  // Spray Source Terms
156 
157  //- Momentum
158  vectorField sms_;
159 
160  //- Enthalpy
161  scalarField shs_;
162 
163  //- Mass
164  PtrList<scalarField> srhos_;
165 
166  //- The total mass of the injected liquid
167  scalar totalInjectedLiquidMass_;
168 
169  //- The (total added) injected kinetic energy of the liquid
170  scalar injectedLiquidKE_;
171 
172 
173  // Private Member Functions
174 
175  //- Disallow default bitwise copy construct
176  spray(const spray&);
177 
178  //- Disallow default bitwise assignment
179  void operator=(const spray&);
180 
181 
182 public:
183 
184  // Constructors
185 
186  //- Construct from components
187  spray
188  (
189  const volVectorField& U,
190  const volScalarField& rho,
191  const volScalarField& p,
192  const volScalarField& T,
195  const dictionary& thermophysicalProperties,
196  const dimensionedVector& g,
197  bool readFields = true
198  );
199 
200 
201  // Destructor
202 
203  ~spray();
204 
205 
206  // Member Functions
207 
208  // Spray tracking and evolution functions
209 
210  //- Evolve the spray (move, inject and breakup)
211  void evolve();
212 
213  //- Move the spray parcels
214  void move();
215 
216  //- Inject more parcels
217  void inject();
218 
219  //- Primary breakup droplets
220  void atomizationLoop();
221 
222 
223  //- Secondary breakup droplets
224  void breakupLoop();
225 
226 
227  // Access
228 
229  inline const Time& runTime() const;
230  inline const fvMesh& mesh() const;
231 
232  inline const volVectorField& U() const;
233  inline const volScalarField& rho() const;
234  inline const volScalarField& p() const;
235  inline const volScalarField& T() const;
236 
237  inline PtrList<injector>& injectors();
238  inline const PtrList<injector>& injectors() const;
239 
240  inline const atomizationModel& atomization() const;
241  inline const breakupModel& breakup() const;
242  inline const collisionModel& collisions() const;
243  inline const dispersionModel& dispersion() const;
244  inline const dragModel& drag() const;
245  inline const evaporationModel& evaporation() const;
246  inline const heatTransferModel& heatTransfer() const;
247  inline const injectorModel& injection() const;
248  inline const wallModel& wall() const;
249 
250  inline tmp<volVectorField> momentumSource() const;
251  inline tmp<volScalarField> evaporationSource(const label i) const;
253 
254  inline Random& rndGen();
255  inline label subCycles() const;
256  inline const vector& g() const;
257 
258  inline const liquidMixture& fuels() const;
259  inline const PtrList<gasThermoPhysics>& gasProperties() const;
260  inline const basicMultiComponentMixture& composition() const;
261 
262  inline const List<label>& liquidToGasIndex() const;
263  inline const List<label>& gasToLiquidIndex() const;
264  inline const List<bool>& isLiquidFuel() const;
265 
266  inline const bool& twoD() const;
267  inline const vector& axisOfSymmetry() const;
268  inline const vector& axisOfWedge() const;
269  inline const vector& axisOfWedgeNormal() const;
270  inline const scalar& angleOfWedge() const;
271 
272  inline const interpolation<vector>& UInterpolator() const;
273  inline const interpolation<scalar>& rhoInterpolator() const;
274  inline const interpolation<scalar>& pInterpolator() const;
275  inline const interpolation<scalar>& TInterpolator() const;
276 
277  inline vectorField& sms();
278  inline const vectorField& sms() const;
279 
280  inline scalarField& shs();
281  inline const scalarField& shs() const;
282 
283  inline PtrList<scalarField>& srhos();
284  inline const PtrList<scalarField>& srhos() const;
285 
286  inline const scalar& ambientPressure() const;
287 
288  inline const scalar& ambientTemperature() const;
289 
290 
291  // Check
292 
293  //- Returns the liquid mass that has been injected
294  scalar injectedMass(const scalar t) const;
295 
296  //- Returns the liquid mass that will be injected by the injectors
297  scalar totalMassToInject() const;
298 
299  //- Returns the injected enthalpy
300  scalar injectedEnthalpy(const scalar t) const;
301 
302  //- Returns current total liquid mass in the domain
303  scalar liquidMass() const;
304 
305  //- Returns the enthalpy of all the liquid in the domain
306  // Hdrop = Hgas - Hlat
307  scalar liquidEnthalpy() const;
308 
309  //- Returns the enthalpy (total) of all the liquid in the domain
310  // Hdrop = Hgas - Hlat + (P-Psat)/rhoDrop;
311  scalar liquidTotalEnthalpy() const;
312 
313  //- Returns the kinetic energy of the liquid phase
314  scalar liquidKineticEnergy() const;
315 
316  //- Returns the injected kinetic energy of the liquid phase
317  scalar injectedLiquidKineticEnergy() const;
318 
319  //- Returns the droplet penetration for 'prc' percent of the
320  // liquid from nozzle 'nozzlei'
321  scalar liquidPenetration
322  (
323  const label nozzlei,
324  const scalar prc
325  ) const;
326 
327  //- Returns the droplet penetration for 'prc' percent of the
328  // liquid from nozzle 0
329  scalar liquidPenetration(const scalar prc) const;
330 
331  //- Return Sauter Mean Diameter
332  scalar smd() const;
333 
334  //- Return Maximum Diameter
335  scalar maxD() const;
336 
337  //- Return Ambient Pressure
339 
340  //- Return Ambient Temperature
342 };
343 
344 
345 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
346 
347 } // End namespace Foam
348 
349 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
350 
351 #include <dieselSpray/sprayI.H>
352 
353 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
354 
355 #endif
356 
357 // ************************ vim: set sw=4 sts=4 et: ************************ //