1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 Foam::ThermoLookupTableInjection
28 Particle injection sources read from look-up table. Each row corresponds to
32 (x y z) (u v w) d rho mDot T cp // injector 1
33 (x y z) (u v w) d rho mDot T cp // injector 2
35 (x y z) (u v w) d rho mDot T cp // injector N
39 x, y, z = global cartesian co-ordinates [m]
40 u, v, w = global cartesian velocity components [m/s]
43 mDot = mass flow rate [kg/m3]
45 cp = specific heat capacity [J/kg/K]
48 ThermoLookupTableInjection.C
50 \*---------------------------------------------------------------------------*/
52 #ifndef ThermoLookupTableInjection_H
53 #define ThermoLookupTableInjection_H
55 #include "InjectionModel.H"
56 #include "kinematicParcelInjectionDataIOList.H"
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 /*---------------------------------------------------------------------------*\
64 Class ThermoLookupTableInjection Declaration
65 \*---------------------------------------------------------------------------*/
67 template<class CloudType>
68 class ThermoLookupTableInjection
70 public InjectionModel<CloudType>
74 //- Name of file containing injector/parcel data
75 const word inputFileName_;
77 //- Injection duration - common to all injection sources
78 const scalar duration_;
80 //- Number of parcels per injector - common to all injection sources
81 const scalar parcelsPerSecond_;
84 kinematicParcelInjectionDataIOList injectors_;
86 //- List of cell labels corresoponding to injector positions
87 labelList injectorCells_;
89 //- List of tetFace labels corresoponding to injector positions
90 labelList injectorTetFaces_;
92 //- List of tetPt labels corresoponding to injector positions
93 labelList injectorTetPts_;
98 //- Runtime type information
99 TypeName("thermoLookupTableInjection");
104 //- Construct from dictionary
105 ThermoLookupTableInjection(const dictionary& dict, CloudType& owner);
107 //- Construct copy from owner cloud and injection model
108 ThermoLookupTableInjection
111 const ThermoLookupTableInjection<CloudType>& im
114 //- Construct and return a clone using supplied owner cloud
115 virtual autoPtr<InjectionModel<CloudType> > clone() const
117 return autoPtr<InjectionModel<CloudType> >
119 new ThermoLookupTableInjection<CloudType>(*this)
125 virtual ~ThermoLookupTableInjection();
130 //- Return the end-of-injection time
131 scalar timeEnd() const;
133 //- Number of parcels to introduce relative to SOI
134 virtual label parcelsToInject(const scalar time0, const scalar time1);
136 //- Volume of parcels to introduce relative to SOI
137 virtual scalar volumeToInject(const scalar time0, const scalar time1);
141 // Injection geometry
143 //- Set the injection position and owner cell, tetFace and tetPt
144 virtual void setPositionAndCell
147 const label nParcels,
155 //- Set the parcel properties
156 virtual void setProperties
159 const label nParcels,
161 typename CloudType::parcelType& parcel
164 //- Flag to identify whether model fully describes the parcel
165 virtual bool fullyDescribed() const
170 //- Return flag to identify whether or not injection of parcelI is
172 virtual bool validInjection(const label parcelI);
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 } // End namespace Foam
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 # include "ThermoLookupTableInjection.C"
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 // ************************************************************************* //