1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::FieldActivatedInjection
29 Injection at specified positions, with the conditions:
31 - for injection to be allowed
33 factor*referenceField[cellI] >= thresholdField[cellI]
36 - referenceField is the field used to supply the look-up values
37 - thresholdField supplies the values beyond which the injection is
40 - limited to a user-supllied number of injections per injector location
43 FieldActivatedInjection.C
45 \*---------------------------------------------------------------------------*/
47 #ifndef FieldActivatedInjection_H
48 #define FieldActivatedInjection_H
50 #include "InjectionModel.H"
52 #include "volFieldsFwd.H"
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 /*---------------------------------------------------------------------------*\
60 Class FieldActivatedInjection Declaration
61 \*---------------------------------------------------------------------------*/
63 template<class CloudType>
64 class FieldActivatedInjection
66 public InjectionModel<CloudType>
72 //- Factor to apply to reference field
76 const volScalarField& referenceField_;
79 const volScalarField& thresholdField_;
82 // Injector properties
84 //- Name of file containing positions data
85 const word positionsFile_;
87 //- Field of injector (x,y,z) positions
88 vectorIOField positions_;
90 //- Field of cell labels corresponding to injector positions
91 labelList injectorCells_;
93 //- Number of parcels per injector
94 const label nParcelsPerInjector_;
96 //- Field of number of parcels injected for each injector
97 labelList nParcelsInjected_;
102 //- Initial parcel velocity
105 //- Field of parcel diameters
106 scalarList diameters_;
108 //- Parcel size PDF model
109 const autoPtr<pdf> parcelPDF_;
114 // Protected member functions
116 //- Number of parcels to introduce over the time step relative to SOI
117 label parcelsToInject
123 //- Volume of parcels to introduce over the time step relative to SOI
124 scalar volumeToInject
133 //- Runtime type information
134 TypeName("FieldActivatedInjection");
139 //- Construct from dictionary
140 FieldActivatedInjection
142 const dictionary& dict,
148 virtual ~FieldActivatedInjection();
153 //- Flag to indicate whether model activates injection model
156 //- Return the end-of-injection time
157 scalar timeEnd() const;
160 // Injection geometry
162 //- Set the injection position and owner cell
163 virtual void setPositionAndCell
166 const label nParcels,
172 //- Set the parcel properties
173 virtual void setProperties
176 const label nParcels,
178 typename CloudType::parcelType& parcel
181 //- Flag to identify whether model fully describes the parcel
182 virtual bool fullyDescribed() const;
184 //- Return flag to identify whether or not injection of parcelI is
186 virtual bool validInjection(const label parcelI);
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 } // End namespace Foam
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 # include "FieldActivatedInjection.C"
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 // ************************************************************************* //