1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 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 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
30 Templated injection model class
36 \*---------------------------------------------------------------------------*/
38 #ifndef InjectionModel_H
39 #define InjectionModel_H
41 #include "IOdictionary.H"
43 #include "runTimeSelectionTables.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class InjectionModel Declaration
52 \*---------------------------------------------------------------------------*/
54 template<class CloudType>
60 //- The cloud dictionary
61 const dictionary& dict_;
63 // Reference to the owner cloud class
66 //- The coefficients dictionary
67 const dictionary coeffDict_;
74 // Global injection properties
76 //- Start of injection [s]
79 //- Total volume of parcels to introduce [m^3]
80 // Initialised in the individual injection models
84 // Injection properties per Lagrangian time step
86 //- Time at start of injection time step [s]
89 //- Number of parcels to introduce []
92 //- Volume of parcels to introduce [m^3]
96 // Protected member functions
98 //- Number of parcels to introduce over the time step
99 virtual label nParcelsToInject
105 //- Volume of parcels to introduce over the time step
106 virtual scalar volumeToInject
115 //- Runtime type information
116 TypeName("InjectionModel");
118 //- Declare runtime constructor selection table
119 declareRunTimeSelectionTable
125 const dictionary& dict,
134 //- Construct from dictionary
137 const dictionary& dict,
145 virtual ~InjectionModel();
150 static autoPtr<InjectionModel<CloudType> > New
152 const dictionary& dict,
159 //- Return const access the owner cloud object
160 const CloudType& owner() const;
162 //- Return non-const access the owner cloud object for manipulation
165 //- Return the dictionary
166 const dictionary& dict() const;
168 //- Return the coefficients dictionary
169 const dictionary& coeffDict() const;
174 //- Flag to indicate whether model activates injection model
175 virtual bool active() const = 0;
178 // Global information
180 //- Return the start-of-injection time
181 scalar timeStart() const;
183 //- Return the total volume to be injected across the event
184 scalar volumeTotal() const;
186 //- Return the end-of-injection time
187 virtual scalar timeEnd() const = 0;
190 // Per Lagrangian time step properties
192 //- Determine properties for next time step/injection interval
193 void prepareForNextTimeStep
199 //- Return the number of parcels to introduce
200 label nParcels() const;
202 //- Return the volume of parcels to introduce
203 scalar volume() const;
205 //- Return the volume fraction to introduce
206 scalar volumeFraction() const;
209 // Injection geometry
211 //- Return the injection position
212 virtual vector position
216 const polyMeshInfo& meshInfo
219 //- Return the velocity of the parcel to introduce at a time
220 virtual vector velocity
224 const polyMeshInfo& meshInfo
227 //- Return the diameter of the parcel to introduce at a time
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
238 } // End namespace Foam
240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 #define makeInjectionModel(CloudType) \
244 defineNamedTemplateTypeNameAndDebug(InjectionModel<CloudType>, 0); \
246 defineTemplateRunTimeSelectionTable(InjectionModel<CloudType>, dictionary);
249 #define makeInjectionModelType(SS, CloudType, ParcelType) \
251 defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \
253 InjectionModel<CloudType<ParcelType> >:: \
254 adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \
255 add##SS##CloudType##ParcelType##ConstructorToTable_;
258 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
261 # include "InjectionModel.C"
264 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
268 // ************************************************************************* //