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

ConeInjectionMP.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) 2008-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::ConeInjectionMP
00026 
00027 Description
00028     Cone injection multi-point
00029 
00030     - User specifies
00031       - time of start of injection
00032       - injector positions
00033       - directions (along injection axes)
00034       - parcel flow rate
00035       - parcel velocities
00036       - inner and outer cone angles
00037     - Parcel diameters obtained by PDF model
00038 
00039 SourceFiles
00040     ConeInjectionMP.C
00041 
00042 \*---------------------------------------------------------------------------*/
00043 
00044 #ifndef ConeInjectionMP_H
00045 #define ConeInjectionMP_H
00046 
00047 #include <lagrangianIntermediate/InjectionModel.H>
00048 #include <pdf/pdf.H>
00049 #include <OpenFOAM/vectorList.H>
00050 
00051 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00052 
00053 namespace Foam
00054 {
00055 
00056 // Forward declaration of classes
00057 
00058 template<class Type>
00059 class DataEntry;
00060 
00061 /*---------------------------------------------------------------------------*\
00062                        Class ConeInjectionMP Declaration
00063 \*---------------------------------------------------------------------------*/
00064 
00065 template<class CloudType>
00066 class ConeInjectionMP
00067 :
00068     public InjectionModel<CloudType>
00069 {
00070     // Private data
00071 
00072         //- Name of file containing positions data
00073         const word positionsFile_;
00074 
00075         //- Field of injector positions
00076         vectorIOField positions_;
00077 
00078         //- Field of cell labels corresoponding to injector positions
00079         labelList injectorCells_;
00080 
00081         //- Name of file containing axes data
00082         const word axesFile_;
00083 
00084         //- Field of injector positions
00085         vectorIOField axes_;
00086 
00087         //- Injection duration [s]
00088         const scalar duration_;
00089 
00090         //- Number of parcels to introduce per injector
00091         const label parcelsPerInjector_;
00092 
00093         //- Volume flow rate of parcels to introduce relative to SOI [m^3]
00094         const autoPtr<DataEntry<scalar> > volumeFlowRate_;
00095 
00096         //- Parcel velocity magnitude relative to SOI [m/s]
00097         const autoPtr<DataEntry<scalar> > Umag_;
00098 
00099         //- Inner cone angle relative to SOI [deg]
00100         const autoPtr<DataEntry<scalar> > thetaInner_;
00101 
00102         //- Outer cone angle relative to SOI [deg]
00103         const autoPtr<DataEntry<scalar> > thetaOuter_;
00104 
00105         //- Parcel size PDF model
00106         const autoPtr<pdfs::pdf> parcelPDF_;
00107 
00108         //- Number of parcels per injector already injected
00109         mutable label nInjected_;
00110 
00111 
00112         // Tangential vectors to the direction vector
00113 
00114             //- First tangential vector
00115             vectorList tanVec1_;
00116 
00117             //- Second tangential vector
00118             vectorList tanVec2_;
00119 
00120 
00121 protected:
00122 
00123     // Protected member functions
00124 
00125         //- Number of parcels to introduce over the time step
00126         label parcelsToInject
00127         (
00128             const scalar time0,
00129             const scalar time1
00130         ) const;
00131 
00132         //- Number of parcels to introduce over the time step
00133         scalar volumeToInject
00134         (
00135             const scalar time0,
00136             const scalar time1
00137         ) const;
00138 
00139 
00140 public:
00141 
00142     //- Runtime type information
00143     TypeName("ConeInjectionMP");
00144 
00145 
00146     // Constructors
00147 
00148         //- Construct from dictionary
00149         ConeInjectionMP
00150         (
00151             const dictionary& dict,
00152             CloudType& owner
00153         );
00154 
00155 
00156     //- Destructor
00157     virtual ~ConeInjectionMP();
00158 
00159 
00160     // Member Functions
00161 
00162         //- Flag to indicate whether model activates injection model
00163         bool active() const;
00164 
00165         //- Return the end-of-injection time
00166         scalar timeEnd() const;
00167 
00168 
00169         // Injection geometry
00170 
00171             //- Set the injection position and owner cell
00172             virtual void setPositionAndCell
00173             (
00174                 const label parcelI,
00175                 const label nParcels,
00176                 const scalar time,
00177                 vector& position,
00178                 label& cellOwner
00179             );
00180 
00181             //- Set the parcel properties
00182             virtual void setProperties
00183             (
00184                 const label parcelI,
00185                 const label nParcels,
00186                 const scalar time,
00187                 typename CloudType::parcelType& parcel
00188             );
00189 
00190             //- Flag to identify whether model fully describes the parcel
00191             virtual bool fullyDescribed() const;
00192 
00193             //- Return flag to identify whether or not injection of parcelI is
00194             //  permitted
00195             virtual bool validInjection(const label parcelI);
00196 };
00197 
00198 
00199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00200 
00201 } // End namespace Foam
00202 
00203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00204 
00205 #ifdef NoRepository
00206 #   include "ConeInjectionMP.C"
00207 #endif
00208 
00209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00210 
00211 #endif
00212 
00213 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines