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