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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::ReactingMultiphaseLookupTableInjection
28 
29 Group
30  grpLagrangianIntermediateInjectionSubModels
31 
32 Description
33  Particle injection sources read from look-up table. Each row corresponds to
34  an injection site.
35 
36  (
37  (x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
38  (x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
39  ...
40  (x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
41  );
42 
43  where:
44  x, y, z = global cartesian coordinates [m]
45  u, v, w = global cartesian velocity components [m/s]
46  d = diameter [m]
47  rho = density [kg/m3]
48  mDot = mass flow rate [kg/s]
49  T = temperature [K]
50  cp = specific heat capacity [J/kg/K]
51  Y(3) = total mass fraction of gas (Y0), liquid (Y1), solid (Y3)
52  Yg(Ngas) = mass fractions of gaseous components
53  Yl(Nliq) = mass fractions of liquid components
54  Ys(Nsld) = mass fractions of solid components
55 
56 SourceFiles
57  ReactingMultiphaseLookupTableInjection.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef ReactingMultiphaseLookupTableInjection_H
62 #define ReactingMultiphaseLookupTableInjection_H
63 
64 #include "InjectionModel.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 /*---------------------------------------------------------------------------*\
73  Class ReactingMultiphaseLookupTableInjection Declaration
74 \*---------------------------------------------------------------------------*/
75 
76 template<class CloudType>
78 :
79  public InjectionModel<CloudType>
80 {
81  // Private data
82 
83  //- Name of file containing injector/parcel data
84  const word inputFileName_;
85 
86  //- Injection duration - common to all injection sources
87  scalar duration_;
88 
89  //- Number of parcels per injector - common to all injection sources
90  const scalar parcelsPerSecond_;
91 
92  //- Flag to indicate to randomise injection positions
93  bool randomise_;
94 
95  //- List of injectors
97 
98  //- List of cell labels corresponding to injector positions
99  labelList injectorCells_;
100 
101  //- List of tetFace labels corresponding to injector positions
102  labelList injectorTetFaces_;
103 
104  //- List of tetPt labels corresponding to injector positions
105  labelList injectorTetPts_;
106 
107 
108 public:
109 
110  //- Runtime type information
111  TypeName("reactingMultiphaseLookupTableInjection");
112 
113 
114  // Constructors
115 
116  //- Construct from dictionary
118  (
119  const dictionary& dict,
120  CloudType& owner,
121  const word& modelName
122  );
123 
124  //- Construct copy
126  (
128  );
129 
130  //- Construct and return a clone
132  {
134  (
136  );
137  }
138 
139 
140  //- Destructor
141  virtual ~ReactingMultiphaseLookupTableInjection() = default;
142 
143 
144  // Member Functions
145 
146  //- Set injector locations when mesh is updated
147  virtual void updateMesh();
148 
149  //- Return the end-of-injection time
150  scalar timeEnd() const;
151 
152  //- Number of parcels to introduce relative to SOI
153  virtual label parcelsToInject(const scalar time0, const scalar time1);
154 
155  //- Volume of parcels to introduce relative to SOI
156  virtual scalar volumeToInject(const scalar time0, const scalar time1);
157 
158 
159  // Injection geometry
160 
161  //- Set the injection position and owner cell, tetFace and tetPt
162  virtual void setPositionAndCell
163  (
164  const label parcelI,
165  const label nParcels,
166  const scalar time,
167  vector& position,
168  label& cellOwner,
169  label& tetFacei,
170  label& tetPti
171  );
172 
173  //- Set the parcel properties
174  virtual void setProperties
175  (
176  const label parcelI,
177  const label nParcels,
178  const scalar time,
179  typename CloudType::parcelType& parcel
180  );
181 
182  //- Flag to identify whether model fully describes the parcel
183  virtual bool fullyDescribed() const;
184 
185  //- Return flag to identify whether or not injection of parcelI is
186  //- permitted
187  virtual bool validInjection(const label parcelI);
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #ifdef NoRepository
199 #endif
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
Foam::ReactingMultiphaseLookupTableInjection::parcelsToInject
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
Definition: ReactingMultiphaseLookupTableInjection.C:150
ReactingMultiphaseLookupTableInjection.C
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::ReactingMultiphaseLookupTableInjection::ReactingMultiphaseLookupTableInjection
ReactingMultiphaseLookupTableInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Definition: ReactingMultiphaseLookupTableInjection.C:36
Foam::InjectionModel
Templated injection model class.
Definition: InjectionModel.H:73
Foam::ReactingMultiphaseLookupTableInjection::updateMesh
virtual void updateMesh()
Set injector locations when mesh is updated.
Definition: ReactingMultiphaseLookupTableInjection.C:98
Foam::ReactingMultiphaseLookupTableInjection::clone
virtual autoPtr< InjectionModel< CloudType > > clone() const
Construct and return a clone.
Definition: ReactingMultiphaseLookupTableInjection.H:130
Foam::subModelBase::modelName
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:107
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:167
reactingMultiphaseParcelInjectionDataIOList.H
Foam::ReactingMultiphaseLookupTableInjection::fullyDescribed
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
Definition: ReactingMultiphaseLookupTableInjection.C:257
Foam::subModelBase::dict
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
Foam::ReactingMultiphaseLookupTableInjection::timeEnd
scalar timeEnd() const
Return the end-of-injection time.
Definition: ReactingMultiphaseLookupTableInjection.C:141
Foam::CloudSubModelBase::owner
const CloudType & owner() const
Return const access to the owner cloud.
Definition: CloudSubModelBase.C:106
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::ReactingMultiphaseLookupTableInjection::TypeName
TypeName("reactingMultiphaseLookupTableInjection")
Runtime type information.
Foam::ReactingMultiphaseLookupTableInjection::~ReactingMultiphaseLookupTableInjection
virtual ~ReactingMultiphaseLookupTableInjection()=default
Destructor.
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
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:217
Foam::Vector< scalar >
Foam::List< label >
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::ReactingMultiphaseLookupTableInjection
Particle injection sources read from look-up table. Each row corresponds to an injection site.
Definition: ReactingMultiphaseLookupTableInjection.H:76
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:187
Foam::GlobalIOList< reactingMultiphaseParcelInjectionData >
Foam::ReactingMultiphaseLookupTableInjection::validInjection
virtual bool validInjection(const label parcelI)
Definition: ReactingMultiphaseLookupTableInjection.C:265