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

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-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::definedInjector
00027 
00028 Description
00029     User specified MFR vs time and velocity vs time
00030 
00031 SourceFiles
00032     definedInjectorI.H
00033     definedInjector.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef definedInjector_H
00038 #define definedInjector_H
00039 
00040 #include "injectorType.H"
00041 #include "vector.H"
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                            Class definedInjector Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 class definedInjector
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 T_;
00070         label nParcels_;
00071         scalarField X_;
00072         List<pair> massFlowRateProfile_;                         // aj
00073         List<pair> velocityProfile_;                    // aj
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         definedInjector(const definedInjector&);
00090 
00091         //- Disallow default bitwise assignment
00092         void operator=(const definedInjector&);
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         //- Return the instantaneous injection velocity
00102         scalar injectionVelocity(const scalar) const;
00103 
00104 public:
00105 
00106     //- Runtime type information
00107     TypeName("definedInjector");
00108 
00109 
00110     // Constructors
00111 
00112         //- Construct from components
00113         definedInjector
00114         (
00115             const Time& t,
00116             const dictionary& dict
00117         );
00118 
00119 
00120     // Destructor
00121 
00122         ~definedInjector();
00123 
00124 
00125     // Member Functions
00126 
00127         //- Return number of particles to inject
00128         label nParcelsToInject
00129         (
00130             const scalar t0,
00131             const scalar t1
00132         ) const;
00133 
00134         //- Return the injection position
00135         const vector position(const label n) const;
00136 
00137         //- Return the injection position
00138         vector position
00139         (
00140             const label n,
00141             const scalar time,
00142             const bool twoD,
00143             const scalar angleOfWedge,
00144             const vector& axisOfSymmetry,
00145             const vector& axisOfWedge,
00146             const vector& axisOfWedgeNormal,
00147             Random& rndGen
00148         ) const;
00149     
00150         //- Return the number of holes
00151         label nHoles() const;
00152 
00153         //- Return the injector diameter
00154         scalar d() const;
00155 
00156         //- Return the injection direction
00157         const vector& direction
00158         (
00159             const label i,
00160             const scalar time
00161         ) const;
00162 
00163         //- Return the mass of the injected particle
00164         scalar mass
00165         (
00166             const scalar t0,
00167             const scalar t1,
00168             const bool twoD,
00169             const scalar angleOfWedge
00170         ) const;
00171 
00172         //- Return the mass injected by the injector
00173         scalar mass() const;
00174 
00175         //- Return the fuel mass fractions of the injected particle
00176         const scalarField& X() const;
00177 
00178         //- Return the temperature profile of the injected particle
00179         List<pair> T() const;
00180 
00181         //- Return the temperature of the injected particle
00182         scalar T(const scalar time) const;
00183 
00184         //- Return the start-of-injection time
00185         scalar tsoi() const;
00186 
00187         //- Return the end-of-injection time
00188         scalar teoi() const;
00189 
00190         //- Return the injected liquid mass
00191         scalar injectedMass(const scalar t) const;
00192 
00193         List<pair> massFlowRateProfile() const
00194         {
00195             return massFlowRateProfile_;
00196         }
00197 
00198         scalar massFlowRate(const scalar time) const;
00199 
00200         List<pair> injectionPressureProfile() const
00201         {
00202             return injectionPressureProfile_;
00203         }
00204     
00205         scalar injectionPressure(const scalar time) const;
00206 
00207         List<pair> velocityProfile() const
00208         {
00209             return velocityProfile_;
00210         }
00211         
00212         scalar velocity(const scalar time) const;
00213 
00214         List<pair> CdProfile() const
00215         {
00216             return CdProfile_;
00217         }
00218 
00219         scalar Cd(const scalar time) const;
00220 
00221         vector tan1(const label n) const;
00222         vector tan2(const label n) const;
00223 
00224         void correctProfiles
00225         (
00226             const liquidMixture& fuel,
00227             const scalar referencePressure
00228         );
00229 
00230         bool pressureIndependentVelocity() const
00231         {
00232             return pressureIndependentVelocity_;
00233         }
00234 
00235 };
00236 
00237 
00238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00239 
00240 } // End namespace Foam
00241 
00242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00243 
00244 #endif
00245 
00246 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd