FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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