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

definedInjector.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::definedInjector
00026 
00027 Description
00028     User specified MFR vs time and velocity vs time
00029 
00030 SourceFiles
00031     definedInjectorI.H
00032     definedInjector.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef definedInjector_H
00037 #define definedInjector_H
00038 
00039 #include <dieselSpray/injectorType.H>
00040 #include <OpenFOAM/vector.H>
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                            Class definedInjector Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class definedInjector
00052 :
00053     public injectorType
00054 {
00055 
00056 private:
00057 
00058     // Private data
00059 
00060         typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
00061 
00062         dictionary propsDict_;
00063 
00064         vector position_;
00065         vector direction_;
00066         scalar d_;
00067         scalar mass_;
00068         scalar T_;
00069         label nParcels_;
00070         scalarField X_;
00071         List<pair> massFlowRateProfile_;                         // aj
00072         List<pair> velocityProfile_;                    // aj
00073         List<pair> injectionPressureProfile_;
00074         List<pair> CdProfile_;
00075         List<pair> TProfile_;
00076         scalar averageParcelMass_;
00077 
00078         bool pressureIndependentVelocity_;
00079 
00080         //- two orthogonal vectors that are also orthogonal
00081         //  to the injection direction
00082         vector tangentialInjectionVector1_, tangentialInjectionVector2_;
00083 
00084 
00085     // Private Member Functions
00086 
00087         //- Disallow default bitwise copy construct
00088         definedInjector(const definedInjector&);
00089 
00090         //- Disallow default bitwise assignment
00091         void operator=(const definedInjector&);
00092 
00093         //- Create two vectors orthonoal to each other
00094         //  and the injection vector
00095         void setTangentialVectors();
00096 
00097         //- Return the fraction of the total injected liquid
00098         scalar fractionOfInjection(const scalar time) const;
00099 
00100         //- Return the instantaneous injection velocity
00101         scalar injectionVelocity(const scalar) const;
00102 
00103 public:
00104 
00105     //- Runtime type information
00106     TypeName("definedInjector");
00107 
00108 
00109     // Constructors
00110 
00111         //- Construct from components
00112         definedInjector
00113         (
00114             const Time& t,
00115             const dictionary& dict
00116         );
00117 
00118 
00119     // Destructor
00120 
00121         ~definedInjector();
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 label n) const;
00135 
00136         //- Return the injection position
00137         vector position
00138         (
00139             const label n,
00140             const scalar time,
00141             const bool twoD,
00142             const scalar angleOfWedge,
00143             const vector& axisOfSymmetry,
00144             const vector& axisOfWedge,
00145             const vector& axisOfWedgeNormal,
00146             Random& rndGen
00147         ) const;
00148     
00149         //- Return the number of holes
00150         label nHoles() const;
00151 
00152         //- Return the injector diameter
00153         scalar d() const;
00154 
00155         //- Return the injection direction
00156         const vector& direction
00157         (
00158             const label i,
00159             const scalar time
00160         ) const;
00161 
00162         //- Return the mass of the injected particle
00163         scalar mass
00164         (
00165             const scalar t0,
00166             const scalar t1,
00167             const bool twoD,
00168             const scalar angleOfWedge
00169         ) const;
00170 
00171         //- Return the mass injected by the injector
00172         scalar mass() const;
00173 
00174         //- Return the fuel mass fractions of the injected particle
00175         const scalarField& X() const;
00176 
00177         //- Return the temperature profile of the injected particle
00178         List<pair> T() const;
00179 
00180         //- Return the temperature of the injected particle
00181         scalar T(const scalar time) const;
00182 
00183         //- Return the start-of-injection time
00184         scalar tsoi() const;
00185 
00186         //- Return the end-of-injection time
00187         scalar teoi() const;
00188 
00189         //- Return the injected liquid mass
00190         scalar injectedMass(const scalar t) const;
00191 
00192         List<pair> massFlowRateProfile() const
00193         {
00194             return massFlowRateProfile_;
00195         }
00196 
00197         scalar massFlowRate(const scalar time) const;
00198 
00199         List<pair> injectionPressureProfile() const
00200         {
00201             return injectionPressureProfile_;
00202         }
00203     
00204         scalar injectionPressure(const scalar time) const;
00205 
00206         List<pair> velocityProfile() const
00207         {
00208             return velocityProfile_;
00209         }
00210         
00211         scalar velocity(const scalar time) const;
00212 
00213         List<pair> CdProfile() const
00214         {
00215             return CdProfile_;
00216         }
00217 
00218         scalar Cd(const scalar time) const;
00219 
00220         vector tan1(const label n) const;
00221         vector tan2(const label n) const;
00222 
00223         void correctProfiles
00224         (
00225             const liquidMixture& fuel,
00226             const scalar referencePressure
00227         );
00228 
00229         bool pressureIndependentVelocity() const
00230         {
00231             return pressureIndependentVelocity_;
00232         }
00233 
00234 };
00235 
00236 
00237 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00238 
00239 } // End namespace Foam
00240 
00241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00242 
00243 #endif
00244 
00245 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines