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

ManualInjection.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::ManualInjection
00027 
00028 Description
00029     Manual injection
00030 
00031     - User specifies
00032       - Total mass to inject
00033       - Parcel positions in file @c positionsFile
00034       - Initial parcel velocity
00035     - Parcel diameters obtained by PDF model
00036     - All parcels introduced at SOI
00037 
00038 SourceFiles
00039     ManualInjection.C
00040 
00041 \*---------------------------------------------------------------------------*/
00042 
00043 #ifndef ManualInjection_H
00044 #define ManualInjection_H
00045 
00046 #include "InjectionModel.H"
00047 #include "pdf.H"
00048 
00049 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00050 
00051 namespace Foam
00052 {
00053 
00054 /*---------------------------------------------------------------------------*\
00055                           Class ManualInjection Declaration
00056 \*---------------------------------------------------------------------------*/
00057 
00058 template<class CloudType>
00059 class ManualInjection
00060 :
00061     public InjectionModel<CloudType>
00062 {
00063     // Private data
00064 
00065         //- Name of file containing positions data
00066         const word positionsFile_;
00067 
00068         //- Field of parcel positions
00069         vectorIOField positions_;
00070 
00071         //- Field of parcel diameters
00072         scalarList diameters_;
00073 
00074         //- Initial parcel velocity
00075         const vector U0_;
00076 
00077         //- Parcel size PDF model
00078         const autoPtr<pdf> parcelPDF_;
00079 
00080         //- Number of particles represented by each parcel
00081         scalar nParticlesPerParcel_;
00082 
00083 
00084 protected:
00085 
00086     // Protected member functions
00087 
00088         //- Number of parcels to introduce over the time step relative to SOI
00089         label parcelsToInject
00090         (
00091             const scalar time0,
00092             const scalar time1
00093         ) const;
00094 
00095         //- Volume of parcels to introduce over the time step relative to SOI
00096         scalar volumeToInject
00097         (
00098             const scalar time0,
00099             const scalar time1
00100         ) const;
00101 
00102 
00103 public:
00104 
00105     //- Runtime type information
00106     TypeName("ManualInjection");
00107 
00108 
00109     // Constructors
00110 
00111         //- Construct from dictionary
00112         ManualInjection
00113         (
00114             const dictionary& dict,
00115             CloudType& owner
00116         );
00117 
00118 
00119     //- Destructor
00120     virtual ~ManualInjection();
00121 
00122 
00123     // Member Functions
00124 
00125         //- Flag to indicate whether model activates injection model
00126         bool active() const;
00127 
00128         //- Return the end-of-injection time
00129         scalar timeEnd() const;
00130 
00131 
00132         // Injection geometry
00133 
00134             //- Set the injection position and owner cell
00135             virtual void setPositionAndCell
00136             (
00137                 const label parcelI,
00138                 const label nParcels,
00139                 const scalar time,
00140                 vector& position,
00141                 label& cellOwner
00142             );
00143 
00144             //- Set the parcel properties
00145             virtual void setProperties
00146             (
00147                 const label parcelI,
00148                 const label nParcels,
00149                 const scalar time,
00150                 typename CloudType::parcelType& parcel
00151             );
00152 
00153             //- Flag to identify whether model fully describes the parcel
00154             virtual bool fullyDescribed() const;
00155 
00156             //- Return flag to identify whether or not injection of parcelI is
00157             //  permitted
00158             virtual bool validInjection(const label parcelI);
00159 };
00160 
00161 
00162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00163 
00164 } // End namespace Foam
00165 
00166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00167 
00168 #ifdef NoRepository
00169 #   include "ManualInjection.C"
00170 #endif
00171 
00172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00173 
00174 #endif
00175 
00176 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd