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