initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / Kinematic / InjectionModel / KinematicLookupTableInjection / KinematicLookupTableInjection.H
blobe076f0ea5821c417eb3be8aa0859f5d2e016d59a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2008-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::KinematicLookupTableInjection
28 Description
29     Particle injection sources read from look-up table. Each row corresponds to
30     an injection site.
32     (
33         (x y z u v w d rho mDot)
34     );
36     where:
37         x, y, z = global cartesian co-ordinates [m]
38         u, v, w = global cartesian velocity components [m/s]
39         d       = diameter [m]
40         rho     = density [kg/m3]
41         mDot    = mass flow rate [kg/m3]
43 SourceFiles
44     KinematicLookupTableInjection.C
46 \*---------------------------------------------------------------------------*/
48 #ifndef KinematicLookupTableInjection_H
49 #define KinematicLookupTableInjection_H
51 #include "InjectionModel.H"
52 #include "pdf.H"
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 namespace Foam
59 /*---------------------------------------------------------------------------*\
60                Class KinematicLookupTableInjection Declaration
61 \*---------------------------------------------------------------------------*/
63 template<class CloudType>
64 class KinematicLookupTableInjection
66     public InjectionModel<CloudType>
68     // Private data
70         //- Name of file containing injector/parcel data
71         const word inputFileName_;
73         //- Injection duration - common to all injection sources
74         const scalar duration_;
76         //- Number of parcels per injector - common to all injection sources
77         const label nParcelsPerSecond_;
79         //- List of parcel position per injector / [m]
80         List<point> x_;
82         //- List of parcel velocity per injector / [m]
83         List<vector> U_;
85         //- List of parcel diameter per injector / [m]
86         List<scalar> d_;
88         //- List of parcel fluid density pre injector / [kg/m3]
89         List<scalar> rho_;
91         //- List of parcel injection mass flow per injector / [kg/s]
92         List<scalar> mDot_;
94         //- List of injector cells per injector
95         List<label> injectorCells_;
97         //- Number of columns expected in input file
98         static label INPUT_FILE_COLS;
101 protected:
103     // Protected member functions
105         //- Number of parcels to introduce over the time step relative to SOI
106         label parcelsToInject
107         (
108             const scalar time0,
109             const scalar time1
110         ) const;
112         //- Volume of parcels to introduce over the time step relative to SOI
113         scalar volumeToInject
114         (
115             const scalar time0,
116             const scalar time1
117         ) const;
120 public:
122     //- Runtime type information
123     TypeName("KinematicLookupTableInjection");
126     // Constructors
128         //- Construct from dictionary
129         KinematicLookupTableInjection
130         (
131             const dictionary& dict,
132             CloudType& owner
133         );
136     //- Destructor
137     virtual ~KinematicLookupTableInjection();
140     // Member Functions
142         //- Flag to indicate whether model activates injection model
143         bool active() const;
145         //- Return the end-of-injection time
146         scalar timeEnd() const;
149         // Injection geometry
151             //- Set the injection position and owner cell
152             virtual void setPositionAndCell
153             (
154                 const label parcelI,
155                 const label nParcels,
156                 const scalar time,
157                 vector& position,
158                 label& cellOwner
159             );
161             //- Set the parcel properties
162             virtual void setProperties
163             (
164                 const label parcelI,
165                 const label nParcels,
166                 const scalar time,
167                 typename CloudType::parcelType& parcel
168             );
170             //- Flag to identify whether model fully describes the parcel
171             virtual bool fullyDescribed() const;
173             //- Return flag to identify whether or not injection of parcelI is
174             //  permitted
175             virtual bool validInjection(const label parcelI);
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace Foam
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 #ifdef NoRepository
186 #   include "KinematicLookupTableInjection.C"
187 #endif
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 #endif
193 // ************************************************************************* //