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

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