FreeFOAM The Cross-Platform CFD Toolkit
ReactingLookupTableInjection.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::ReactingLookupTableInjection
26 
27 Description
28  Particle injection sources read from look-up table. Each row corresponds to
29  an injection site.
30 
31  (
32  (x y z) (u v w) d rho mDot T cp (Y0..YN) // injector 1
33  (x y z) (u v w) d rho mDot T cp (Y0..YN) // injector 2
34  ...
35  (x y z) (u v w) d rho mDot T cp (Y0..YN) // injector N
36  );
37 
38  where:
39  x, y, z = global cartesian co-ordinates [m]
40  u, v, w = global cartesian velocity components [m/s]
41  d = diameter [m]
42  rho = density [kg/m3]
43  mDot = mass flow rate [kg/m3]
44  T = temperature [K]
45  cp = specific heat capacity [J/kg/K]
46  Y = list of mass fractions
47 
48 SourceFiles
49  ReactingLookupTableInjection.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef ReactingLookupTableInjection_H
54 #define ReactingLookupTableInjection_H
55 
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 
64 /*---------------------------------------------------------------------------*\
65  Class ReactingLookupTableInjection Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 template<class CloudType>
70 :
71  public InjectionModel<CloudType>
72 {
73  // Private data
74 
75  //- Name of file containing injector/parcel data
76  const word inputFileName_;
77 
78  //- Injection duration - common to all injection sources
79  const scalar duration_;
80 
81  //- Number of parcels per injector - common to all injection sources
82  const label nParcelsPerSecond_;
83 
84  //- List of injectors
86 
87  //- List of injector cells per injector
88  List<label> injectorCells_;
89 
90 
91 protected:
92 
93  // Protected member functions
94 
95  //- Number of parcels to introduce over the time step relative to SOI
96  label parcelsToInject
97  (
98  const scalar time0,
99  const scalar time1
100  ) const;
101 
102  //- Volume of parcels to introduce over the time step relative to SOI
103  scalar volumeToInject
104  (
105  const scalar time0,
106  const scalar time1
107  ) const;
108 
109 
110 public:
111 
112  //- Runtime type information
113  TypeName("ReactingLookupTableInjection");
114 
115 
116  // Constructors
117 
118  //- Construct from dictionary
120  (
121  const dictionary& dict,
122  CloudType& owner
123  );
124 
125 
126  //- Destructor
128 
129 
130  // Member Functions
131 
132  //- Flag to indicate whether model activates injection model
133  bool active() const;
134 
135  //- Return the end-of-injection time
136  scalar timeEnd() const;
137 
138 
139  // Injection geometry
140 
141  //- Set the injection position and owner cell
142  virtual void setPositionAndCell
143  (
144  const label parcelI,
145  const label nParcels,
146  const scalar time,
147  vector& position,
148  label& cellOwner
149  );
150 
151  //- Set the parcel properties
152  virtual void setProperties
153  (
154  const label parcelI,
155  const label nParcels,
156  const scalar time,
157  typename CloudType::parcelType& parcel
158  );
159 
160  //- Flag to identify whether model fully describes the parcel
161  virtual bool fullyDescribed() const;
162 
163  //- Return flag to identify whether or not injection of parcelI is
164  // permitted
165  virtual bool validInjection(const label parcelI);
166 };
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #ifdef NoRepository
177 #endif
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************ vim: set sw=4 sts=4 et: ************************ //