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

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