initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / clouds / Templates / KinematicCloud / KinematicCloud.H
blobee2b3bafe2c2329048734b33fcd99d6154316a83
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::KinematicCloud
28 Description
29     Templated base class for kinematic cloud
31     - Kinematic only
32       - Dispersion model
33       - Drag model
34       - Injection model
35       - Wall interaction model
37 SourceFiles
38     KinematicCloudI.H
39     KinematicCloud.C
41 \*---------------------------------------------------------------------------*/
43 #ifndef KinematicCloud_H
44 #define KinematicCloud_H
46 #include "Cloud.H"
47 #include "kinematicCloud.H"
48 #include "IOdictionary.H"
49 #include "autoPtr.H"
50 #include "Random.H"
51 #include "fvMesh.H"
52 #include "volFields.H"
53 #include "fvMatrices.H"
54 #include "particleForces.H"
56 #include "IntegrationSchemesFwd.H"
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 namespace Foam
63 // Forward declaration of classes
65 template<class CloudType>
66 class DispersionModel;
68 template<class CloudType>
69 class DragModel;
71 template<class CloudType>
72 class InjectionModel;
74 template<class CloudType>
75 class PostProcessingModel;
77 template<class CloudType>
78 class PatchInteractionModel;
80 /*---------------------------------------------------------------------------*\
81                        Class KinematicCloud Declaration
82 \*---------------------------------------------------------------------------*/
84 template<class ParcelType>
85 class KinematicCloud
87     public Cloud<ParcelType>,
88     public kinematicCloud
90     // Private Member Functions
92         //- Disallow default bitwise copy construct
93         KinematicCloud(const KinematicCloud&);
95         //- Disallow default bitwise assignment
96         void operator=(const KinematicCloud&);
99 protected:
101     // Protected data
103         //- References to the mesh and time databases
104         const fvMesh& mesh_;
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
113         //  cloud
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
125         Random rndGen_;
128         // References to the carrier gas fields
130             //- Density
131             const volScalarField& rho_;
133             //- Velocity
134             const volVectorField& U_;
136             //- Dynamic viscosity
137             const volScalarField& mu_;
140         // Environmental properties
142             //- Gravity
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
155             //- Dispersion model
156             autoPtr<DispersionModel<KinematicCloud<ParcelType> > >
157                 dispersionModel_;
159             //- Drag transfer model
160             autoPtr<DragModel<KinematicCloud<ParcelType> > > dragModel_;
162             //- Injector model
163             autoPtr<InjectionModel<KinematicCloud<ParcelType> > >
164                 injectionModel_;
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_;
181         // Sources
183             //- Momentum
184             DimensionedField<vector, volMesh> UTrans_;
187         // Cloud evolution functions
189             //- Pre-evolve
190             void preEvolve();
192             //- Post-evolve
193             void postEvolve();
196 public:
198     // Constructors
200         //- Construct given carrier gas fields
201         KinematicCloud
202         (
203             const word& cloudName,
204             const volScalarField& rho,
205             const volVectorField& U,
206             const volScalarField& mu,
207             const dimensionedVector& g
208         );
211     //- Destructor
212     virtual ~KinematicCloud();
215     //- Type of parcel the cloud was instantiated for
216     typedef ParcelType parcelType;
219     // Member Functions
221         // Access
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&
236                     constProps() const;
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
263                 //- Gravity
264                 inline const dimensionedVector& g() const;
267             //- Optional particle forces
268             inline const particleForces& forces() const;
271             // Interpolations
273                 //- Return reference to the interpolation dictionary
274                 inline const dictionary& interpolationSchemes() const;
277             // Sub-models
279                 //- Return const-access to the dispersion model
280                 inline const DispersionModel<KinematicCloud<ParcelType> >&
281                     dispersion() const;
283                 //- Return reference to the dispersion model
284                 inline DispersionModel<KinematicCloud<ParcelType> >&
285                     dispersion();
287                 //- Return const-access to the drag model
288                 inline const DragModel<KinematicCloud<ParcelType> >&
289                     drag() const;
291                 //- Return const access to the injection model
292                 inline const InjectionModel<KinematicCloud<ParcelType> >&
293                     injection() const;
295                 //- Return reference to the injection model
296                 inline InjectionModel<KinematicCloud<ParcelType> >&
297                     injection();
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> >&
305                     postProcessing();
308             // Integration schemes
310                 //-Return reference to velocity integration
311                 inline const vectorIntegrationScheme& UIntegrator() const;
314             // Sources
316                 // Momentum
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;
325         // Check
327             //- Total mass injected
328             inline scalar massInjected() const;
330             //- Total mass in system
331             inline scalar massInSystem() const;
333             //- Print cloud information
334             void info() const;
337             // Fields
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
356             (
357                 ParcelType& parcel,
358                 const scalar lagrangianDt,
359                 const bool fullyDescribed
360             );
362             //- Reset the spray source terms
363             void resetSourceTerms();
365             //- Evolve the spray (inject, inject)
366             void evolve();
370 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
372 } // End namespace Foam
374 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
376 #include "KinematicCloudI.H"
378 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
380 #ifdef NoRepository
381 #   include "KinematicCloud.C"
382 #endif
384 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
386 #endif
388 // ************************************************************************* //