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

ReactingMultiphaseLookupTableInjection.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) 2008-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::ReactingMultiphaseLookupTableInjection
00026 
00027 Description
00028     Particle injection sources read from look-up table. Each row corresponds to
00029     an injection site.
00030 
00031     (
00032        (x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
00033        (x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
00034        ...
00035        (x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
00036     );
00037 
00038     where:
00039         x, y, z  = global cartesian co-ordinates [m]
00040         u, v, w  = global cartesian velocity components [m/s]
00041         d        = diameter [m]
00042         rho      = density [kg/m3]
00043         mDot     = mass flow rate [kg/m3]
00044         T        = temperature [K]
00045         cp       = specific heat capacity [J/kg/K]
00046         Y(3)     = total mass fraction of gas (Y0), liquid (Y1), solid (Y3)
00047         Yg(Ngas) = mass fractions of gaseous components
00048         Yl(Nliq) = mass fractions of liquid components
00049         Ys(Nsld) = mass fractions of solid components
00050 
00051 SourceFiles
00052     ReactingMultiphaseLookupTableInjection.C
00053 
00054 \*---------------------------------------------------------------------------*/
00055 
00056 #ifndef ReactingMultiphaseLookupTableInjection_H
00057 #define ReactingMultiphaseLookupTableInjection_H
00058 
00059 #include <lagrangianIntermediate/InjectionModel.H>
00060 #include "reactingMultiphaseParcelInjectionDataIOList.H"
00061 
00062 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00063 
00064 namespace Foam
00065 {
00066 
00067 /*---------------------------------------------------------------------------*\
00068            Class ReactingMultiphaseLookupTableInjection Declaration
00069 \*---------------------------------------------------------------------------*/
00070 
00071 template<class CloudType>
00072 class ReactingMultiphaseLookupTableInjection
00073 :
00074     public InjectionModel<CloudType>
00075 {
00076     // Private data
00077 
00078         //- Name of file containing injector/parcel data
00079         const word inputFileName_;
00080 
00081         //- Injection duration - common to all injection sources
00082         const scalar duration_;
00083 
00084         //- Number of parcels per injector - common to all injection sources
00085         const label nParcelsPerSecond_;
00086 
00087         //- List of injectors
00088         reactingMultiphaseParcelInjectionDataIOList injectors_;
00089 
00090         //- List of injector cells per injector
00091         List<label> injectorCells_;
00092 
00093 
00094 protected:
00095 
00096     // Protected member functions
00097 
00098         //- Number of parcels to introduce over the time step relative to SOI
00099         label parcelsToInject
00100         (
00101             const scalar time0,
00102             const scalar time1
00103         ) const;
00104 
00105         //- Volume of parcels to introduce over the time step relative to SOI
00106         scalar volumeToInject
00107         (
00108             const scalar time0,
00109             const scalar time1
00110         ) const;
00111 
00112 
00113 public:
00114 
00115     //- Runtime type information
00116     TypeName("ReactingMultiphaseLookupTableInjection");
00117 
00118 
00119     // Constructors
00120 
00121         //- Construct from dictionary
00122         ReactingMultiphaseLookupTableInjection
00123         (
00124             const dictionary& dict,
00125             CloudType& owner
00126         );
00127 
00128 
00129     //- Destructor
00130     virtual ~ReactingMultiphaseLookupTableInjection();
00131 
00132 
00133     // Member Functions
00134 
00135         //- Flag to indicate whether model activates injection model
00136         bool active() const;
00137 
00138         //- Return the end-of-injection time
00139         scalar timeEnd() const;
00140 
00141 
00142         // Injection geometry
00143 
00144             //- Set the injection position and owner cell
00145             virtual void setPositionAndCell
00146             (
00147                 const label parcelI,
00148                 const label nParcels,
00149                 const scalar time,
00150                 vector& position,
00151                 label& cellOwner
00152             );
00153 
00154             //- Set the parcel properties
00155             virtual void setProperties
00156             (
00157                 const label parcelI,
00158                 const label nParcels,
00159                 const scalar time,
00160                 typename CloudType::parcelType& parcel
00161             );
00162 
00163             //- Flag to identify whether model fully describes the parcel
00164             virtual bool fullyDescribed() const;
00165 
00166             //- Return flag to identify whether or not injection of parcelI is
00167             //  permitted
00168             virtual bool validInjection(const label parcelI);
00169 };
00170 
00171 
00172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00173 
00174 } // End namespace Foam
00175 
00176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00177 
00178 #ifdef NoRepository
00179 #   include "ReactingMultiphaseLookupTableInjection.C"
00180 #endif
00181 
00182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00183 
00184 #endif
00185 
00186 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines