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

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