ReactingMultiphaseLookupTableInjection.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) 2011-2013 OpenFOAM Foundation
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::ReactingMultiphaseLookupTableInjection
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..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
33  (x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
34  ...
35  (x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
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(3) = total mass fraction of gas (Y0), liquid (Y1), solid (Y3)
47  Yg(Ngas) = mass fractions of gaseous components
48  Yl(Nliq) = mass fractions of liquid components
49  Ys(Nsld) = mass fractions of solid components
50 
51 SourceFiles
52  ReactingMultiphaseLookupTableInjection.C
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef ReactingMultiphaseLookupTableInjection_H
57 #define ReactingMultiphaseLookupTableInjection_H
58 
59 #include "InjectionModel.H"
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class ReactingMultiphaseLookupTableInjection Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 template<class CloudType>
73 :
74  public InjectionModel<CloudType>
75 {
76  // Private data
77 
78  //- Name of file containing injector/parcel data
79  const word inputFileName_;
80 
81  //- Injection duration - common to all injection sources
82  scalar duration_;
83 
84  //- Number of parcels per injector - common to all injection sources
85  const scalar parcelsPerSecond_;
86 
87  //- Flag to indicate to randomise injection positions
88  bool randomise_;
89 
90  //- List of injectors
92 
93  //- List of cell labels corresoponding to injector positions
95 
96  //- List of tetFace labels corresoponding to injector positions
98 
99  //- List of tetPt labels corresoponding to injector positions
101 
102 
103 public:
104 
105  //- Runtime type information
106  TypeName("reactingMultiphaseLookupTableInjection");
107 
108 
109  // Constructors
110 
111  //- Construct from dictionary
113  (
114  const dictionary& dict,
115  CloudType& owner,
116  const word& modelName
117  );
118 
119  //- Construct copy
121  (
123  );
124 
125  //- Construct and return a clone
126  virtual autoPtr<InjectionModel<CloudType> > clone() const
127  {
129  (
131  );
132  }
133 
134 
135  //- Destructor
137 
138 
139  // Member Functions
140 
141  //- Set injector locations when mesh is updated
142  virtual void updateMesh();
143 
144  //- Return the end-of-injection time
145  scalar timeEnd() const;
146 
147  //- Number of parcels to introduce relative to SOI
148  virtual label parcelsToInject(const scalar time0, const scalar time1);
149 
150  //- Volume of parcels to introduce relative to SOI
151  virtual scalar volumeToInject(const scalar time0, const scalar time1);
152 
153 
154  // Injection geometry
155 
156  //- Set the injection position and owner cell, tetFace and tetPt
157  virtual void setPositionAndCell
158  (
159  const label parcelI,
160  const label nParcels,
161  const scalar time,
162  vector& position,
163  label& cellOwner,
164  label& tetFaceI,
165  label& tetPtI
166  );
167 
168  //- Set the parcel properties
169  virtual void setProperties
170  (
171  const label parcelI,
172  const label nParcels,
173  const scalar time,
174  typename CloudType::parcelType& parcel
175  );
176 
177  //- Flag to identify whether model fully describes the parcel
178  virtual bool fullyDescribed() const;
179 
180  //- Return flag to identify whether or not injection of parcelI is
181  // permitted
182  virtual bool validInjection(const label parcelI);
183 };
184 
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 } // End namespace Foam
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #ifdef NoRepository
194 #endif
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #endif
199 
200 // ************************************************************************* //
Foam::ReactingMultiphaseLookupTableInjection::inputFileName_
const word inputFileName_
Name of file containing injector/parcel data.
Definition: ReactingMultiphaseLookupTableInjection.H:78
Foam::ReactingMultiphaseLookupTableInjection::parcelsToInject
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
Definition: ReactingMultiphaseLookupTableInjection.C:138
ReactingMultiphaseLookupTableInjection.C
Foam::ReactingMultiphaseLookupTableInjection::~ReactingMultiphaseLookupTableInjection
virtual ~ReactingMultiphaseLookupTableInjection()
Destructor.
Definition: ReactingMultiphaseLookupTableInjection.C:104
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::ReactingMultiphaseLookupTableInjection::ReactingMultiphaseLookupTableInjection
ReactingMultiphaseLookupTableInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Definition: ReactingMultiphaseLookupTableInjection.C:33
Foam::ReactingMultiphaseLookupTableInjection::setPositionAndCell
virtual void setPositionAndCell(const label parcelI, const label nParcels, const scalar time, vector &position, label &cellOwner, label &tetFaceI, label &tetPtI)
Set the injection position and owner cell, tetFace and tetPt.
Definition: ReactingMultiphaseLookupTableInjection.C:177
Foam::InjectionModel
Templated injection model class.
Definition: InjectionModel.H:67
Foam::CloudSubModelBase::owner
const CloudType & owner() const
Return const access to the owner cloud.
Definition: CloudSubModelBase.C:103
Foam::ReactingMultiphaseLookupTableInjection::updateMesh
virtual void updateMesh()
Set injector locations when mesh is updated.
Definition: ReactingMultiphaseLookupTableInjection.C:111
Foam::ReactingMultiphaseLookupTableInjection::clone
virtual autoPtr< InjectionModel< CloudType > > clone() const
Construct and return a clone.
Definition: ReactingMultiphaseLookupTableInjection.H:125
Foam::subModelBase::modelName
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
InjectionModel.H
Foam::ReactingMultiphaseLookupTableInjection::volumeToInject
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
Definition: ReactingMultiphaseLookupTableInjection.C:157
reactingMultiphaseParcelInjectionDataIOList.H
Foam::ReactingMultiphaseLookupTableInjection::fullyDescribed
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
Definition: ReactingMultiphaseLookupTableInjection.C:247
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::subModelBase::dict
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
Foam::ReactingMultiphaseLookupTableInjection::timeEnd
scalar timeEnd() const
Return the end-of-injection time.
Definition: ReactingMultiphaseLookupTableInjection.C:129
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Foam::ReactingMultiphaseLookupTableInjection::parcelsPerSecond_
const scalar parcelsPerSecond_
Number of parcels per injector - common to all injection sources.
Definition: ReactingMultiphaseLookupTableInjection.H:84
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::ReactingMultiphaseLookupTableInjection::TypeName
TypeName("reactingMultiphaseLookupTableInjection")
Runtime type information.
Foam::ReactingMultiphaseLookupTableInjection::randomise_
bool randomise_
Flag to indicate to randomise injection positions.
Definition: ReactingMultiphaseLookupTableInjection.H:87
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::ReactingMultiphaseLookupTableInjection::injectors_
reactingMultiphaseParcelInjectionDataIOList injectors_
List of injectors.
Definition: ReactingMultiphaseLookupTableInjection.H:90
Foam::ReactingMultiphaseLookupTableInjection::setProperties
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
Definition: ReactingMultiphaseLookupTableInjection.C:207
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::ReactingMultiphaseLookupTableInjection::duration_
scalar duration_
Injection duration - common to all injection sources.
Definition: ReactingMultiphaseLookupTableInjection.H:81
Foam::IOList< reactingMultiphaseParcelInjectionData >
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
Foam::ReactingMultiphaseLookupTableInjection
Particle injection sources read from look-up table. Each row corresponds to an injection site.
Definition: ReactingMultiphaseLookupTableInjection.H:71
Foam::ReactingMultiphaseLookupTableInjection::injectorCells_
labelList injectorCells_
List of cell labels corresoponding to injector positions.
Definition: ReactingMultiphaseLookupTableInjection.H:93
Foam::ReactingMultiphaseLookupTableInjection::injectorTetPts_
labelList injectorTetPts_
List of tetPt labels corresoponding to injector positions.
Definition: ReactingMultiphaseLookupTableInjection.H:99
Foam::ReactingMultiphaseLookupTableInjection::injectorTetFaces_
labelList injectorTetFaces_
List of tetFace labels corresoponding to injector positions.
Definition: ReactingMultiphaseLookupTableInjection.H:96
Foam::ReactingMultiphaseLookupTableInjection::validInjection
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
Definition: ReactingMultiphaseLookupTableInjection.C:255