FreeFOAM The Cross-Platform CFD Toolkit
commonRailInjector.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::commonRailInjector
26 
27 Description
28  Common-rail injector
29 
30 SourceFiles
31  commonRailInjectorI.H
32  commonRailInjector.C
33  commonRailInjectorIO.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef commonRailInjector_H
38 #define commonRailInjector_H
39 
41 #include <OpenFOAM/vector.H>
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class commonRailInjector 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 mass_;
69  scalar injectionPressure_;
70  scalar T_;
71  label nParcels_;
72  scalarField X_;
73  List<pair> massFlowRateProfile_;
74  List<pair> velocityProfile_;
75  List<pair> injectionPressureProfile_;
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 commonRailInjector&);
94 
95  //- Create two vectors orthonoal to each other
96  // and the injection vector
97  void setTangentialVectors();
98 
99  //- Return the fraction of the total injected liquid
100  scalar fractionOfInjection(const scalar time) const;
101 
102 
103 public:
104 
105  //- Runtime type information
106  TypeName("commonRailInjector");
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 
213  List<pair> CdProfile() const;
214  scalar Cd(const scalar time) const;
215 
216  vector tan1(const label n) const;
217  vector tan2(const label n) const;
218 
219  void correctProfiles
220  (
221  const liquidMixture& fuel,
222  const scalar referencePressure
223  );
224 
226  {
227  return pressureIndependentVelocity_;
228  }
229 
230 };
231 
232 
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
234 
235 } // End namespace Foam
236 
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 
239 #endif
240 
241 // ************************ vim: set sw=4 sts=4 et: ************************ //