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