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