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 Templated base class for kinematic cloud
35 - Wall interaction model
41 \*---------------------------------------------------------------------------*/
43 #ifndef KinematicCloud_H
44 #define KinematicCloud_H
47 #include "kinematicCloud.H"
48 #include "IOdictionary.H"
52 #include "volFields.H"
53 #include "fvMatrices.H"
54 #include "particleForces.H"
56 #include "IntegrationSchemesFwd.H"
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 // Forward declaration of classes
65 template<class CloudType>
66 class DispersionModel;
68 template<class CloudType>
71 template<class CloudType>
74 template<class CloudType>
75 class PostProcessingModel;
77 template<class CloudType>
78 class PatchInteractionModel;
80 /*---------------------------------------------------------------------------*\
81 Class KinematicCloud Declaration
82 \*---------------------------------------------------------------------------*/
84 template<class ParcelType>
87 public Cloud<ParcelType>,
90 // Private Member Functions
92 //- Disallow default bitwise copy construct
93 KinematicCloud(const KinematicCloud&);
95 //- Disallow default bitwise assignment
96 void operator=(const KinematicCloud&);
103 //- References to the mesh and time databases
106 //- Dictionary of particle properties
107 IOdictionary particleProperties_;
109 //- Parcel constant properties
110 typename ParcelType::constantProperties constProps_;
112 //- Cloud active flag
113 const Switch active_;
115 //- Parcel type id - used to flag the type of parcels issued by this
117 const label parcelTypeId_;
119 //- Flag to indicate whether parcels are coupled to the carrier phase
120 // i.e. whether or not to generate source terms for carrier phase
121 const Switch coupled_;
123 //- Flag to correct cell values with latest transfer information
124 // during the lagrangian timestep
125 const Switch cellValueSourceCorrection_;
127 //- Random number generator - used by some injection routines
131 // References to the carrier gas fields
134 const volScalarField& rho_;
137 const volVectorField& U_;
139 //- Dynamic viscosity
140 const volScalarField& mu_;
143 // Environmental properties
146 const dimensionedVector& g_;
149 //- Optional particle forces
150 particleForces forces_;
152 //- Interpolation schemes dictionary
153 dictionary interpolationSchemes_;
156 // References to the cloud sub-models
159 autoPtr<DispersionModel<KinematicCloud<ParcelType> > >
162 //- Drag transfer model
163 autoPtr<DragModel<KinematicCloud<ParcelType> > > dragModel_;
166 autoPtr<InjectionModel<KinematicCloud<ParcelType> > >
169 //- Patch interaction model
170 autoPtr<PatchInteractionModel<KinematicCloud<ParcelType> > >
171 patchInteractionModel_;
173 //- Post-processing model
174 autoPtr<PostProcessingModel<KinematicCloud<ParcelType> > >
175 postProcessingModel_;
178 // Reference to the particle integration schemes
180 //- Velocity integration
181 autoPtr<vectorIntegrationScheme> UIntegrator_;
187 DimensionedField<vector, volMesh> UTrans_;
190 // Cloud evolution functions
206 //- Construct given carrier gas fields
209 const word& cloudName,
210 const volScalarField& rho,
211 const volVectorField& U,
212 const volScalarField& mu,
213 const dimensionedVector& g,
214 bool readFields = true
219 virtual ~KinematicCloud();
222 //- Type of parcel the cloud was instantiated for
223 typedef ParcelType parcelType;
230 // References to the mesh and databases
232 //- Return refernce to the mesh
233 inline const fvMesh& mesh() const;
235 //- Return particle properties dictionary
236 inline const IOdictionary& particleProperties() const;
238 //- Return the constant properties
239 inline const typename ParcelType::constantProperties&
245 //- Return the active flag
246 inline const Switch active() const;
248 //- Return the parcel type id
249 inline label parcelTypeId() const;
251 //- Return coupled flag
252 inline const Switch coupled() const;
254 //- Return cell value correction flag
255 inline const Switch cellValueSourceCorrection() const;
257 //- Return refernce to the random object
258 inline Random& rndGen();
261 // References to the carrier gas fields
263 //- Return carrier gas velocity
264 inline const volVectorField& U() const;
266 //- Return carrier gas density
267 inline const volScalarField& rho() const;
269 //- Return carrier gas dynamic viscosity
270 inline const volScalarField& mu() const;
273 // Environmental properties
276 inline const dimensionedVector& g() const;
279 //- Optional particle forces
280 inline const particleForces& forces() const;
285 //- Return reference to the interpolation dictionary
286 inline const dictionary& interpolationSchemes() const;
291 //- Return const-access to the dispersion model
292 inline const DispersionModel<KinematicCloud<ParcelType> >&
295 //- Return reference to the dispersion model
296 inline DispersionModel<KinematicCloud<ParcelType> >&
299 //- Return const-access to the drag model
300 inline const DragModel<KinematicCloud<ParcelType> >&
303 //- Return const access to the injection model
304 inline const InjectionModel<KinematicCloud<ParcelType> >&
307 //- Return reference to the injection model
308 inline InjectionModel<KinematicCloud<ParcelType> >&
311 //- Return const-access to the patch interaction model
312 inline const PatchInteractionModel<KinematicCloud<ParcelType> >&
313 patchInteraction() const;
315 //- Return reference to post-processing model
316 inline PostProcessingModel<KinematicCloud<ParcelType> >&
320 // Integration schemes
322 //-Return reference to velocity integration
323 inline const vectorIntegrationScheme& UIntegrator() const;
330 //- Return reference to momentum source
331 inline DimensionedField<vector, volMesh>& UTrans();
333 //- Return tmp momentum source term - fully explicit
334 inline tmp<DimensionedField<vector, volMesh> > SU() const;
339 //- Total mass injected
340 inline scalar massInjected() const;
342 //- Total mass in system
343 inline scalar massInSystem() const;
345 //- Print cloud information
351 //- Return the particle volume fraction field
352 // Note: for particles belonging to this cloud only
353 inline const tmp<volScalarField> theta() const;
355 //- Return the particle mass fraction field
356 // Note: for particles belonging to this cloud only
357 inline const tmp<volScalarField> alpha() const;
359 //- Return the particle effective density field
360 // Note: for particles belonging to this cloud only
361 inline const tmp<volScalarField> rhoEff() const;
364 // Cloud evolution functions
366 //- Check parcel properties
367 void checkParcelProperties
370 const scalar lagrangianDt,
371 const bool fullyDescribed
374 //- Reset the spray source terms
375 void resetSourceTerms();
377 //- Evolve the spray (inject, inject)
382 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
384 } // End namespace Foam
386 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
388 #include "KinematicCloudI.H"
390 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
393 # include "KinematicCloud.C"
396 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
400 // ************************************************************************* //