FreeFOAM The Cross-Platform CFD Toolkit
KinematicCloud_.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::KinematicCloud
26 
27 Description
28  Templated base class for kinematic cloud
29 
30  - Kinematic only
31  - Dispersion model
32  - Drag model
33  - Injection model
34  - Wall interaction model
35 
36 SourceFiles
37  KinematicCloudI.H
38  KinematicCloud.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef KinematicCloud_H
43 #define KinematicCloud_H
44 
45 #include <lagrangian/Cloud.H>
47 #include <OpenFOAM/IOdictionary.H>
48 #include <OpenFOAM/autoPtr.H>
49 #include <OpenFOAM/Random.H>
50 #include <finiteVolume/fvMesh.H>
51 #include <finiteVolume/volFields.H>
54 
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 
62 // Forward declaration of classes
63 
64 template<class CloudType>
65 class DispersionModel;
66 
67 template<class CloudType>
68 class DragModel;
69 
70 template<class CloudType>
71 class InjectionModel;
72 
73 template<class CloudType>
74 class PostProcessingModel;
75 
76 template<class CloudType>
77 class PatchInteractionModel;
78 
79 /*---------------------------------------------------------------------------*\
80  Class KinematicCloud Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 template<class ParcelType>
85 :
86  public Cloud<ParcelType>,
87  public kinematicCloud
88 {
89  // Private Member Functions
90 
91  //- Disallow default bitwise copy construct
93 
94  //- Disallow default bitwise assignment
95  void operator=(const KinematicCloud&);
96 
97 
98 protected:
99 
100  // Protected data
101 
102  //- References to the mesh and time databases
103  const fvMesh& mesh_;
104 
105  //- Dictionary of particle properties
107 
108  //- Parcel constant properties
109  typename ParcelType::constantProperties constProps_;
110 
111  //- Cloud active flag
113 
114  //- Parcel type id - used to flag the type of parcels issued by this
115  // cloud
116  const label parcelTypeId_;
117 
118  //- Flag to indicate whether parcels are coupled to the carrier phase
119  // i.e. whether or not to generate source terms for carrier phase
121 
122  //- Flag to correct cell values with latest transfer information
123  // during the lagrangian timestep
125 
126  //- Random number generator - used by some injection routines
128 
129 
130  // References to the carrier gas fields
131 
132  //- Density
134 
135  //- Velocity
137 
138  //- Dynamic viscosity
140 
141 
142  // Environmental properties
143 
144  //- Gravity
146 
147 
148  //- Optional particle forces
150 
151  //- Interpolation schemes dictionary
153 
154 
155  // References to the cloud sub-models
156 
157  //- Dispersion model
160 
161  //- Drag transfer model
163 
164  //- Injector model
167 
168  //- Patch interaction model
171 
172  //- Post-processing model
175 
176 
177  // Reference to the particle integration schemes
178 
179  //- Velocity integration
181 
182 
183  // Sources
184 
185  //- Momentum
187 
188 
189  // Cloud evolution functions
190 
191  //- Pre-evolve
192  void preEvolve();
193 
194  //- Evolve the cloud
195  void evolveCloud();
196 
197  //- Post-evolve
198  void postEvolve();
199 
200 
201 public:
202 
203  // Constructors
204 
205  //- Construct given carrier gas fields
207  (
208  const word& cloudName,
209  const volScalarField& rho,
210  const volVectorField& U,
211  const volScalarField& mu,
212  const dimensionedVector& g,
213  bool readFields = true
214  );
215 
216 
217  //- Destructor
218  virtual ~KinematicCloud();
219 
220 
221  //- Type of parcel the cloud was instantiated for
222  typedef ParcelType parcelType;
223 
224 
225  // Member Functions
226 
227  // Access
228 
229  // References to the mesh and databases
230 
231  //- Return refernce to the mesh
232  inline const fvMesh& mesh() const;
233 
234  //- Return particle properties dictionary
235  inline const IOdictionary& particleProperties() const;
236 
237  //- Return the constant properties
238  inline const typename ParcelType::constantProperties&
239  constProps() const;
240 
241 
242  // Cloud data
243 
244  //- Return the active flag
245  inline const Switch active() const;
246 
247  //- Return the parcel type id
248  inline label parcelTypeId() const;
249 
250  //- Return coupled flag
251  inline const Switch coupled() const;
252 
253  //- Return cell value correction flag
254  inline const Switch cellValueSourceCorrection() const;
255 
256  //- Return refernce to the random object
257  inline Random& rndGen();
258 
259 
260  // References to the carrier gas fields
261 
262  //- Return carrier gas velocity
263  inline const volVectorField& U() const;
264 
265  //- Return carrier gas density
266  inline const volScalarField& rho() const;
267 
268  //- Return carrier gas dynamic viscosity
269  inline const volScalarField& mu() const;
270 
271 
272  // Environmental properties
273 
274  //- Gravity
275  inline const dimensionedVector& g() const;
276 
277 
278  //- Optional particle forces
279  inline const particleForces& forces() const;
280 
281 
282  // Interpolations
283 
284  //- Return reference to the interpolation dictionary
285  inline const dictionary& interpolationSchemes() const;
286 
287 
288  // Sub-models
289 
290  //- Return const-access to the dispersion model
292  dispersion() const;
293 
294  //- Return reference to the dispersion model
296  dispersion();
297 
298  //- Return const-access to the drag model
300  drag() const;
301 
302  //- Return const access to the injection model
304  injection() const;
305 
306  //- Return reference to the injection model
308  injection();
309 
310  //- Return const-access to the patch interaction model
312  patchInteraction() const;
313 
314  //- Return reference to post-processing model
316  postProcessing();
317 
318 
319  // Integration schemes
320 
321  //-Return reference to velocity integration
322  inline const vectorIntegrationScheme& UIntegrator() const;
323 
324 
325  // Sources
326 
327  // Momentum
328 
329  //- Return reference to momentum source
331 
332  //- Return tmp momentum source term - fully explicit
333  inline tmp<DimensionedField<vector, volMesh> > SU() const;
334 
335 
336  // Check
337 
338  //- Total mass injected
339  inline scalar massInjected() const;
340 
341  //- Total mass in system
342  inline scalar massInSystem() const;
343 
344  //- Print cloud information
345  void info() const;
346 
347 
348  // Fields
349 
350  //- Return the particle volume fraction field
351  // Note: for particles belonging to this cloud only
352  inline const tmp<volScalarField> theta() const;
353 
354  //- Return the particle mass fraction field
355  // Note: for particles belonging to this cloud only
356  inline const tmp<volScalarField> alpha() const;
357 
358  //- Return the particle effective density field
359  // Note: for particles belonging to this cloud only
360  inline const tmp<volScalarField> rhoEff() const;
361 
362 
363  // Cloud evolution functions
364 
365  //- Check parcel properties
367  (
368  ParcelType& parcel,
369  const scalar lagrangianDt,
370  const bool fullyDescribed
371  );
372 
373  //- Reset the spray source terms
374  void resetSourceTerms();
375 
376  //- Evolve the spray (inject, inject)
377  void evolve();
378 };
379 
380 
381 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
382 
383 } // End namespace Foam
384 
385 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
386 
387 #include "KinematicCloudI_.H"
388 
389 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
390 
391 #ifdef NoRepository
392 # include "KinematicCloud_.C"
393 #endif
394 
395 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
396 
397 #endif
398 
399 // ************************ vim: set sw=4 sts=4 et: ************************ //