initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / dieselSpray / injector / definedInjector / definedInjector.H
blobfff583391ae24e5111a1542a591a497b4b89e0fe
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::definedInjector
28 Description
29     User specified MFR vs time and velocity vs time
31 SourceFiles
32     definedInjectorI.H
33     definedInjector.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef definedInjector_H
38 #define definedInjector_H
40 #include "injectorType.H"
41 #include "vector.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class definedInjector Declaration
50 \*---------------------------------------------------------------------------*/
52 class definedInjector
54     public injectorType
57 private:
59     // Private data
61         typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
63         dictionary propsDict_;
65         vector position_;
66         vector direction_;
67         scalar d_;
68         scalar mass_;
69         scalar T_;
70         label nParcels_;
71         scalarField X_;
72         List<pair> massFlowRateProfile_;                         // aj
73         List<pair> velocityProfile_;                    // aj
74         List<pair> injectionPressureProfile_;
75         List<pair> CdProfile_;
76         List<pair> TProfile_;
77         scalar averageParcelMass_;
79         bool pressureIndependentVelocity_;
81         //- two orthogonal vectors that are also orthogonal
82         //  to the injection direction
83         vector tangentialInjectionVector1_, tangentialInjectionVector2_;
86     // Private Member Functions
88         //- Disallow default bitwise copy construct
89         definedInjector(const definedInjector&);
91         //- Disallow default bitwise assignment
92         void operator=(const definedInjector&);
94         //- Create two vectors orthonoal to each other
95         //  and the injection vector
96         void setTangentialVectors();
98         //- Return the fraction of the total injected liquid
99         scalar fractionOfInjection(const scalar time) const;
101         //- Return the instantaneous injection velocity
102         scalar injectionVelocity(const scalar) const;
104 public:
106     //- Runtime type information
107     TypeName("definedInjector");
110     // Constructors
112         //- Construct from components
113         definedInjector
114         (
115             const Time& t,
116             const dictionary& dict
117         );
120     // Destructor
122         ~definedInjector();
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 label n) const;
137         //- Return the injection position
138         vector position
139         (
140             const label n,
141             const scalar time,
142             const bool twoD,
143             const scalar angleOfWedge,
144             const vector& axisOfSymmetry,
145             const vector& axisOfWedge,
146             const vector& axisOfWedgeNormal,
147             Random& rndGen
148         ) const;
149     
150         //- Return the number of holes
151         label nHoles() const;
153         //- Return the injector diameter
154         scalar d() const;
156         //- Return the injection direction
157         const vector& direction
158         (
159             const label i,
160             const scalar time
161         ) const;
163         //- Return the mass of the injected particle
164         scalar mass
165         (
166             const scalar t0,
167             const scalar t1,
168             const bool twoD,
169             const scalar angleOfWedge
170         ) const;
172         //- Return the mass injected by the injector
173         scalar mass() const;
175         //- Return the fuel mass fractions of the injected particle
176         const scalarField& X() const;
178         //- Return the temperature profile of the injected particle
179         List<pair> T() const;
181         //- Return the temperature of the injected particle
182         scalar T(const scalar time) const;
184         //- Return the start-of-injection time
185         scalar tsoi() const;
187         //- Return the end-of-injection time
188         scalar teoi() const;
190         //- Return the injected liquid mass
191         scalar injectedMass(const scalar t) const;
193         List<pair> massFlowRateProfile() const
194         {
195             return massFlowRateProfile_;
196         }
198         scalar massFlowRate(const scalar time) const;
200         List<pair> injectionPressureProfile() const
201         {
202             return injectionPressureProfile_;
203         }
204     
205         scalar injectionPressure(const scalar time) const;
207         List<pair> velocityProfile() const
208         {
209             return velocityProfile_;
210         }
211         
212         scalar velocity(const scalar time) const;
214         List<pair> CdProfile() const
215         {
216             return CdProfile_;
217         }
219         scalar Cd(const scalar time) const;
221         vector tan1(const label n) const;
222         vector tan2(const label n) const;
224         void correctProfiles
225         (
226             const liquidMixture& fuel,
227             const scalar referencePressure
228         );
230         bool pressureIndependentVelocity() const
231         {
232             return pressureIndependentVelocity_;
233         }
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 } // End namespace Foam
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 #endif
246 // ************************************************************************* //