Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / src / lagrangian / dieselSpray / injector / commonRailInjector / commonRailInjector.H
blobaa812fc57a29b17590a3d501f82ca8f620b644cb
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::commonRailInjector
27 Description
28     Common-rail injector
30 SourceFiles
31     commonRailInjectorI.H
32     commonRailInjector.C
33     commonRailInjectorIO.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef commonRailInjector_H
38 #define commonRailInjector_H
40 #include "injectorType.H"
41 #include "vector.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class commonRailInjector Declaration
50 \*---------------------------------------------------------------------------*/
52 class commonRailInjector
54     public injectorType
57 private:
59     typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
61     // Private data
63         dictionary propsDict_;
65         vector position_;
66         vector direction_;
67         scalar d_;
68         scalar mass_;
69         scalar injectionPressure_;
70         scalar T_;
71         label nParcels_;
72         scalarField X_;
73         List<pair> massFlowRateProfile_;
74         List<pair> velocityProfile_;
75         List<pair> injectionPressureProfile_;
76         List<pair> CdProfile_;
77         List<pair> TProfile_;
78         scalar averageParcelMass_;
80         bool pressureIndependentVelocity_;
82         //- two orthogonal vectors that are also orthogonal
83         //  to the injection direction
84         vector tangentialInjectionVector1_, tangentialInjectionVector2_;
87     // Private Member Functions
89         //- Disallow default bitwise copy construct
90         commonRailInjector(const commonRailInjector&);
92         //- Disallow default bitwise assignment
93         void operator=(const commonRailInjector&);
95         //- Create two vectors orthonoal to each other
96         //  and the injection vector
97         void setTangentialVectors();
99         //- Return the fraction of the total injected liquid
100         scalar fractionOfInjection(const scalar time) const;
103 public:
105     //- Runtime type information
106     TypeName("commonRailInjector");
109     // Constructors
111         //- Construct from components
112         commonRailInjector
113         (
114             const Time& t,
115             const dictionary& dict
116         );
119     // Destructor
121         ~commonRailInjector();
124     // Member Functions
126         //- Return number of particles to inject
127         label nParcelsToInject
128         (
129             const scalar t0,
130             const scalar t1
131         ) const;
133         //- Return the injection position
134         const vector position(const label n) const;
136         //- Return the injection position
137         vector position
138         (
139             const label n,
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;
149         //- Return the number of holes
150         label nHoles() const;
152         //- Return the injector diameter
153         scalar d() const;
155         //- Return the injection direction
156         const vector& direction
157         (
158             const label i,
159             const scalar time
160         ) const;
162         //- Return the mass of the injected particle
163         scalar mass
164         (
165             const scalar t0,
166             const scalar t1,
167             const bool twoD,
168             const scalar angleOfWedge
169         ) const;
171         //- Return the mass injected by the injector
172         scalar mass() const;
174         //- Return the fuel mass fractions of the injected particle
175         const scalarField& X() const;
177         //- Return the temperature profile of the injected particle
178         List<pair> T() const;
180         //- Return the temperature of the injected particle
181         scalar T(const scalar time) const;
183         //- Return the start-of-injection time
184         scalar tsoi() const;
186         //- Return the end-of-injection time
187         scalar teoi() const;
189         //- Return the injected liquid mass
190         scalar injectedMass(const scalar t) const;
192         List<pair> massFlowRateProfile() const
193         {
194             return massFlowRateProfile_;
195         }
197         scalar massFlowRate(const scalar time) const;
199         List<pair> injectionPressureProfile() const
200         {
201             return injectionPressureProfile_;
202         }
204         scalar injectionPressure(const scalar time) const;
206         List<pair> velocityProfile() const
207         {
208             return velocityProfile_;
209         }
211         scalar velocity(const scalar time) const;
213         List<pair> CdProfile() const;
214         scalar Cd(const scalar time) const;
216         vector tan1(const label n) const;
217         vector tan2(const label n) const;
219         void correctProfiles
220         (
221             const liquidMixture& fuel,
222             const scalar referencePressure
223         );
225         bool pressureIndependentVelocity() const
226         {
227             return pressureIndependentVelocity_;
228         }
233 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 } // End namespace Foam
237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 #endif
241 // ************************************************************************* //