initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / Kinematic / InjectionModel / ConeInjection / ConeInjection.H
blob5e6498e3d4cd31d614420da63b3225d47a9724bb
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::ConeInjection
28 Description
29     Cone injection
31     - User specifies
32       - time of start of injection
33       - injector position
34       - direction (along injection axis)
35       - parcel flow rate
36       - parcel velocity
37       - inner and outer cone angles
38     - Parcel diameters obtained by PDF model
40 SourceFiles
41     ConeInjection.C
43 \*---------------------------------------------------------------------------*/
45 #ifndef ConeInjection_H
46 #define ConeInjection_H
48 #include "InjectionModel.H"
49 #include "pdf.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 namespace Foam
56 // Forward declaration of classes
58 template<class Type>
59 class DataEntry;
61 /*---------------------------------------------------------------------------*\
62                        Class ConeInjection Declaration
63 \*---------------------------------------------------------------------------*/
65 template<class CloudType>
66 class ConeInjection
68     public InjectionModel<CloudType>
70     // Private data
72         //- Injection duration [s]
73         const scalar duration_;
75         //- Injector position [m]
76         vector position_;
78         //- Cell containing injector position []
79         label injectorCell_;
81         //- Injector direction []
82         vector direction_;
84         //- Number of parcels to introduce per second []
85         const label parcelsPerSecond_;
87         //- Volume flow rate of parcels to introduce relative to SOI [m^3]
88         const autoPtr<DataEntry<scalar> > volumeFlowRate_;
90         //- Parcel velocity magnitude relative to SOI [m/s]
91         const autoPtr<DataEntry<scalar> > Umag_;
93         //- Inner cone angle relative to SOI [deg]
94         const autoPtr<DataEntry<scalar> > thetaInner_;
96         //- Outer cone angle relative to SOI [deg]
97         const autoPtr<DataEntry<scalar> > thetaOuter_;
99         //- Parcel size PDF model
100         const autoPtr<pdf> parcelPDF_;
103         // Tangential vectors to the direction vector
105             //- First tangential vector
106             vector tanVec1_;
108             //- Second tangential vector
109             vector tanVec2_;
112 protected:
114     // Protected member functions
116         //- Number of parcels to introduce over the time step relative to SOI
117         label parcelsToInject
118         (
119             const scalar time0,
120             const scalar time1
121         ) const;
123         //- Number of parcels to introduce over the time step relative to SOI
124         scalar volumeToInject
125         (
126             const scalar time0,
127             const scalar time1
128         ) const;
131 public:
133     //- Runtime type information
134     TypeName("ConeInjection");
137     // Constructors
139         //- Construct from dictionary
140         ConeInjection
141         (
142             const dictionary& dict,
143             CloudType& owner
144         );
147     //- Destructor
148     virtual ~ConeInjection();
151     // Member Functions
153         //- Flag to indicate whether model activates injection model
154         bool active() const;
156         //- Return the end-of-injection time
157         scalar timeEnd() const;
160         // Injection geometry
162             //- Set the injection position and owner cell
163             virtual void setPositionAndCell
164             (
165                 const label parcelI,
166                 const label nParcels,
167                 const scalar time,
168                 vector& position,
169                 label& cellOwner
170             );
172             //- Set the parcel properties
173             virtual void setProperties
174             (
175                 const label parcelI,
176                 const label nParcels,
177                 const scalar time,
178                 typename CloudType::parcelType& parcel
179             );
181             //- Flag to identify whether model fully describes the parcel
182             virtual bool fullyDescribed() const;
184             //- Return flag to identify whether or not injection of parcelI is
185             //  permitted
186             virtual bool validInjection(const label parcelI);
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 } // End namespace Foam
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 #ifdef NoRepository
197 #   include "ConeInjection.C"
198 #endif
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 #endif
204 // ************************************************************************* //