initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / Kinematic / InjectionModel / ManualInjection / ManualInjection.H
blobb04fee48b58ce72104de017c4ff5660f89bc5bc5
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::ManualInjection
28 Description
29     Manual injection
31     - User specifies
32       - Total mass to inject
33       - Parcel positions in file @c positionsFile
34       - Initial parcel velocity
35     - Parcel diameters obtained by PDF model
36     - All parcels introduced at SOI
38 SourceFiles
39     ManualInjection.C
41 \*---------------------------------------------------------------------------*/
43 #ifndef ManualInjection_H
44 #define ManualInjection_H
46 #include "InjectionModel.H"
47 #include "pdf.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace Foam
54 /*---------------------------------------------------------------------------*\
55                           Class ManualInjection Declaration
56 \*---------------------------------------------------------------------------*/
58 template<class CloudType>
59 class ManualInjection
61     public InjectionModel<CloudType>
63     // Private data
65         //- Name of file containing positions data
66         const word positionsFile_;
68         //- Field of parcel positions
69         vectorIOField positions_;
71         //- Field of parcel diameters
72         scalarList diameters_;
74         //- Initial parcel velocity
75         const vector U0_;
77         //- Parcel size PDF model
78         const autoPtr<pdf> parcelPDF_;
80         //- Number of particles represented by each parcel
81         scalar nParticlesPerParcel_;
84 protected:
86     // Protected member functions
88         //- Number of parcels to introduce over the time step relative to SOI
89         label parcelsToInject
90         (
91             const scalar time0,
92             const scalar time1
93         ) const;
95         //- Volume of parcels to introduce over the time step relative to SOI
96         scalar volumeToInject
97         (
98             const scalar time0,
99             const scalar time1
100         ) const;
103 public:
105     //- Runtime type information
106     TypeName("ManualInjection");
109     // Constructors
111         //- Construct from dictionary
112         ManualInjection
113         (
114             const dictionary& dict,
115             CloudType& owner
116         );
119     //- Destructor
120     virtual ~ManualInjection();
123     // Member Functions
125         //- Flag to indicate whether model activates injection model
126         bool active() const;
128         //- Return the end-of-injection time
129         scalar timeEnd() const;
132         // Injection geometry
134             //- Set the injection position and owner cell
135             virtual void setPositionAndCell
136             (
137                 const label parcelI,
138                 const label nParcels,
139                 const scalar time,
140                 vector& position,
141                 label& cellOwner
142             );
144             //- Set the parcel properties
145             virtual void setProperties
146             (
147                 const label parcelI,
148                 const label nParcels,
149                 const scalar time,
150                 typename CloudType::parcelType& parcel
151             );
153             //- Flag to identify whether model fully describes the parcel
154             virtual bool fullyDescribed() const;
156             //- Return flag to identify whether or not injection of parcelI is
157             //  permitted
158             virtual bool validInjection(const label parcelI);
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 } // End namespace Foam
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 #ifdef NoRepository
169 #   include "ManualInjection.C"
170 #endif
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 #endif
176 // ************************************************************************* //