FreeFOAM The Cross-Platform CFD Toolkit
ConeInjection.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::ConeInjection
26 
27 Description
28  Cone injection
29 
30  - User specifies
31  - time of start of injection
32  - injector position
33  - direction (along injection axis)
34  - parcel flow rate
35  - parcel velocity
36  - inner and outer cone angles
37  - Parcel diameters obtained by PDF model
38 
39 SourceFiles
40  ConeInjection.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef ConeInjection_H
45 #define ConeInjection_H
46 
48 #include <pdf/pdf.H>
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 // Forward declaration of classes
56 
57 template<class Type>
58 class DataEntry;
59 
60 /*---------------------------------------------------------------------------*\
61  Class ConeInjection Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class CloudType>
66 :
67  public InjectionModel<CloudType>
68 {
69  // Private data
70 
71  //- Injection duration [s]
72  const scalar duration_;
73 
74  //- Injector position [m]
75  vector position_;
76 
77  //- Cell containing injector position []
78  label injectorCell_;
79 
80  //- Injector direction []
81  vector direction_;
82 
83  //- Number of parcels to introduce per second []
84  const label parcelsPerSecond_;
85 
86  //- Volume flow rate of parcels to introduce relative to SOI [m^3]
87  const autoPtr<DataEntry<scalar> > volumeFlowRate_;
88 
89  //- Parcel velocity magnitude relative to SOI [m/s]
90  const autoPtr<DataEntry<scalar> > Umag_;
91 
92  //- Inner cone angle relative to SOI [deg]
93  const autoPtr<DataEntry<scalar> > thetaInner_;
94 
95  //- Outer cone angle relative to SOI [deg]
96  const autoPtr<DataEntry<scalar> > thetaOuter_;
97 
98  //- Parcel size PDF model
99  const autoPtr<pdfs::pdf> parcelPDF_;
100 
101 
102  // Tangential vectors to the direction vector
103 
104  //- First tangential vector
105  vector tanVec1_;
106 
107  //- Second tangential vector
108  vector tanVec2_;
109 
110 
111 protected:
112 
113  // Protected member functions
114 
115  //- Number of parcels to introduce over the time step relative to SOI
116  label parcelsToInject
117  (
118  const scalar time0,
119  const scalar time1
120  ) const;
121 
122  //- Number of parcels to introduce over the time step relative to SOI
123  scalar volumeToInject
124  (
125  const scalar time0,
126  const scalar time1
127  ) const;
128 
129 
130 public:
131 
132  //- Runtime type information
133  TypeName("ConeInjection");
134 
135 
136  // Constructors
137 
138  //- Construct from dictionary
140  (
141  const dictionary& dict,
142  CloudType& owner
143  );
144 
145 
146  //- Destructor
147  virtual ~ConeInjection();
148 
149 
150  // Member Functions
151 
152  //- Flag to indicate whether model activates injection model
153  bool active() const;
154 
155  //- Return the end-of-injection time
156  scalar timeEnd() const;
157 
158 
159  // Injection geometry
160 
161  //- Set the injection position and owner cell
162  virtual void setPositionAndCell
163  (
164  const label parcelI,
165  const label nParcels,
166  const scalar time,
167  vector& position,
168  label& cellOwner
169  );
170 
171  //- Set the parcel properties
172  virtual void setProperties
173  (
174  const label parcelI,
175  const label nParcels,
176  const scalar time,
177  typename CloudType::parcelType& parcel
178  );
179 
180  //- Flag to identify whether model fully describes the parcel
181  virtual bool fullyDescribed() const;
182 
183  //- Return flag to identify whether or not injection of parcelI is
184  // permitted
185  virtual bool validInjection(const label parcelI);
186 };
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace Foam
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #ifdef NoRepository
197 #endif
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************ vim: set sw=4 sts=4 et: ************************ //