OpenFOAM logo
Open Source CFD Toolkit

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