FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

swirlInjector.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::swirlInjector
00026 
00027 Description
00028     The swirl injector
00029 
00030 SourceFiles
00031     swirlInjectorI.H
00032     swirlInjector.C
00033     swirlInjectorIO.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef swirlInjector_H
00038 #define swirlInjector_H
00039 
00040 #include <dieselSpray/injectorType.H>
00041 #include <OpenFOAM/vector.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                            Class swirlInjector Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 class swirlInjector
00053 :
00054     public injectorType
00055 {
00056 
00057 private:
00058 
00059     // Private data
00060 
00061         typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
00062 
00063         dictionary propsDict_;
00064 
00065         vector position_;
00066         vector direction_;
00067         scalar d_;
00068         scalar mass_;
00069         scalar injectionPressure_;
00070         scalar T_;
00071         label nParcels_;
00072         scalarField X_;
00073         List<pair> massFlowRateProfile_;
00074         List<pair> injectionPressureProfile_;
00075         List<pair> velocityProfile_;
00076         List<pair> CdProfile_;
00077         List<pair> TProfile_;
00078         scalar averageParcelMass_;
00079 
00080         bool pressureIndependentVelocity_;
00081 
00082         //- two orthogonal vectors that are also orthogonal
00083         //  to the injection direction
00084         vector tangentialInjectionVector1_, tangentialInjectionVector2_;
00085 
00086 
00087     // Private Member Functions
00088 
00089         //- Disallow default bitwise copy construct
00090         swirlInjector(const swirlInjector&);
00091 
00092         //- Disallow default bitwise assignment
00093         void operator=(const swirlInjector&);
00094 
00095         //- Integrate the mass-flow profile and set
00096         //  the integral value
00097         void setIntegralProfileValue();
00098 
00099         //- Create two vectors orthonoal to each other
00100         //  and the injection vector
00101         void setTangentialVectors();
00102 
00103         //- Return the fraction of the total injected liquid
00104         scalar fractionOfInjection(const scalar time) const;
00105 
00106 
00107 /*
00108 
00109         //- Return the average injection velocity
00110         scalar averageInjectionVelocityTime(const scalar liquidDensity) const;
00111 
00112         //- Return the instantaneous injection velocity
00113         scalar injectionVelocity(const scalar, const scalar liquidDensity) const;
00114 
00115 */
00116 
00117 public:
00118 
00119     //- Runtime type information
00120     TypeName("swirlInjector");
00121 
00122 
00123     // Constructors
00124 
00125         //- Construct from components
00126         swirlInjector
00127         (
00128             const Time& t,
00129             const dictionary& dict
00130         );
00131 
00132 
00133     // Destructor
00134 
00135         ~swirlInjector();
00136 
00137 
00138     // Member Functions
00139 
00140         //- Return number of particles to inject
00141         label nParcelsToInject
00142         (
00143             const scalar t0,
00144             const scalar t1
00145         ) const;
00146 
00147         //- Return the injection position
00148         const vector position(const label n) const;
00149 
00150         //- Return the injection position
00151         vector position
00152         (
00153             const label n,
00154             const scalar time,
00155             const bool twoD,
00156             const scalar angleOfWedge,
00157             const vector& axisOfSymmetry,
00158             const vector& axisOfWedge,
00159             const vector& axisOfWedgeNormal,
00160             Random& rndGen
00161         ) const;
00162     
00163         //- Return the number of holes
00164         label nHoles() const;
00165 
00166         //- Return the injector diameter
00167         scalar d() const;
00168 
00169         //- Return the injection direction
00170         const vector& direction
00171         (
00172             const label i,
00173             const scalar time
00174         ) const;
00175 
00176         //- Return the mass of the injected particle
00177         scalar mass
00178         (
00179             const scalar t0,
00180             const scalar t1,
00181             const bool twoD,
00182             const scalar angleOfWedge
00183         ) const;
00184 
00185         //- Return the mass injected by the injector
00186         scalar mass() const;
00187 
00188         //- Return the mass flow rate profile
00189         List<pair> massFlowRateProfile() const;
00190 
00191         //- Return the instantaneous mass flow rate profile
00192         scalar massFlowRate(const scalar time) const;
00193 
00194         //- Return the pressure injection profile
00195         List<pair> injectionPressureProfile() const;
00196 
00197         //- Return the instantaneous injection pressure
00198         scalar injectionPressure(const scalar time) const;
00199 
00200         //- Return the velocity injection profile
00201         List<pair> velocityProfile() const;
00202 
00203         //- Return the instantaneous velocity
00204         scalar velocity(const scalar time) const;
00205 
00206         //- Return the discharge coefficient    
00207         List<pair> CdProfile() const;
00208 
00209         //- Return the instantaneous discharge coefficient
00210         scalar Cd(const scalar time) const;
00211 
00212         //- Return the fuel mass fractions of the injected particle
00213         const scalarField& X() const;
00214 
00215         //- Return the temperatue profile of the injected parcel
00216         List<pair> T() const;
00217 
00218         //- Return the temperatue of the injected parcel
00219         scalar T(const scalar time) const;
00220 
00221         //- Return the start-of-injection time
00222         scalar tsoi() const;
00223 
00224         //- Return the end-of-injection time
00225         scalar teoi() const;
00226 
00227         //- Return the injected liquid mass
00228         scalar injectedMass(const scalar t) const;
00229 
00230         vector tan1(const label n) const;
00231         vector tan2(const label n) const;
00232 
00233         void correctProfiles
00234         (
00235             const liquidMixture& fuel,
00236             const scalar referencePressure
00237         );
00238         
00239         bool pressureIndependentVelocity() const
00240         {
00241             return pressureIndependentVelocity_;
00242         }
00243 };
00244 
00245 
00246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00247 
00248 } // End namespace Foam
00249 
00250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00251 
00252 #endif
00253 
00254 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines