1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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::KinematicLookupTableInjection
28 Particle injection sources read from look-up table. Each row corresponds to
32 (x y z) (u v w) d rho mDot // injector 1
33 (x y z) (u v w) d rho mDot // injector 2
35 (x y z) (u v w) d rho mDot // 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]
46 KinematicLookupTableInjection.C
48 \*---------------------------------------------------------------------------*/
50 #ifndef KinematicLookupTableInjection_H
51 #define KinematicLookupTableInjection_H
53 #include "InjectionModel.H"
54 #include "kinematicParcelInjectionDataIOList.H"
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 /*---------------------------------------------------------------------------*\
62 Class KinematicLookupTableInjection Declaration
63 \*---------------------------------------------------------------------------*/
65 template<class CloudType>
66 class KinematicLookupTableInjection
68 public InjectionModel<CloudType>
72 //- Name of file containing injector/parcel data
73 const word inputFileName_;
75 //- Injection duration - common to all injection sources
76 const scalar duration_;
78 //- Number of parcels per injector - common to all injection sources
79 const scalar parcelsPerSecond_;
82 kinematicParcelInjectionDataIOList injectors_;
84 //- List of cell labels corresponding to injector positions
85 labelList injectorCells_;
87 //- List of tetFace labels corresponding to injector positions
88 labelList injectorTetFaces_;
90 //- List of tetPt labels corresponding to injector positions
91 labelList injectorTetPts_;
96 //- Runtime type information
97 TypeName("kinematicLookupTableInjection");
102 //- Construct from dictionary
103 KinematicLookupTableInjection(const dictionary& dict, CloudType& owner);
106 KinematicLookupTableInjection
108 const KinematicLookupTableInjection<CloudType>& im
111 //- Construct and return a clone
112 virtual autoPtr<InjectionModel<CloudType> > clone() const
114 return autoPtr<InjectionModel<CloudType> >
116 new KinematicLookupTableInjection<CloudType>(*this)
122 virtual ~KinematicLookupTableInjection();
127 //- Return the end-of-injection time
128 scalar timeEnd() const;
130 //- Number of parcels to introduce relative to SOI
131 virtual label parcelsToInject(const scalar time0, const scalar time1);
133 //- Volume of parcels to introduce relative to SOI
134 virtual scalar volumeToInject(const scalar time0, const scalar time1);
137 // Injection geometry
139 //- Set the injection position and owner cell, tetFace and tetPt
140 virtual void setPositionAndCell
143 const label nParcels,
151 //- Set the parcel properties
152 virtual void setProperties
155 const label nParcels,
157 typename CloudType::parcelType& parcel
160 //- Flag to identify whether model fully describes the parcel
161 virtual bool fullyDescribed() const;
163 //- Return flag to identify whether or not injection of parcelI is
165 virtual bool validInjection(const label parcelI);
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 } // End namespace Foam
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 # include "KinematicLookupTableInjection.C"
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 // ************************************************************************* //