fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / lagrangian / intermediate / clouds / Templates / KinematicCloud / KinematicCloud.H
blob254a223b40b5a239459dcaab79bd1582f8303492
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
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         //- Cloud active flag
113         const Switch active_;
115         //- Parcel type id - used to flag the type of parcels issued by this
116         //  cloud
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
128         Random rndGen_;
131         // References to the carrier gas fields
133             //- Density
134             const volScalarField& rho_;
136             //- Velocity
137             const volVectorField& U_;
139             //- Dynamic viscosity
140             const volScalarField& mu_;
143         // Environmental properties
145             //- Gravity
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
158             //- Dispersion model
159             autoPtr<DispersionModel<KinematicCloud<ParcelType> > >
160                 dispersionModel_;
162             //- Drag transfer model
163             autoPtr<DragModel<KinematicCloud<ParcelType> > > dragModel_;
165             //- Injector model
166             autoPtr<InjectionModel<KinematicCloud<ParcelType> > >
167                 injectionModel_;
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_;
184         // Sources
186             //- Momentum
187             DimensionedField<vector, volMesh> UTrans_;
190         // Cloud evolution functions
192             //- Pre-evolve
193             void preEvolve();
195             //- Evolve the cloud
196             void evolveCloud();
198             //- Post-evolve
199             void postEvolve();
202 public:
204     // Constructors
206         //- Construct given carrier gas fields
207         KinematicCloud
208         (
209             const word& cloudName,
210             const volScalarField& rho,
211             const volVectorField& U,
212             const volScalarField& mu,
213             const dimensionedVector& g,
214             bool readFields = true
215         );
218     //- Destructor
219     virtual ~KinematicCloud();
222     //- Type of parcel the cloud was instantiated for
223     typedef ParcelType parcelType;
226     // Member Functions
228         // Access
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&
240                     constProps() const;
243             // Cloud data
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
275                 //- Gravity
276                 inline const dimensionedVector& g() const;
279             //- Optional particle forces
280             inline const particleForces& forces() const;
283             // Interpolations
285                 //- Return reference to the interpolation dictionary
286                 inline const dictionary& interpolationSchemes() const;
289             // Sub-models
291                 //- Return const-access to the dispersion model
292                 inline const DispersionModel<KinematicCloud<ParcelType> >&
293                     dispersion() const;
295                 //- Return reference to the dispersion model
296                 inline DispersionModel<KinematicCloud<ParcelType> >&
297                     dispersion();
299                 //- Return const-access to the drag model
300                 inline const DragModel<KinematicCloud<ParcelType> >&
301                     drag() const;
303                 //- Return const access to the injection model
304                 inline const InjectionModel<KinematicCloud<ParcelType> >&
305                     injection() const;
307                 //- Return reference to the injection model
308                 inline InjectionModel<KinematicCloud<ParcelType> >&
309                     injection();
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> >&
317                     postProcessing();
320             // Integration schemes
322                 //-Return reference to velocity integration
323                 inline const vectorIntegrationScheme& UIntegrator() const;
326             // Sources
328                 // Momentum
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;
337         // Check
339             //- Total mass injected
340             inline scalar massInjected() const;
342             //- Total mass in system
343             inline scalar massInSystem() const;
345             //- Print cloud information
346             void info() const;
349             // Fields
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
368             (
369                 ParcelType& parcel,
370                 const scalar lagrangianDt,
371                 const bool fullyDescribed
372             );
374             //- Reset the spray source terms
375             void resetSourceTerms();
377             //- Evolve the spray (inject, inject)
378             void evolve();
382 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
384 } // End namespace Foam
386 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
388 #include "KinematicCloudI.H"
390 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
392 #ifdef NoRepository
393 #   include "KinematicCloud.C"
394 #endif
396 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
398 #endif
400 // ************************************************************************* //