initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / dieselSpray / injector / swirlInjector / swirlInjector.H
blob9f7f3347abfe79a74de044307ab6475696eade34
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::swirlInjector
28 Description
29     The swirl injector
31 SourceFiles
32     swirlInjectorI.H
33     swirlInjector.C
34     swirlInjectorIO.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef swirlInjector_H
39 #define swirlInjector_H
41 #include "injectorType.H"
42 #include "vector.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                            Class swirlInjector Declaration
51 \*---------------------------------------------------------------------------*/
53 class swirlInjector
55     public injectorType
58 private:
60     // Private data
62         typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
64         dictionary propsDict_;
66         vector position_;
67         vector direction_;
68         scalar d_;
69         scalar mass_;
70         scalar injectionPressure_;
71         scalar T_;
72         label nParcels_;
73         scalarField X_;
74         List<pair> massFlowRateProfile_;
75         List<pair> injectionPressureProfile_;
76         List<pair> velocityProfile_;
77         List<pair> CdProfile_;
78         List<pair> TProfile_;
79         scalar averageParcelMass_;
81         bool pressureIndependentVelocity_;
83         //- two orthogonal vectors that are also orthogonal
84         //  to the injection direction
85         vector tangentialInjectionVector1_, tangentialInjectionVector2_;
88     // Private Member Functions
90         //- Disallow default bitwise copy construct
91         swirlInjector(const swirlInjector&);
93         //- Disallow default bitwise assignment
94         void operator=(const swirlInjector&);
96         //- Integrate the mass-flow profile and set
97         //  the integral value
98         void setIntegralProfileValue();
100         //- Create two vectors orthonoal to each other
101         //  and the injection vector
102         void setTangentialVectors();
104         //- Return the fraction of the total injected liquid
105         scalar fractionOfInjection(const scalar time) const;
110         //- Return the average injection velocity
111         scalar averageInjectionVelocityTime(const scalar liquidDensity) const;
113         //- Return the instantaneous injection velocity
114         scalar injectionVelocity(const scalar, const scalar liquidDensity) const;
118 public:
120     //- Runtime type information
121     TypeName("swirlInjector");
124     // Constructors
126         //- Construct from components
127         swirlInjector
128         (
129             const Time& t,
130             const dictionary& dict
131         );
134     // Destructor
136         ~swirlInjector();
139     // Member Functions
141         //- Return number of particles to inject
142         label nParcelsToInject
143         (
144             const scalar t0,
145             const scalar t1
146         ) const;
148         //- Return the injection position
149         const vector position(const label n) const;
151         //- Return the injection position
152         vector position
153         (
154             const label n,
155             const scalar time,
156             const bool twoD,
157             const scalar angleOfWedge,
158             const vector& axisOfSymmetry,
159             const vector& axisOfWedge,
160             const vector& axisOfWedgeNormal,
161             Random& rndGen
162         ) const;
163     
164         //- Return the number of holes
165         label nHoles() const;
167         //- Return the injector diameter
168         scalar d() const;
170         //- Return the injection direction
171         const vector& direction
172         (
173             const label i,
174             const scalar time
175         ) const;
177         //- Return the mass of the injected particle
178         scalar mass
179         (
180             const scalar t0,
181             const scalar t1,
182             const bool twoD,
183             const scalar angleOfWedge
184         ) const;
186         //- Return the mass injected by the injector
187         scalar mass() const;
189         //- Return the mass flow rate profile
190         List<pair> massFlowRateProfile() const;
192         //- Return the instantaneous mass flow rate profile
193         scalar massFlowRate(const scalar time) const;
195         //- Return the pressure injection profile
196         List<pair> injectionPressureProfile() const;
198         //- Return the instantaneous injection pressure
199         scalar injectionPressure(const scalar time) const;
201         //- Return the velocity injection profile
202         List<pair> velocityProfile() const;
204         //- Return the instantaneous velocity
205         scalar velocity(const scalar time) const;
207         //- Return the discharge coefficient    
208         List<pair> CdProfile() const;
210         //- Return the instantaneous discharge coefficient
211         scalar Cd(const scalar time) const;
213         //- Return the fuel mass fractions of the injected particle
214         const scalarField& X() const;
216         //- Return the temperatue profile of the injected parcel
217         List<pair> T() const;
219         //- Return the temperatue of the injected parcel
220         scalar T(const scalar time) const;
222         //- Return the start-of-injection time
223         scalar tsoi() const;
225         //- Return the end-of-injection time
226         scalar teoi() const;
228         //- Return the injected liquid mass
229         scalar injectedMass(const scalar t) const;
231         vector tan1(const label n) const;
232         vector tan2(const label n) const;
234         void correctProfiles
235         (
236             const liquidMixture& fuel,
237             const scalar referencePressure
238         );
239         
240         bool pressureIndependentVelocity() const
241         {
242             return pressureIndependentVelocity_;
243         }
247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249 } // End namespace Foam
251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
253 #endif
255 // ************************************************************************* //