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

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-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::unitInjector
00026 
00027 Description
00028     The unit injector
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 <dieselSpray/injectorType.H>
00041 #include <OpenFOAM/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         label nParcels_;
00071         scalarField X_;
00072         List<pair> massFlowRateProfile_;
00073         List<pair> velocityProfile_;
00074         List<pair> injectionPressureProfile_;
00075         List<pair> CdProfile_;
00076         List<pair> TProfile_;
00077         scalar averageParcelMass_;
00078 
00079         bool pressureIndependentVelocity_;
00080 
00081         //- two orthogonal vectors that are also orthogonal
00082         //  to the injection direction
00083         vector tangentialInjectionVector1_, tangentialInjectionVector2_;
00084 
00085 
00086     // Private Member Functions
00087 
00088         //- Disallow default bitwise copy construct
00089         unitInjector(const unitInjector&);
00090 
00091         //- Disallow default bitwise assignment
00092         void operator=(const unitInjector&);
00093 
00094         //- Create two vectors orthonoal to each other
00095         //  and the injection vector
00096         void setTangentialVectors();
00097 
00098         //- Return the fraction of the total injected liquid
00099         scalar fractionOfInjection(const scalar time) const;
00100 
00101 
00102 public:
00103 
00104     //- Runtime type information
00105     TypeName("unitInjector");
00106 
00107 
00108     // Constructors
00109 
00110         //- Construct from components
00111         unitInjector
00112         (
00113             const Time& t,
00114             const dictionary& dict
00115         );
00116 
00117 
00118     // Destructor
00119 
00120         ~unitInjector();
00121 
00122 
00123     // Member Functions
00124 
00125         //- Return number of particles to inject
00126         label nParcelsToInject
00127         (
00128             const scalar t0,
00129             const scalar t1
00130         ) const;
00131 
00132         //- Return the injection position
00133         const vector position(const label n) const;
00134 
00135         //- Return the injection position
00136         vector position
00137         (
00138             const label n,
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 number of holes
00149         label nHoles() const;
00150 
00151         //- Return the injector diameter
00152         scalar d() const;
00153 
00154         //- Return the injection direction
00155         const vector& direction
00156         (
00157             const label i,
00158             const scalar time
00159         ) const;
00160 
00161         //- Return the mass of the injected particle
00162         scalar mass
00163         (
00164             const scalar t0,
00165             const scalar t1,
00166             const bool twoD,
00167             const scalar angleOfWedge
00168         ) const;
00169 
00170         //- Return the mass injected by the injector
00171         scalar mass() const;
00172 
00173         //- Return the fuel mass fractions of the injected particle
00174         const scalarField& X() const;
00175 
00176         //- Return the temperature profile of the injected particle
00177         List<pair> T() const;
00178 
00179         //- Return the temperature of the injected particle
00180         scalar T(const scalar time) const;
00181 
00182         //- Return the start-of-injection time
00183         scalar tsoi() const;
00184 
00185         //- Return the end-of-injection time
00186         scalar teoi() const;
00187 
00188         //- Return the injected liquid mass
00189         scalar injectedMass(const scalar t) const;
00190 
00191         List<pair> massFlowRateProfile() const
00192         {
00193             return massFlowRateProfile_;
00194         }
00195 
00196         scalar massFlowRate(const scalar time) const;
00197 
00198         List<pair> injectionPressureProfile() const
00199         {
00200             return injectionPressureProfile_;
00201         }
00202     
00203         scalar injectionPressure(const scalar time) const;
00204 
00205         List<pair> velocityProfile() const
00206         {
00207             return velocityProfile_;
00208         }
00209         
00210         scalar velocity(const scalar time) const;
00211 
00212         List<pair> CdProfile() const;
00213         scalar Cd(const scalar time) const;
00214 
00215         vector tan1(const label n) const;
00216         vector tan2(const label n) const;
00217 
00218         void correctProfiles
00219         (
00220             const liquidMixture& fuel,
00221             const scalar referencePressure
00222         );
00223 
00224         bool pressureIndependentVelocity() const
00225         {
00226             return pressureIndependentVelocity_;
00227         }
00228 
00229 };
00230 
00231 
00232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00233 
00234 } // End namespace Foam
00235 
00236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00237 
00238 #endif
00239 
00240 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines