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

ThermoLookupTableInjection.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-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::ThermoLookupTableInjection
00027 
00028 Description
00029     Particle injection sources read from look-up table. Each row corresponds to
00030     an injection site.
00031 
00032     (
00033         (x y z u v w d rho mDot T cp)
00034     );
00035 
00036     where:
00037         x, y, z = global cartesian co-ordinates [m]
00038         u, v, w = global cartesian velocity components [m/s]
00039         d       = diameter [m]
00040         rho     = density [kg/m3]
00041         mDot    = mass flow rate [kg/m3]
00042         T       = temperature [K]
00043         cp      = specific heat capacity [J/kg/K]
00044 
00045 SourceFiles
00046     ThermoLookupTableInjection.C
00047 
00048 \*---------------------------------------------------------------------------*/
00049 
00050 #ifndef ThermoLookupTableInjection_H
00051 #define ThermoLookupTableInjection_H
00052 
00053 #include "InjectionModel.H"
00054 #include "pdf.H"
00055 
00056 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00057 
00058 namespace Foam
00059 {
00060 
00061 /*---------------------------------------------------------------------------*\
00062                 Class ThermoLookupTableInjection Declaration
00063 \*---------------------------------------------------------------------------*/
00064 
00065 template<class CloudType>
00066 class ThermoLookupTableInjection
00067 :
00068     public InjectionModel<CloudType>
00069 {
00070     // Private data
00071 
00072         //- Name of file containing injector/parcel data
00073         const word inputFileName_;
00074 
00075         //- Injection duration - common to all injection sources
00076         const scalar duration_;
00077 
00078         //- Number of parcels per injector - common to all injection sources
00079         const label nParcelsPerSecond_;
00080 
00081         //- List of parcel position per injector / [m]
00082         List<point> x_;
00083 
00084         //- List of parcel velocity per injector / [m]
00085         List<vector> U_;
00086 
00087         //- List of parcel diameter per injector / [m]
00088         List<scalar> d_;
00089 
00090         //- List of parcel fluid density pre injector / [kg/m3]
00091         List<scalar> rho_;
00092 
00093         //- List of parcel injection mass flow per injector / [kg/s]
00094         List<scalar> mDot_;
00095 
00096         //- List of parcel temperature flow per injector / [K]
00097         List<scalar> T_;
00098 
00099         //- List of parcel specific heat capacity per injector / [J/kg/K]
00100         List<scalar> cp_;
00101 
00102         //- List of injector cells per injector
00103         List<label> injectorCells_;
00104 
00105         //- Number of columns expected in input file
00106         static label INPUT_FILE_COLS;
00107 
00108 
00109 protected:
00110 
00111     // Protected member functions
00112 
00113         //- Number of parcels to introduce over the time step relative to SOI
00114         label parcelsToInject
00115         (
00116             const scalar time0,
00117             const scalar time1
00118         ) const;
00119 
00120         //- Volume of parcels to introduce over the time step relative to SOI
00121         scalar volumeToInject
00122         (
00123             const scalar time0,
00124             const scalar time1
00125         ) const;
00126 
00127 
00128 public:
00129 
00130     //- Runtime type information
00131     TypeName("ThermoLookupTableInjection");
00132 
00133 
00134     // Constructors
00135 
00136         //- Construct from dictionary
00137         ThermoLookupTableInjection
00138         (
00139             const dictionary& dict,
00140             CloudType& owner
00141         );
00142 
00143 
00144     //- Destructor
00145     virtual ~ThermoLookupTableInjection();
00146 
00147 
00148     // Member Functions
00149 
00150         //- Flag to indicate whether model activates injection model
00151         bool active() const;
00152 
00153         //- Return the end-of-injection time
00154         scalar timeEnd() const;
00155 
00156 
00157         // Injection geometry
00158 
00159             //- Set the injection position and owner cell
00160             virtual void setPositionAndCell
00161             (
00162                 const label parcelI,
00163                 const label nParcels,
00164                 const scalar time,
00165                 vector& position,
00166                 label& cellOwner
00167             );
00168 
00169             //- Set the parcel properties
00170             virtual void setProperties
00171             (
00172                 const label parcelI,
00173                 const label nParcels,
00174                 const scalar time,
00175                 typename CloudType::parcelType& parcel
00176             );
00177 
00178             //- Flag to identify whether model fully describes the parcel
00179             virtual bool fullyDescribed() const
00180             {
00181                 return true;
00182             }
00183 
00184             //- Return flag to identify whether or not injection of parcelI is
00185             //  permitted
00186             virtual bool validInjection(const label parcelI);
00187 };
00188 
00189 
00190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00191 
00192 } // End namespace Foam
00193 
00194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00195 
00196 #ifdef NoRepository
00197 #   include "ThermoLookupTableInjection.C"
00198 #endif
00199 
00200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00201 
00202 #endif
00203 
00204 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd