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

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