initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / dieselSpray / injector / multiHoleInjector / multiHoleInjector.H
blob96c13153d32459b39eee74559461373e8ff41bb2
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::multiHoleInjector
28 Description
29     The unit injector
31 SourceFiles
32     multiHoleInjectorI.H
33     multiHoleInjector.C
34     multiHoleInjectorIO.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef multiHoleInjector_H
39 #define multiHoleInjector_H
41 #include "injectorType.H"
42 #include "vector.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                            Class multiHoleInjector Declaration
51 \*---------------------------------------------------------------------------*/
53 class multiHoleInjector
55     public injectorType
58 private:
60     typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
62     // Private data
64         dictionary propsDict_;
66         vector centerPosition_;
67         scalar xyAngle_;
68         scalar zAngle_;
69         label nHoles_;
70         scalar umbrellaAngle_;
71         scalar nozzleTipDiameter_;
72         List<scalar> angleSpacing_;
73         scalar d_;
74         scalar Cd_;
75         scalar mass_;
76         label nParcels_;
77         scalarField X_;
78         List<pair> massFlowRateProfile_;
79         List<pair> velocityProfile_;
80         List<pair> injectionPressureProfile_;
81         List<pair> CdProfile_;
82         List<pair> TProfile_;
83         scalar averageParcelMass_;
84         List<vector> direction_;
85         List<vector> position_;
87         bool pressureIndependentVelocity_;
89         //- two orthogonal vectors that are also orthogonal
90         //  to the injection direction
91         List<vector> tangentialInjectionVector1_, tangentialInjectionVector2_;
94     // Private Member Functions
96         //- Disallow default bitwise copy construct
97         multiHoleInjector(const multiHoleInjector&);
99         //- Disallow default bitwise assignment
100         void operator=(const multiHoleInjector&);
102         //- Create two vectors orthonoal to each other
103         //  and the injection vector
104         void setTangentialVectors();
106         //- Return the fraction of the total injected liquid
107         scalar fractionOfInjection(const scalar time) const;
110 public:
112     //- Runtime type information
113     TypeName("multiHoleInjector");
116     // Constructors
118         //- Construct from components
119         multiHoleInjector
120         (
121             const Time& t,
122             const dictionary& dict
123         );
126     // Destructor
128         ~multiHoleInjector();
131     // Member Functions
133         //- Return number of particles to inject
134         label nParcelsToInject
135         (
136             const scalar t0,
137             const scalar t1
138         ) const;
140         //- Return the injection position
141         const vector position(const label n) const;
143         //- Return the injection position
144         vector position
145         (
146             const label n,
147             const scalar time,
148             const bool twoD,
149             const scalar angleOfWedge,
150             const vector& axisOfSymmetry,
151             const vector& axisOfWedge,
152             const vector& axisOfWedgeNormal,
153             Random& rndGen
154         ) const;
155     
156         //- Return the number of holes
157         label nHoles() const;
159         //- Return the injector diameter
160         scalar d() const;
162         //- Return the injection direction
163         const vector& direction
164         (
165             const label i,
166             const scalar time
167         ) const;
169         //- Return the mass of the injected particle
170         scalar mass
171         (
172             const scalar t0,
173             const scalar t1,
174             const bool twoD,
175             const scalar angleOfWedge
176         ) const;
178         //- Return the mass injected by the injector
179         scalar mass() const;
181         //- Return the fuel mass fractions of the injected particle
182         const scalarField& X() const;
184         //- Return the temperature profile of the injected particle
185         List<pair> T() const;
187         //- Return the temperature of the injected particle
188         scalar T(const scalar time) const;
190         //- Return the start-of-injection time
191         scalar tsoi() const;
193         //- Return the end-of-injection time
194         scalar teoi() const;
196         //- Return the injected liquid mass
197         scalar injectedMass(const scalar t) const;
199         List<pair> massFlowRateProfile() const
200         {
201             return massFlowRateProfile_;
202         }
204         scalar massFlowRate(const scalar time) const;
206         List<pair> injectionPressureProfile() const
207         {
208             return injectionPressureProfile_;
209         }
210     
211         scalar injectionPressure(const scalar time) const;
213         List<pair> velocityProfile() const
214         {
215             return velocityProfile_;
216         }
217         
218         scalar velocity(const scalar time) const;
220         List<pair> CdProfile() const;
221         scalar Cd(const scalar time) const;
223         vector tan1(const label n) const;
224         vector tan2(const label n) const;
226         void correctProfiles
227         (
228             const liquidMixture& fuel,
229             const scalar referencePressure
230         );
232         bool pressureIndependentVelocity() const
233         {
234             return pressureIndependentVelocity_;
235         }
240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 } // End namespace Foam
244 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 #endif
248 // ************************************************************************* //