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/>.
30 - Total mass to inject
33 - Initial parcel velocity
34 - Injection volume flow rate
35 - Parcel diameters obtained by distribution model
36 - Parcels injected at cell centres adjacent to patch
41 \*---------------------------------------------------------------------------*/
43 #ifndef PatchInjection_H
44 #define PatchInjection_H
46 #include "InjectionModel.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 class distributionModel;
58 /*---------------------------------------------------------------------------*\
59 Class PatchInjection Declaration
60 \*---------------------------------------------------------------------------*/
62 template<class CloudType>
65 public InjectionModel<CloudType>
70 const word patchName_;
75 //- Injection duration [s]
76 const scalar duration_;
78 //- Number of parcels to introduce per second []
79 const label parcelsPerSecond_;
81 //- Initial parcel velocity [m/s]
84 //- Flow rate profile relative to SOI []
85 const autoPtr<DataEntry<scalar> > flowRateProfile_;
87 //- Parcel size distribution model
88 const autoPtr<distributionModels::distributionModel> sizeDistribution_;
90 //- List of cell labels corresponding to injector positions
91 labelList cellOwners_;
93 //- Fraction of injection controlled by this processor
99 //- Runtime type information
100 TypeName("patchInjection");
105 //- Construct from dictionary
106 PatchInjection(const dictionary& dict, CloudType& owner);
109 PatchInjection(const PatchInjection<CloudType>& im);
111 //- Construct and return a clone
112 virtual autoPtr<InjectionModel<CloudType> > clone() const
114 return autoPtr<InjectionModel<CloudType> >
116 new PatchInjection<CloudType>(*this)
122 virtual ~PatchInjection();
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 virtual void setProperties
154 const label nParcels,
156 typename CloudType::parcelType& parcel
159 //- Flag to identify whether model fully describes the parcel
160 virtual bool fullyDescribed() const;
162 //- Return flag to identify whether or not injection of parcelI is
164 virtual bool validInjection(const label parcelI);
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 } // End namespace Foam
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 # include "PatchInjection.C"
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 // ************************************************************************* //