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::KinematicLookupTableInjection 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 // injector 1 00033 (x y z) (u v w) d rho mDot // injector 2 00034 ... 00035 (x y z) (u v w) d rho mDot // injector N 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 00045 SourceFiles 00046 KinematicLookupTableInjection.C 00047 00048 \*---------------------------------------------------------------------------*/ 00049 00050 #ifndef KinematicLookupTableInjection_H 00051 #define KinematicLookupTableInjection_H 00052 00053 #include <lagrangianIntermediate/InjectionModel.H> 00054 #include <lagrangianIntermediate/kinematicParcelInjectionDataIOList.H> 00055 00056 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00057 00058 namespace Foam 00059 { 00060 00061 /*---------------------------------------------------------------------------*\ 00062 Class KinematicLookupTableInjection Declaration 00063 \*---------------------------------------------------------------------------*/ 00064 00065 template<class CloudType> 00066 class KinematicLookupTableInjection 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 injectors 00082 kinematicParcelInjectionDataIOList injectors_; 00083 00084 //- List of injector cells per injector 00085 List<label> injectorCells_; 00086 00087 00088 protected: 00089 00090 // Protected member functions 00091 00092 //- Number of parcels to introduce over the time step relative to SOI 00093 label parcelsToInject 00094 ( 00095 const scalar time0, 00096 const scalar time1 00097 ) const; 00098 00099 //- Volume of parcels to introduce over the time step relative to SOI 00100 scalar volumeToInject 00101 ( 00102 const scalar time0, 00103 const scalar time1 00104 ) const; 00105 00106 00107 public: 00108 00109 //- Runtime type information 00110 TypeName("KinematicLookupTableInjection"); 00111 00112 00113 // Constructors 00114 00115 //- Construct from dictionary 00116 KinematicLookupTableInjection 00117 ( 00118 const dictionary& dict, 00119 CloudType& owner 00120 ); 00121 00122 00123 //- Destructor 00124 virtual ~KinematicLookupTableInjection(); 00125 00126 00127 // Member Functions 00128 00129 //- Flag to indicate whether model activates injection model 00130 bool active() const; 00131 00132 //- Return the end-of-injection time 00133 scalar timeEnd() const; 00134 00135 00136 // Injection geometry 00137 00138 //- Set the injection position and owner cell 00139 virtual void setPositionAndCell 00140 ( 00141 const label parcelI, 00142 const label nParcels, 00143 const scalar time, 00144 vector& position, 00145 label& cellOwner 00146 ); 00147 00148 //- Set the parcel properties 00149 virtual void setProperties 00150 ( 00151 const label parcelI, 00152 const label nParcels, 00153 const scalar time, 00154 typename CloudType::parcelType& parcel 00155 ); 00156 00157 //- Flag to identify whether model fully describes the parcel 00158 virtual bool fullyDescribed() const; 00159 00160 //- Return flag to identify whether or not injection of parcelI is 00161 // permitted 00162 virtual bool validInjection(const label parcelI); 00163 }; 00164 00165 00166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00167 00168 } // End namespace Foam 00169 00170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00171 00172 #ifdef NoRepository 00173 # include "KinematicLookupTableInjection.C" 00174 #endif 00175 00176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00177 00178 #endif 00179 00180 // ************************ vim: set sw=4 sts=4 et: ************************ //