OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::swirlInjector
00027 
00028 Description
00029     The swirl injector
00030 
00031 SourceFiles
00032     swirlInjectorI.H
00033     swirlInjector.C
00034     swirlInjectorIO.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef swirlInjector_H
00039 #define swirlInjector_H
00040 
00041 #include "injectorType.H"
00042 #include "vector.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 /*---------------------------------------------------------------------------*\
00050                            Class swirlInjector Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 class swirlInjector
00054 :
00055     public injectorType
00056 {
00057 
00058 private:
00059 
00060     // Private data
00061 
00062         typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
00063 
00064         dictionary propsDict_;
00065 
00066         vector position_;
00067         vector direction_;
00068         scalar d_;
00069         scalar mass_;
00070         scalar injectionPressure_;
00071         scalar T_;
00072         label nParcels_;
00073         scalarField X_;
00074         List<pair> massFlowRateProfile_;
00075         List<pair> injectionPressureProfile_;
00076         List<pair> velocityProfile_;
00077         List<pair> CdProfile_;
00078         List<pair> TProfile_;
00079         scalar averageParcelMass_;
00080 
00081         bool pressureIndependentVelocity_;
00082 
00083         //- two orthogonal vectors that are also orthogonal
00084         //  to the injection direction
00085         vector tangentialInjectionVector1_, tangentialInjectionVector2_;
00086 
00087 
00088     // Private Member Functions
00089 
00090         //- Disallow default bitwise copy construct
00091         swirlInjector(const swirlInjector&);
00092 
00093         //- Disallow default bitwise assignment
00094         void operator=(const swirlInjector&);
00095 
00096         //- Integrate the mass-flow profile and set
00097         //  the integral value
00098         void setIntegralProfileValue();
00099 
00100         //- Create two vectors orthonoal to each other
00101         //  and the injection vector
00102         void setTangentialVectors();
00103 
00104         //- Return the fraction of the total injected liquid
00105         scalar fractionOfInjection(const scalar time) const;
00106 
00107 
00108 /*
00109 
00110         //- Return the average injection velocity
00111         scalar averageInjectionVelocityTime(const scalar liquidDensity) const;
00112 
00113         //- Return the instantaneous injection velocity
00114         scalar injectionVelocity(const scalar, const scalar liquidDensity) const;
00115 
00116 */
00117 
00118 public:
00119 
00120     //- Runtime type information
00121     TypeName("swirlInjector");
00122 
00123 
00124     // Constructors
00125 
00126         //- Construct from components
00127         swirlInjector
00128         (
00129             const Time& t,
00130             const dictionary& dict
00131         );
00132 
00133 
00134     // Destructor
00135 
00136         ~swirlInjector();
00137 
00138 
00139     // Member Functions
00140 
00141         //- Return number of particles to inject
00142         label nParcelsToInject
00143         (
00144             const scalar t0,
00145             const scalar t1
00146         ) const;
00147 
00148         //- Return the injection position
00149         const vector position(const label n) const;
00150 
00151         //- Return the injection position
00152         vector position
00153         (
00154             const label n,
00155             const scalar time,
00156             const bool twoD,
00157             const scalar angleOfWedge,
00158             const vector& axisOfSymmetry,
00159             const vector& axisOfWedge,
00160             const vector& axisOfWedgeNormal,
00161             Random& rndGen
00162         ) const;
00163     
00164         //- Return the number of holes
00165         label nHoles() const;
00166 
00167         //- Return the injector diameter
00168         scalar d() const;
00169 
00170         //- Return the injection direction
00171         const vector& direction
00172         (
00173             const label i,
00174             const scalar time
00175         ) const;
00176 
00177         //- Return the mass of the injected particle
00178         scalar mass
00179         (
00180             const scalar t0,
00181             const scalar t1,
00182             const bool twoD,
00183             const scalar angleOfWedge
00184         ) const;
00185 
00186         //- Return the mass injected by the injector
00187         scalar mass() const;
00188 
00189         //- Return the mass flow rate profile
00190         List<pair> massFlowRateProfile() const;
00191 
00192         //- Return the instantaneous mass flow rate profile
00193         scalar massFlowRate(const scalar time) const;
00194 
00195         //- Return the pressure injection profile
00196         List<pair> injectionPressureProfile() const;
00197 
00198         //- Return the instantaneous injection pressure
00199         scalar injectionPressure(const scalar time) const;
00200 
00201         //- Return the velocity injection profile
00202         List<pair> velocityProfile() const;
00203 
00204         //- Return the instantaneous velocity
00205         scalar velocity(const scalar time) const;
00206 
00207         //- Return the discharge coefficient    
00208         List<pair> CdProfile() const;
00209 
00210         //- Return the instantaneous discharge coefficient
00211         scalar Cd(const scalar time) const;
00212 
00213         //- Return the fuel mass fractions of the injected particle
00214         const scalarField& X() const;
00215 
00216         //- Return the temperatue profile of the injected parcel
00217         List<pair> T() const;
00218 
00219         //- Return the temperatue of the injected parcel
00220         scalar T(const scalar time) const;
00221 
00222         //- Return the start-of-injection time
00223         scalar tsoi() const;
00224 
00225         //- Return the end-of-injection time
00226         scalar teoi() const;
00227 
00228         //- Return the injected liquid mass
00229         scalar injectedMass(const scalar t) const;
00230 
00231         vector tan1(const label n) const;
00232         vector tan2(const label n) const;
00233 
00234         void correctProfiles
00235         (
00236             const liquidMixture& fuel,
00237             const scalar referencePressure
00238         );
00239         
00240         bool pressureIndependentVelocity() const
00241         {
00242             return pressureIndependentVelocity_;
00243         }
00244 };
00245 
00246 
00247 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00248 
00249 } // End namespace Foam
00250 
00251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00252 
00253 #endif
00254 
00255 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd