FreeFOAM The Cross-Platform CFD Toolkit
multiHoleInjector.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::multiHoleInjector
26 
27 Description
28  The unit injector
29 
30 SourceFiles
31  multiHoleInjectorI.H
32  multiHoleInjector.C
33  multiHoleInjectorIO.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef multiHoleInjector_H
38 #define multiHoleInjector_H
39 
41 #include <OpenFOAM/vector.H>
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class multiHoleInjector Declaration
50 \*---------------------------------------------------------------------------*/
51 
53 :
54  public injectorType
55 {
56 
57 private:
58 
59  typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
60 
61  // Private data
62 
63  dictionary propsDict_;
64 
65  vector centerPosition_;
66  scalar xyAngle_;
67  scalar zAngle_;
68  label nHoles_;
69  scalar umbrellaAngle_;
70  scalar nozzleTipDiameter_;
71  List<scalar> angleSpacing_;
72  scalar d_;
73  scalar Cd_;
74  scalar mass_;
75  label nParcels_;
76  scalarField X_;
77  List<pair> massFlowRateProfile_;
78  List<pair> velocityProfile_;
79  List<pair> injectionPressureProfile_;
80  List<pair> CdProfile_;
81  List<pair> TProfile_;
82  scalar averageParcelMass_;
83  List<vector> direction_;
84  List<vector> position_;
85 
86  bool pressureIndependentVelocity_;
87 
88  //- two orthogonal vectors that are also orthogonal
89  // to the injection direction
90  List<vector> tangentialInjectionVector1_, tangentialInjectionVector2_;
91 
92 
93  // Private Member Functions
94 
95  //- Disallow default bitwise copy construct
97 
98  //- Disallow default bitwise assignment
99  void operator=(const multiHoleInjector&);
100 
101  //- Create two vectors orthonoal to each other
102  // and the injection vector
103  void setTangentialVectors();
104 
105  //- Return the fraction of the total injected liquid
106  scalar fractionOfInjection(const scalar time) const;
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("multiHoleInjector");
113 
114 
115  // Constructors
116 
117  //- Construct from components
119  (
120  const Time& t,
121  const dictionary& dict
122  );
123 
124 
125  // Destructor
126 
128 
129 
130  // Member Functions
131 
132  //- Return number of particles to inject
133  label nParcelsToInject
134  (
135  const scalar t0,
136  const scalar t1
137  ) const;
138 
139  //- Return the injection position
140  const vector position(const label n) const;
141 
142  //- Return the injection position
144  (
145  const label n,
146  const scalar time,
147  const bool twoD,
148  const scalar angleOfWedge,
149  const vector& axisOfSymmetry,
150  const vector& axisOfWedge,
151  const vector& axisOfWedgeNormal,
152  Random& rndGen
153  ) const;
154 
155  //- Return the number of holes
156  label nHoles() const;
157 
158  //- Return the injector diameter
159  scalar d() const;
160 
161  //- Return the injection direction
162  const vector& direction
163  (
164  const label i,
165  const scalar time
166  ) const;
167 
168  //- Return the mass of the injected particle
169  scalar mass
170  (
171  const scalar t0,
172  const scalar t1,
173  const bool twoD,
174  const scalar angleOfWedge
175  ) const;
176 
177  //- Return the mass injected by the injector
178  scalar mass() const;
179 
180  //- Return the fuel mass fractions of the injected particle
181  const scalarField& X() const;
182 
183  //- Return the temperature profile of the injected particle
184  List<pair> T() const;
185 
186  //- Return the temperature of the injected particle
187  scalar T(const scalar time) const;
188 
189  //- Return the start-of-injection time
190  scalar tsoi() const;
191 
192  //- Return the end-of-injection time
193  scalar teoi() const;
194 
195  //- Return the injected liquid mass
196  scalar injectedMass(const scalar t) const;
197 
199  {
200  return massFlowRateProfile_;
201  }
202 
203  scalar massFlowRate(const scalar time) const;
204 
206  {
207  return injectionPressureProfile_;
208  }
209 
210  scalar injectionPressure(const scalar time) const;
211 
213  {
214  return velocityProfile_;
215  }
216 
217  scalar velocity(const scalar time) const;
218 
219  List<pair> CdProfile() const;
220  scalar Cd(const scalar time) const;
221 
222  vector tan1(const label n) const;
223  vector tan2(const label n) const;
224 
225  void correctProfiles
226  (
227  const liquidMixture& fuel,
228  const scalar referencePressure
229  );
230 
232  {
233  return pressureIndependentVelocity_;
234  }
235 
236 };
237 
238 
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 
241 } // End namespace Foam
242 
243 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 
245 #endif
246 
247 // ************************ vim: set sw=4 sts=4 et: ************************ //