initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / Kinematic / InjectionModel / ConeInjectionMP / ConeInjectionMP.H
blob238d0463ef959f4a346eee1b57cf802abaa91ed9
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2008-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::ConeInjectionMP
28 Description
29     Cone injection multi-point
31     - User specifies
32       - time of start of injection
33       - injector positions
34       - directions (along injection axes)
35       - parcel flow rate
36       - parcel velocities
37       - inner and outer cone angles
38     - Parcel diameters obtained by PDF model
40 SourceFiles
41     ConeInjectionMP.C
43 \*---------------------------------------------------------------------------*/
45 #ifndef ConeInjectionMP_H
46 #define ConeInjectionMP_H
48 #include "InjectionModel.H"
49 #include "pdf.H"
50 #include "vectorList.H"
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 namespace Foam
57 // Forward declaration of classes
59 template<class Type>
60 class DataEntry;
62 /*---------------------------------------------------------------------------*\
63                        Class ConeInjectionMP Declaration
64 \*---------------------------------------------------------------------------*/
66 template<class CloudType>
67 class ConeInjectionMP
69     public InjectionModel<CloudType>
71     // Private data
73         //- Name of file containing positions data
74         const word positionsFile_;
76         //- Field of injector positions
77         vectorIOField positions_;
79         //- Field of cell labels corresoponding to injector positions
80         labelList injectorCells_;
82         //- Name of file containing axes data
83         const word axesFile_;
85         //- Field of injector positions
86         vectorIOField axes_;
88         //- Injection duration [s]
89         const scalar duration_;
91         //- Number of parcels to introduce per injector
92         const label parcelsPerInjector_;
94         //- Volume flow rate of parcels to introduce relative to SOI [m^3]
95         const autoPtr<DataEntry<scalar> > volumeFlowRate_;
97         //- Parcel velocity magnitude relative to SOI [m/s]
98         const autoPtr<DataEntry<scalar> > Umag_;
100         //- Inner cone angle relative to SOI [deg]
101         const autoPtr<DataEntry<scalar> > thetaInner_;
103         //- Outer cone angle relative to SOI [deg]
104         const autoPtr<DataEntry<scalar> > thetaOuter_;
106         //- Parcel size PDF model
107         const autoPtr<pdf> parcelPDF_;
109         //- Number of parcels per injector already injected
110         mutable label nInjected_;
113         // Tangential vectors to the direction vector
115             //- First tangential vector
116             vectorList tanVec1_;
118             //- Second tangential vector
119             vectorList tanVec2_;
122 protected:
124     // Protected member functions
126         //- Number of parcels to introduce over the time step
127         label parcelsToInject
128         (
129             const scalar time0,
130             const scalar time1
131         ) const;
133         //- Number of parcels to introduce over the time step
134         scalar volumeToInject
135         (
136             const scalar time0,
137             const scalar time1
138         ) const;
141 public:
143     //- Runtime type information
144     TypeName("ConeInjectionMP");
147     // Constructors
149         //- Construct from dictionary
150         ConeInjectionMP
151         (
152             const dictionary& dict,
153             CloudType& owner
154         );
157     //- Destructor
158     virtual ~ConeInjectionMP();
161     // Member Functions
163         //- Flag to indicate whether model activates injection model
164         bool active() const;
166         //- Return the end-of-injection time
167         scalar timeEnd() const;
170         // Injection geometry
172             //- Set the injection position and owner cell
173             virtual void setPositionAndCell
174             (
175                 const label parcelI,
176                 const label nParcels,
177                 const scalar time,
178                 vector& position,
179                 label& cellOwner
180             );
182             //- Set the parcel properties
183             virtual void setProperties
184             (
185                 const label parcelI,
186                 const label nParcels,
187                 const scalar time,
188                 typename CloudType::parcelType& parcel
189             );
191             //- Flag to identify whether model fully describes the parcel
192             virtual bool fullyDescribed() const;
194             //- Return flag to identify whether or not injection of parcelI is
195             //  permitted
196             virtual bool validInjection(const label parcelI);
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 } // End namespace Foam
204 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 #ifdef NoRepository
207 #   include "ConeInjectionMP.C"
208 #endif
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 #endif
214 // ************************************************************************* //