1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 //- Parcel type id - used to flag the type of parcels issued by this
114 const label parcelTypeId_;
116 //- Flag to indicate whether parcels are coupled to the carrier phase
117 // i.e. whether or not to generate source terms for carrier phase
118 const Switch coupled_;
120 //- Flag to correct cell values with latest transfer information
121 // during the lagrangian timestep
122 const Switch cellValueSourceCorrection_;
124 //- Random number generator - used by some injection routines
128 // References to the carrier gas fields
131 const volScalarField& rho_;
134 const volVectorField& U_;
136 //- Dynamic viscosity
137 const volScalarField& mu_;
140 // Environmental properties
143 const dimensionedVector& g_;
146 //- Optional particle forces
147 particleForces forces_;
149 //- Interpolation schemes dictionary
150 dictionary interpolationSchemes_;
153 // References to the cloud sub-models
156 autoPtr<DispersionModel<KinematicCloud<ParcelType> > >
159 //- Drag transfer model
160 autoPtr<DragModel<KinematicCloud<ParcelType> > > dragModel_;
163 autoPtr<InjectionModel<KinematicCloud<ParcelType> > >
166 //- Patch interaction model
167 autoPtr<PatchInteractionModel<KinematicCloud<ParcelType> > >
168 patchInteractionModel_;
170 //- Post-processing model
171 autoPtr<PostProcessingModel<KinematicCloud<ParcelType> > >
172 postProcessingModel_;
175 // Reference to the particle integration schemes
177 //- Velocity integration
178 autoPtr<vectorIntegrationScheme> UIntegrator_;
184 DimensionedField<vector, volMesh> UTrans_;
187 // Cloud evolution functions
200 //- Construct given carrier gas fields
203 const word& cloudName,
204 const volScalarField& rho,
205 const volVectorField& U,
206 const volScalarField& mu,
207 const dimensionedVector& g
212 virtual ~KinematicCloud();
215 //- Type of parcel the cloud was instantiated for
216 typedef ParcelType parcelType;
223 // References to the mesh and databases
225 //- Return the parcel type id
226 inline label parcelTypeId() const;
228 //- Return refernce to the mesh
229 inline const fvMesh& mesh() const;
231 //- Return particle properties dictionary
232 inline const IOdictionary& particleProperties() const;
234 //- Return the constant properties
235 inline const typename ParcelType::constantProperties&
239 //- Return coupled flag
240 inline const Switch coupled() const;
242 //- Return cell value correction flag
243 inline const Switch cellValueSourceCorrection() const;
245 //- Return refernce to the random object
246 inline Random& rndGen();
249 // References to the carrier gas fields
251 //- Return carrier gas velocity
252 inline const volVectorField& U() const;
254 //- Return carrier gas density
255 inline const volScalarField& rho() const;
257 //- Return carrier gas dynamic viscosity
258 inline const volScalarField& mu() const;
261 // Environmental properties
264 inline const dimensionedVector& g() const;
267 //- Optional particle forces
268 inline const particleForces& forces() const;
273 //- Return reference to the interpolation dictionary
274 inline const dictionary& interpolationSchemes() const;
279 //- Return const-access to the dispersion model
280 inline const DispersionModel<KinematicCloud<ParcelType> >&
283 //- Return reference to the dispersion model
284 inline DispersionModel<KinematicCloud<ParcelType> >&
287 //- Return const-access to the drag model
288 inline const DragModel<KinematicCloud<ParcelType> >&
291 //- Return const access to the injection model
292 inline const InjectionModel<KinematicCloud<ParcelType> >&
295 //- Return reference to the injection model
296 inline InjectionModel<KinematicCloud<ParcelType> >&
299 //- Return const-access to the patch interaction model
300 inline const PatchInteractionModel<KinematicCloud<ParcelType> >&
301 patchInteraction() const;
303 //- Return reference to post-processing model
304 inline PostProcessingModel<KinematicCloud<ParcelType> >&
308 // Integration schemes
310 //-Return reference to velocity integration
311 inline const vectorIntegrationScheme& UIntegrator() const;
318 //- Return reference to momentum source
319 inline DimensionedField<vector, volMesh>& UTrans();
321 //- Return tmp momentum source term - fully explicit
322 inline tmp<DimensionedField<vector, volMesh> > SU() const;
327 //- Total mass injected
328 inline scalar massInjected() const;
330 //- Total mass in system
331 inline scalar massInSystem() const;
333 //- Print cloud information
339 //- Return the particle volume fraction field
340 // Note: for particles belonging to this cloud only
341 inline const tmp<volScalarField> theta() const;
343 //- Return the particle mass fraction field
344 // Note: for particles belonging to this cloud only
345 inline const tmp<volScalarField> alpha() const;
347 //- Return the particle effective density field
348 // Note: for particles belonging to this cloud only
349 inline const tmp<volScalarField> rhoEff() const;
352 // Cloud evolution functions
354 //- Check parcel properties
355 void checkParcelProperties
358 const scalar lagrangianDt,
359 const bool fullyDescribed
362 //- Reset the spray source terms
363 void resetSourceTerms();
365 //- Evolve the spray (inject, inject)
370 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
372 } // End namespace Foam
374 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
376 #include "KinematicCloudI.H"
378 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
381 # include "KinematicCloud.C"
384 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
388 // ************************************************************************* //