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

injectorType.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::injectorType
00027 
00028 Description
00029     Base class for injectors
00030 
00031 SourceFiles
00032     injectorTypeI.H
00033     injectorType.C
00034     injectorTypeIO.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef injectorType_H
00039 #define injectorType_H
00040 
00041 #include "IOdictionary.H"
00042 #include "Time.H"
00043 #include "autoPtr.H"
00044 #include "runTimeSelectionTables.H"
00045 #include "vector.H"
00046 #include "scalarField.H"
00047 #include "Random.H"
00048 #include "liquidMixture.H"
00049 
00050 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00051 
00052 namespace Foam
00053 {
00054 
00055 /*---------------------------------------------------------------------------*\
00056                            Class injectorType Declaration
00057 \*---------------------------------------------------------------------------*/
00058 
00059 class injectorType
00060 {
00061         typedef VectorSpace<Vector<scalar>, scalar, 2> pair;
00062 
00063 public:
00064 
00065     //- Runtime type information
00066     TypeName("injectorType");
00067 
00068     // Declare runtime constructor selection table
00069 
00070         declareRunTimeSelectionTable
00071         (
00072             autoPtr,
00073             injectorType,
00074             dictionary,
00075             (
00076                 const Time& t,
00077                 const dictionary& dict
00078             ),
00079             (t, dict)
00080         );
00081 
00082     
00083     // Constructors
00084 
00085         //- Construct from components
00086         injectorType
00087         (
00088             const Time& t,
00089             const dictionary& dict
00090         );
00091 
00092 
00093     // Selectors
00094 
00095         static autoPtr<injectorType> New
00096         (
00097             const Time& t,
00098             const dictionary& dict
00099         );
00100 
00101 
00102     // Destructor
00103 
00104         virtual ~injectorType();
00105 
00106 
00107     // Member Functions
00108     
00109         //- Return number of particles to inject
00110         virtual label nParcelsToInject
00111         (
00112             const scalar time0,
00113             const scalar time1
00114         ) const = 0;
00115 
00116         //- Return the injection position
00117         virtual const vector position(const label n) const = 0;
00118 
00119         //- Return the injection position
00120         virtual vector position
00121         (
00122             const label n,
00123             const scalar time,
00124             const bool twoD,
00125             const scalar angleOfWedge,
00126             const vector& axisOfSymmetry,
00127             const vector& axisOfWedge,
00128             const vector& axisOfWedgeNormal,
00129             Random& rndGen
00130         ) const = 0;
00131 
00132         //- Return the number of holes
00133         virtual label nHoles() const = 0;
00134     
00135         //- Return the injector diameter
00136         virtual scalar d() const = 0;
00137 
00138         //- Return the injection direction for hole i
00139         virtual const vector& direction
00140         (
00141             const label i, 
00142             const scalar time
00143         ) const = 0;
00144 
00145         //- Return the mass of the injected liquid between times
00146         virtual scalar mass
00147         (
00148             const scalar time0,
00149             const scalar time1,
00150             const bool twoD,
00151             const scalar angleOfWedge
00152         ) const = 0;
00153 
00154         //- Return the mass injected by the injector
00155         virtual scalar mass() const = 0;
00156 
00157         //- Return the mass flow rate profile
00158         virtual List<pair> massFlowRateProfile() const = 0;
00159 
00160         //- Return the instantaneous mass flow rate profile
00161         virtual scalar massFlowRate(const scalar time) const = 0;
00162 
00163         //- Return the pressure injection profile
00164         virtual List<pair> injectionPressureProfile() const = 0;
00165 
00166         //- Return the instantaneous injection pressure
00167         virtual scalar injectionPressure(const scalar time) const = 0;
00168 
00169         //- Return the velocity injection profile
00170         virtual List<pair> velocityProfile() const = 0;
00171 
00172         //- Return the instantaneous velocity
00173         virtual scalar velocity(const scalar time) const = 0;
00174 
00175         //- Return the discharge coefficient        
00176         virtual List<pair> CdProfile() const = 0;
00177 
00178         //- Return the instantaneous discharge coefficient
00179         virtual scalar Cd(const scalar time) const = 0;
00180 
00181         //- Return the fuel mass fractions of the injected particle
00182         virtual const scalarField& X() const = 0;
00183 
00184         //- Return the temperatue profile of the injected parcel
00185         virtual List<pair> T() const = 0;
00186 
00187         //- Return the temperatue of the injected parcel
00188         virtual scalar T(const scalar time) const = 0;
00189 
00190         //- Return the start-of-injection time
00191         virtual scalar tsoi() const = 0;
00192 
00193         //- Return the end-of-injection time
00194         virtual scalar teoi() const = 0;
00195 
00196         virtual scalar injectedMass(const scalar t) const = 0;
00197 
00198         virtual bool pressureIndependentVelocity() const = 0;
00199 
00200         //- Return a vector perpendicular to the injection direction and tan2 for hole n
00201         virtual vector tan1(const label n) const = 0;
00202 
00203         //- Return a vector perpendicular to the injection direction and tan1 for hole n
00204         virtual vector tan2(const label n) const = 0;
00205 
00206         scalar getTableValue
00207         (
00208             const List<pair>& table,
00209             const scalar value
00210         ) const;
00211 
00212         scalar integrateTable
00213         (
00214             const List<pair>& table,
00215             const scalar value
00216         ) const;
00217 
00218         scalar integrateTable
00219         (
00220             const List<pair>& table
00221         ) const;
00222 
00223         virtual void correctProfiles
00224         (
00225             const liquidMixture& fuel,
00226             const scalar referencePressure
00227         ) = 0;
00228 
00229 };
00230 
00231 
00232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00233 
00234 } // End namespace Foam
00235 
00236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00237 
00238 #endif
00239 
00240 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd