FreeFOAM The Cross-Platform CFD Toolkit
ThermoLookupTableInjection.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::ThermoLookupTableInjection
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 // injector 1
33  (x y z) (u v w) d rho mDot T cp // injector 2
34  ...
35  (x y z) (u v w) d rho mDot T cp // 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 
47 SourceFiles
48  ThermoLookupTableInjection.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef ThermoLookupTableInjection_H
53 #define ThermoLookupTableInjection_H
54 
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace Foam
61 {
62 
63 /*---------------------------------------------------------------------------*\
64  Class ThermoLookupTableInjection Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 template<class CloudType>
69 :
70  public InjectionModel<CloudType>
71 {
72  // Private data
73 
74  //- Name of file containing injector/parcel data
75  const word inputFileName_;
76 
77  //- Injection duration - common to all injection sources
78  const scalar duration_;
79 
80  //- Number of parcels per injector - common to all injection sources
81  const label nParcelsPerSecond_;
82 
83  //- List of injectors
85 
86  //- List of injector cells per injector
87  List<label> injectorCells_;
88 
89 
90 protected:
91 
92  // Protected member functions
93 
94  //- Number of parcels to introduce over the time step relative to SOI
95  label parcelsToInject
96  (
97  const scalar time0,
98  const scalar time1
99  ) const;
100 
101  //- Volume of parcels to introduce over the time step relative to SOI
102  scalar volumeToInject
103  (
104  const scalar time0,
105  const scalar time1
106  ) const;
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("ThermoLookupTableInjection");
113 
114 
115  // Constructors
116 
117  //- Construct from dictionary
119  (
120  const dictionary& dict,
121  CloudType& owner
122  );
123 
124 
125  //- Destructor
126  virtual ~ThermoLookupTableInjection();
127 
128 
129  // Member Functions
130 
131  //- Flag to indicate whether model activates injection model
132  bool active() const;
133 
134  //- Return the end-of-injection time
135  scalar timeEnd() const;
136 
137 
138  // Injection geometry
139 
140  //- Set the injection position and owner cell
141  virtual void setPositionAndCell
142  (
143  const label parcelI,
144  const label nParcels,
145  const scalar time,
146  vector& position,
147  label& cellOwner
148  );
149 
150  //- Set the parcel properties
151  virtual void setProperties
152  (
153  const label parcelI,
154  const label nParcels,
155  const scalar time,
156  typename CloudType::parcelType& parcel
157  );
158 
159  //- Flag to identify whether model fully describes the parcel
160  virtual bool fullyDescribed() const
161  {
162  return true;
163  }
164 
165  //- Return flag to identify whether or not injection of parcelI is
166  // permitted
167  virtual bool validInjection(const label parcelI);
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #ifdef NoRepository
179 #endif
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************ vim: set sw=4 sts=4 et: ************************ //