FreeFOAM The Cross-Platform CFD Toolkit
injectorType.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::injectorType
26 
27 Description
28  Base class for injectors
29 
30 SourceFiles
31  injectorTypeI.H
32  injectorType.C
33  injectorTypeIO.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef injectorType_H
38 #define injectorType_H
39 
40 #include <OpenFOAM/IOdictionary.H>
41 #include <OpenFOAM/Time.H>
42 #include <OpenFOAM/autoPtr.H>
44 #include <OpenFOAM/vector.H>
45 #include <OpenFOAM/scalarField.H>
46 #include <OpenFOAM/Random.H>
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class injectorType Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 {
60  typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
61 
62 public:
63 
64  //- Runtime type information
65  TypeName("injectorType");
66 
67  // Declare runtime constructor selection table
68 
70  (
71  autoPtr,
73  dictionary,
74  (
75  const Time& t,
76  const dictionary& dict
77  ),
78  (t, dict)
79  );
80 
81 
82  // Constructors
83 
84  //- Construct from components
86  (
87  const Time& t,
88  const dictionary& dict
89  );
90 
91 
92  // Selectors
93 
95  (
96  const Time& t,
97  const dictionary& dict
98  );
99 
100 
101  // Destructor
102 
103  virtual ~injectorType();
104 
105 
106  // Member Functions
107 
108  //- Return number of particles to inject
109  virtual label nParcelsToInject
110  (
111  const scalar time0,
112  const scalar time1
113  ) const = 0;
114 
115  //- Return the injection position
116  virtual const vector position(const label n) const = 0;
117 
118  //- Return the injection position
119  virtual vector position
120  (
121  const label n,
122  const scalar time,
123  const bool twoD,
124  const scalar angleOfWedge,
125  const vector& axisOfSymmetry,
126  const vector& axisOfWedge,
127  const vector& axisOfWedgeNormal,
128  Random& rndGen
129  ) const = 0;
130 
131  //- Return the number of holes
132  virtual label nHoles() const = 0;
133 
134  //- Return the injector diameter
135  virtual scalar d() const = 0;
136 
137  //- Return the injection direction for hole i
138  virtual const vector& direction
139  (
140  const label i,
141  const scalar time
142  ) const = 0;
143 
144  //- Return the mass of the injected liquid between times
145  virtual scalar mass
146  (
147  const scalar time0,
148  const scalar time1,
149  const bool twoD,
150  const scalar angleOfWedge
151  ) const = 0;
152 
153  //- Return the mass injected by the injector
154  virtual scalar mass() const = 0;
155 
156  //- Return the mass flow rate profile
157  virtual List<pair> massFlowRateProfile() const = 0;
158 
159  //- Return the instantaneous mass flow rate profile
160  virtual scalar massFlowRate(const scalar time) const = 0;
161 
162  //- Return the pressure injection profile
163  virtual List<pair> injectionPressureProfile() const = 0;
164 
165  //- Return the instantaneous injection pressure
166  virtual scalar injectionPressure(const scalar time) const = 0;
167 
168  //- Return the velocity injection profile
169  virtual List<pair> velocityProfile() const = 0;
170 
171  //- Return the instantaneous velocity
172  virtual scalar velocity(const scalar time) const = 0;
173 
174  //- Return the discharge coefficient
175  virtual List<pair> CdProfile() const = 0;
176 
177  //- Return the instantaneous discharge coefficient
178  virtual scalar Cd(const scalar time) const = 0;
179 
180  //- Return the fuel mass fractions of the injected particle
181  virtual const scalarField& X() const = 0;
182 
183  //- Return the temperatue profile of the injected parcel
184  virtual List<pair> T() const = 0;
185 
186  //- Return the temperatue of the injected parcel
187  virtual scalar T(const scalar time) const = 0;
188 
189  //- Return the start-of-injection time
190  virtual scalar tsoi() const = 0;
191 
192  //- Return the end-of-injection time
193  virtual scalar teoi() const = 0;
194 
195  virtual scalar injectedMass(const scalar t) const = 0;
196 
197  virtual bool pressureIndependentVelocity() const = 0;
198 
199  //- Return a vector perpendicular to the injection direction and tan2 for hole n
200  virtual vector tan1(const label n) const = 0;
201 
202  //- Return a vector perpendicular to the injection direction and tan1 for hole n
203  virtual vector tan2(const label n) const = 0;
204 
205  scalar getTableValue
206  (
207  const List<pair>& table,
208  const scalar value
209  ) const;
210 
211  scalar integrateTable
212  (
213  const List<pair>& table,
214  const scalar value
215  ) const;
216 
217  scalar integrateTable
218  (
219  const List<pair>& table
220  ) const;
221 
222  virtual void correctProfiles
223  (
224  const liquidMixture& fuel,
225  const scalar referencePressure
226  ) = 0;
227 
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace Foam
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************ vim: set sw=4 sts=4 et: ************************ //