OpenFOAM logo
Open Source CFD Toolkit

unitInjector.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-2005 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     unitInjector
00027 
00028 Description
00029 
00030 SourceFiles
00031     unitInjectorI.H
00032     unitInjector.C
00033     unitInjectorIO.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef unitInjector_H
00038 #define unitInjector_H
00039 
00040 #include "injectorType.H"
00041 #include "vector.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                            Class unitInjector Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 class unitInjector
00053 :
00054     public injectorType
00055 {
00056 
00057 private:
00058 
00059     typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
00060 
00061     // Private data
00062 
00063         dictionary propsDict_;
00064 
00065         vector position_;
00066         vector direction_;
00067         scalar d_;
00068         scalar Cd_;
00069         scalar mass_;
00070         scalar T_;
00071         label nParcels_;
00072         scalarField X_;
00073         List<pair> massFlowRateProfile_;
00074         List<pair> velocityProfile_;
00075         List<pair> injectionPressureProfile_;
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         unitInjector(const unitInjector&);
00091 
00092         //- Disallow default bitwise assignment
00093         void operator=(const unitInjector&);
00094 
00095         //- Create two vectors orthonoal to each other
00096         //  and the injection vector
00097         void setTangentialVectors();
00098 
00099         //- Return the fraction of the total injected liquid
00100         scalar fractionOfInjection(const scalar time) const;
00101 
00102 
00103 public:
00104 
00105     //- Runtime type information
00106     TypeName("unitInjector");
00107 
00108 
00109     // Constructors
00110 
00111         //- Construct from components
00112         unitInjector
00113         (
00114             const Time& t,
00115             const dictionary& dict
00116         );
00117 
00118 
00119     // Destructor
00120 
00121         ~unitInjector();
00122 
00123 
00124     // Member Functions
00125 
00126         //- Return number of particles to inject
00127         label nParcelsToInject
00128         (
00129             const scalar t0,
00130             const scalar t1
00131         ) const;
00132 
00133         //- Return the injection position
00134         const vector position() const;
00135 
00136         //- Return the injection position
00137         vector position
00138         (
00139             const scalar time,
00140             const bool twoD,
00141             const scalar angleOfWedge,
00142             const vector& axisOfSymmetry,
00143             const vector& axisOfWedge,
00144             const vector& axisOfWedgeNormal,
00145             Random& rndGen
00146         ) const;
00147     
00148         //- Return the injector diameter
00149         scalar d() const;
00150 
00151         //- Return the injection direction
00152         const vector& direction() const;
00153 
00154         //- Return the mass of the injected particle
00155         scalar mass
00156         (
00157             const scalar t0,
00158             const scalar t1,
00159             const bool twoD,
00160             const scalar angleOfWedge
00161         ) const;
00162 
00163         //- Return the mass injected by the injector
00164         scalar mass() const;
00165 
00166         //- Return the fuel mass fractions of the injected particle
00167         const scalarField& X() const;
00168 
00169         //- Return the temperature profile of the injected particle
00170         List<pair> T() const;
00171 
00172         //- Return the temperature of the injected particle
00173         scalar T(const scalar time) const;
00174 
00175         //- Return the start-of-injection time
00176         scalar tsoi() const;
00177 
00178         //- Return the end-of-injection time
00179         scalar teoi() const;
00180 
00181         //- Return the injected liquid mass
00182         scalar injectedMass(const scalar t) const;
00183 
00184         List<pair> massFlowRateProfile() const
00185         {
00186             return massFlowRateProfile_;
00187         }
00188 
00189         scalar massFlowRate(const scalar time) const;
00190 
00191         List<pair> injectionPressureProfile() const
00192         {
00193             return injectionPressureProfile_;
00194         }
00195     
00196         scalar injectionPressure(const scalar time) const;
00197 
00198         List<pair> velocityProfile() const
00199         {
00200             return velocityProfile_;
00201         }
00202         
00203         scalar velocity(const scalar time) const;
00204 
00205         List<pair> CdProfile() const;
00206         scalar Cd(const scalar time) const;
00207 
00208         void correctProfiles
00209         (
00210             const liquidMixture& fuel,
00211             const scalar referencePressure
00212         );
00213 
00214         bool pressureIndependentVelocity() const
00215         {
00216             return pressureIndependentVelocity_;
00217         }
00218 
00219 };
00220 
00221 
00222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00223 
00224 } // End namespace Foam
00225 
00226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00227 
00228 #endif
00229 
00230 // ************************************************************************* //
For further information go to www.openfoam.org