initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / lagrangian / dieselSpray / injector / unitInjector / unitInjector.H
blob057700aad783026e317c9869c9b2d001c4f393c0
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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::unitInjector
28 Description
29     The unit injector
31 SourceFiles
32     unitInjectorI.H
33     unitInjector.C
34     unitInjectorIO.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef unitInjector_H
39 #define unitInjector_H
41 #include "injectorType.H"
42 #include "vector.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                            Class unitInjector Declaration
51 \*---------------------------------------------------------------------------*/
53 class unitInjector
55     public injectorType
58 private:
60     typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
62     // Private data
64         dictionary propsDict_;
66         vector position_;
67         vector direction_;
68         scalar d_;
69         scalar Cd_;
70         scalar mass_;
71         scalar T_;
72         label nParcels_;
73         scalarField X_;
74         List<pair> massFlowRateProfile_;
75         List<pair> velocityProfile_;
76         List<pair> injectionPressureProfile_;
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         unitInjector(const unitInjector&);
93         //- Disallow default bitwise assignment
94         void operator=(const unitInjector&);
96         //- Create two vectors orthonoal to each other
97         //  and the injection vector
98         void setTangentialVectors();
100         //- Return the fraction of the total injected liquid
101         scalar fractionOfInjection(const scalar time) const;
104 public:
106     //- Runtime type information
107     TypeName("unitInjector");
110     // Constructors
112         //- Construct from components
113         unitInjector
114         (
115             const Time& t,
116             const dictionary& dict
117         );
120     // Destructor
122         ~unitInjector();
125     // Member Functions
127         //- Return number of particles to inject
128         label nParcelsToInject
129         (
130             const scalar t0,
131             const scalar t1
132         ) const;
134         //- Return the injection position
135         const vector position() const;
137         //- Return the injection position
138         vector position
139         (
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 injector diameter
150         scalar d() const;
152         //- Return the injection direction
153         const vector& direction() const;
155         //- Return the mass of the injected particle
156         scalar mass
157         (
158             const scalar t0,
159             const scalar t1,
160             const bool twoD,
161             const scalar angleOfWedge
162         ) const;
164         //- Return the mass injected by the injector
165         scalar mass() const;
167         //- Return the fuel mass fractions of the injected particle
168         const scalarField& X() const;
170         //- Return the temperature profile of the injected particle
171         List<pair> T() const;
173         //- Return the temperature of the injected particle
174         scalar T(const scalar time) const;
176         //- Return the start-of-injection time
177         scalar tsoi() const;
179         //- Return the end-of-injection time
180         scalar teoi() const;
182         //- Return the injected liquid mass
183         scalar injectedMass(const scalar t) const;
185         List<pair> massFlowRateProfile() const
186         {
187             return massFlowRateProfile_;
188         }
190         scalar massFlowRate(const scalar time) const;
192         List<pair> injectionPressureProfile() const
193         {
194             return injectionPressureProfile_;
195         }
196     
197         scalar injectionPressure(const scalar time) const;
199         List<pair> velocityProfile() const
200         {
201             return velocityProfile_;
202         }
203         
204         scalar velocity(const scalar time) const;
206         List<pair> CdProfile() const;
207         scalar Cd(const scalar time) const;
209         void correctProfiles
210         (
211             const liquidMixture& fuel,
212             const scalar referencePressure
213         );
215         bool pressureIndependentVelocity() const
216         {
217             return pressureIndependentVelocity_;
218         }
223 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 } // End namespace Foam
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 #endif
231 // ************************************************************************* //