OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

KinematicCloud.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::KinematicCloud
00027 
00028 Description
00029     Templated base class for kinematic cloud
00030 
00031     - Kinematic only
00032       - Dispersion model
00033       - Drag model
00034       - Injection model
00035       - Wall interaction model
00036 
00037 SourceFiles
00038     KinematicCloudI.H
00039     KinematicCloud.C
00040 
00041 \*---------------------------------------------------------------------------*/
00042 
00043 #ifndef KinematicCloud_H
00044 #define KinematicCloud_H
00045 
00046 #include "Cloud.H"
00047 #include "kinematicCloud.H"
00048 #include "IOdictionary.H"
00049 #include "autoPtr.H"
00050 #include "Random.H"
00051 #include "fvMesh.H"
00052 #include "volFields.H"
00053 #include "fvMatrices.H"
00054 #include "particleForces.H"
00055 
00056 #include "IntegrationSchemesFwd.H"
00057 
00058 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00059 
00060 namespace Foam
00061 {
00062 
00063 // Forward declaration of classes
00064 
00065 template<class CloudType>
00066 class DispersionModel;
00067 
00068 template<class CloudType>
00069 class DragModel;
00070 
00071 template<class CloudType>
00072 class InjectionModel;
00073 
00074 template<class CloudType>
00075 class PostProcessingModel;
00076 
00077 template<class CloudType>
00078 class PatchInteractionModel;
00079 
00080 /*---------------------------------------------------------------------------*\
00081                        Class KinematicCloud Declaration
00082 \*---------------------------------------------------------------------------*/
00083 
00084 template<class ParcelType>
00085 class KinematicCloud
00086 :
00087     public Cloud<ParcelType>,
00088     public kinematicCloud
00089 {
00090     // Private Member Functions
00091 
00092         //- Disallow default bitwise copy construct
00093         KinematicCloud(const KinematicCloud&);
00094 
00095         //- Disallow default bitwise assignment
00096         void operator=(const KinematicCloud&);
00097 
00098 
00099 protected:
00100 
00101     // Protected data
00102 
00103         //- References to the mesh and time databases
00104         const fvMesh& mesh_;
00105 
00106         //- Dictionary of particle properties
00107         IOdictionary particleProperties_;
00108 
00109         //- Parcel constant properties
00110         typename ParcelType::constantProperties constProps_;
00111 
00112         //- Parcel type id - used to flag the type of parcels issued by this
00113         //  cloud
00114         const label parcelTypeId_;
00115 
00116         //- Flag to indicate whether parcels are coupled to the carrier phase
00117         //  i.e. whether or not to generate source terms for carrier phase
00118         const Switch coupled_;
00119 
00120         //- Flag to correct cell values with latest transfer information
00121         //  during the lagrangian timestep
00122         const Switch cellValueSourceCorrection_;
00123 
00124         //- Random number generator - used by some injection routines
00125         Random rndGen_;
00126 
00127 
00128         // References to the carrier gas fields
00129 
00130             //- Density
00131             const volScalarField& rho_;
00132 
00133             //- Velocity
00134             const volVectorField& U_;
00135 
00136             //- Dynamic viscosity
00137             const volScalarField& mu_;
00138 
00139 
00140         // Environmental properties
00141 
00142             //- Gravity
00143             const dimensionedVector& g_;
00144 
00145 
00146         //- Optional particle forces
00147         particleForces forces_;
00148 
00149         //- Interpolation schemes dictionary
00150         dictionary interpolationSchemes_;
00151 
00152 
00153         // References to the cloud sub-models
00154 
00155             //- Dispersion model
00156             autoPtr<DispersionModel<KinematicCloud<ParcelType> > >
00157                 dispersionModel_;
00158 
00159             //- Drag transfer model
00160             autoPtr<DragModel<KinematicCloud<ParcelType> > > dragModel_;
00161 
00162             //- Injector model
00163             autoPtr<InjectionModel<KinematicCloud<ParcelType> > >
00164                 injectionModel_;
00165 
00166             //- Patch interaction model
00167             autoPtr<PatchInteractionModel<KinematicCloud<ParcelType> > >
00168                 patchInteractionModel_;
00169 
00170             //- Post-processing model
00171             autoPtr<PostProcessingModel<KinematicCloud<ParcelType> > >
00172                 postProcessingModel_;
00173 
00174 
00175         // Reference to the particle integration schemes
00176 
00177             //- Velocity integration
00178             autoPtr<vectorIntegrationScheme> UIntegrator_;
00179 
00180 
00181         // Sources
00182 
00183             //- Momentum
00184             DimensionedField<vector, volMesh> UTrans_;
00185 
00186 
00187         // Cloud evolution functions
00188 
00189             //- Pre-evolve
00190             void preEvolve();
00191 
00192             //- Post-evolve
00193             void postEvolve();
00194 
00195 
00196 public:
00197 
00198     // Constructors
00199 
00200         //- Construct given carrier gas fields
00201         KinematicCloud
00202         (
00203             const word& cloudName,
00204             const volScalarField& rho,
00205             const volVectorField& U,
00206             const volScalarField& mu,
00207             const dimensionedVector& g
00208         );
00209 
00210 
00211     //- Destructor
00212     virtual ~KinematicCloud();
00213 
00214 
00215     //- Type of parcel the cloud was instantiated for
00216     typedef ParcelType parcelType;
00217 
00218 
00219     // Member Functions
00220 
00221         // Access
00222 
00223             // References to the mesh and databases
00224 
00225                 //- Return the parcel type id
00226                 inline label parcelTypeId() const;
00227 
00228                 //- Return refernce to the mesh
00229                 inline const fvMesh& mesh() const;
00230 
00231                 //- Return particle properties dictionary
00232                 inline const IOdictionary& particleProperties() const;
00233 
00234                 //- Return the constant properties
00235                 inline const typename ParcelType::constantProperties&
00236                     constProps() const;
00237 
00238 
00239             //- Return coupled flag
00240             inline const Switch coupled() const;
00241 
00242             //- Return cell value correction flag
00243             inline const Switch cellValueSourceCorrection() const;
00244 
00245             //- Return refernce to the random object
00246             inline Random& rndGen();
00247 
00248 
00249             // References to the carrier gas fields
00250 
00251                 //- Return carrier gas velocity
00252                 inline const volVectorField& U() const;
00253 
00254                 //- Return carrier gas density
00255                 inline const volScalarField& rho() const;
00256 
00257                 //- Return carrier gas dynamic viscosity
00258                 inline const volScalarField& mu() const;
00259 
00260 
00261             // Environmental properties
00262 
00263                 //- Gravity
00264                 inline const dimensionedVector& g() const;
00265 
00266 
00267             //- Optional particle forces
00268             inline const particleForces& forces() const;
00269 
00270 
00271             // Interpolations
00272 
00273                 //- Return reference to the interpolation dictionary
00274                 inline const dictionary& interpolationSchemes() const;
00275 
00276 
00277             // Sub-models
00278 
00279                 //- Return const-access to the dispersion model
00280                 inline const DispersionModel<KinematicCloud<ParcelType> >&
00281                     dispersion() const;
00282 
00283                 //- Return reference to the dispersion model
00284                 inline DispersionModel<KinematicCloud<ParcelType> >&
00285                     dispersion();
00286 
00287                 //- Return const-access to the drag model
00288                 inline const DragModel<KinematicCloud<ParcelType> >&
00289                     drag() const;
00290 
00291                 //- Return const access to the injection model
00292                 inline const InjectionModel<KinematicCloud<ParcelType> >&
00293                     injection() const;
00294 
00295                 //- Return reference to the injection model
00296                 inline InjectionModel<KinematicCloud<ParcelType> >&
00297                     injection();
00298 
00299                 //- Return const-access to the patch interaction model
00300                 inline const PatchInteractionModel<KinematicCloud<ParcelType> >&
00301                     patchInteraction() const;
00302 
00303                 //- Return reference to post-processing model
00304                 inline PostProcessingModel<KinematicCloud<ParcelType> >&
00305                     postProcessing();
00306 
00307 
00308             // Integration schemes
00309 
00310                 //-Return reference to velocity integration
00311                 inline const vectorIntegrationScheme& UIntegrator() const;
00312 
00313 
00314             // Sources
00315 
00316                 // Momentum
00317 
00318                     //- Return reference to momentum source
00319                     inline DimensionedField<vector, volMesh>& UTrans();
00320 
00321                     //- Return tmp momentum source term - fully explicit
00322                     inline tmp<DimensionedField<vector, volMesh> > SU() const;
00323 
00324 
00325         // Check
00326 
00327             //- Total mass injected
00328             inline scalar massInjected() const;
00329 
00330             //- Total mass in system
00331             inline scalar massInSystem() const;
00332 
00333             //- Print cloud information
00334             void info() const;
00335 
00336 
00337             // Fields
00338 
00339                 //- Return the particle volume fraction field
00340                 //  Note: for particles belonging to this cloud only
00341                 inline const tmp<volScalarField> theta() const;
00342 
00343                 //- Return the particle mass fraction field
00344                 //  Note: for particles belonging to this cloud only
00345                 inline const tmp<volScalarField> alpha() const;
00346 
00347                 //- Return the particle effective density field
00348                 //  Note: for particles belonging to this cloud only
00349                 inline const tmp<volScalarField> rhoEff() const;
00350 
00351 
00352         // Cloud evolution functions
00353 
00354             //- Check parcel properties
00355             void checkParcelProperties
00356             (
00357                 ParcelType& parcel,
00358                 const scalar lagrangianDt,
00359                 const bool fullyDescribed
00360             );
00361 
00362             //- Reset the spray source terms
00363             void resetSourceTerms();
00364 
00365             //- Evolve the spray (inject, inject)
00366             void evolve();
00367 };
00368 
00369 
00370 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00371 
00372 } // End namespace Foam
00373 
00374 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00375 
00376 #include "KinematicCloudI.H"
00377 
00378 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00379 
00380 #ifdef NoRepository
00381 #   include "KinematicCloud.C"
00382 #endif
00383 
00384 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00385 
00386 #endif
00387 
00388 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd