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

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