initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / Reacting / InjectionModel / ReactingLookupTableInjection / ReactingLookupTableInjection.H
blobf8b6546d5ba203a9dad0b28a2463bc1a1137f790
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::ReactingLookupTableInjection
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 T cp Y0..YN)
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]
42         T       = temperature [K]
43         cp      = specific heat capacity [J/kg/K]
45 SourceFiles
46     ReactingLookupTableInjection.C
48 \*---------------------------------------------------------------------------*/
50 #ifndef ReactingLookupTableInjection_H
51 #define ReactingLookupTableInjection_H
53 #include "InjectionModel.H"
54 #include "pdf.H"
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 namespace Foam
61 /*---------------------------------------------------------------------------*\
62                 Class ReactingLookupTableInjection Declaration
63 \*---------------------------------------------------------------------------*/
65 template<class CloudType>
66 class ReactingLookupTableInjection
68     public InjectionModel<CloudType>
70     // Private data
72         //- Name of file containing injector/parcel data
73         const word inputFileName_;
75         //- Injection duration - common to all injection sources
76         const scalar duration_;
78         //- Number of parcels per injector - common to all injection sources
79         const label nParcelsPerSecond_;
81         //- List of parcel position per injector / [m]
82         List<point> x_;
84         //- List of parcel velocity per injector / [m]
85         List<vector> U_;
87         //- List of parcel diameter per injector / [m]
88         List<scalar> d_;
90         //- List of parcel fluid density pre injector / [kg/m3]
91         List<scalar> rho_;
93         //- List of parcel injection mass flow per injector / [kg/s]
94         List<scalar> mDot_;
96         //- List of parcel temperature flow per injector / [K]
97         List<scalar> T_;
99         //- List of parcel specific heat capacity per injector / [J/kg/K]
100         List<scalar> cp_;
102         //- List of parcel specie mass fractions per injector / []
103         List<scalarList> Y_;
105         //- List of injector cells per injector
106         List<label> injectorCells_;
108         //- Number of columns expected in input file
109         static label INPUT_FILE_COLS;
112 protected:
114     // Protected member functions
116         //- Number of parcels to introduce over the time step relative to SOI
117         label parcelsToInject
118         (
119             const scalar time0,
120             const scalar time1
121         ) const;
123         //- Volume of parcels to introduce over the time step relative to SOI
124         scalar volumeToInject
125         (
126             const scalar time0,
127             const scalar time1
128         ) const;
131 public:
133     //- Runtime type information
134     TypeName("ReactingLookupTableInjection");
137     // Constructors
139         //- Construct from dictionary
140         ReactingLookupTableInjection
141         (
142             const dictionary& dict,
143             CloudType& owner
144         );
147     //- Destructor
148     virtual ~ReactingLookupTableInjection();
151     // Member Functions
153         //- Flag to indicate whether model activates injection model
154         bool active() const;
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
164             (
165                 const label parcelI,
166                 const label nParcels,
167                 const scalar time,
168                 vector& position,
169                 label& cellOwner
170             );
172             //- Set the parcel properties
173             virtual void setProperties
174             (
175                 const label parcelI,
176                 const label nParcels,
177                 const scalar time,
178                 typename CloudType::parcelType& parcel
179             );
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
185             //  permitted
186             virtual bool validInjection(const label parcelI);
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 } // End namespace Foam
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 #ifdef NoRepository
197 #   include "ReactingLookupTableInjection.C"
198 #endif
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 #endif
204 // ************************************************************************* //