KinematicLookupTableInjection.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::KinematicLookupTableInjection
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 // injector 1
33  (x y z) (u v w) d rho mDot // injector 2
34  ...
35  (x y z) (u v w) d rho mDot // 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 
45 SourceFiles
46  KinematicLookupTableInjection.C
47 
48 \*---------------------------------------------------------------------------*/
49 
50 #ifndef KinematicLookupTableInjection_H
51 #define KinematicLookupTableInjection_H
52 
53 #include "InjectionModel.H"
55 
56 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
57 
58 namespace Foam
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class KinematicLookupTableInjection Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 template<class CloudType>
67 :
68  public InjectionModel<CloudType>
69 {
70  // Private data
71 
72  //- Name of file containing injector/parcel data
73  const word inputFileName_;
74 
75  //- Injection duration - common to all injection sources
76  scalar duration_;
77 
78  //- Number of parcels per injector - common to all injection sources
79  const scalar parcelsPerSecond_;
80 
81  //- Flag to indicate to randomise injection positions
82  bool randomise_;
83 
84  //- List of injectors
86 
87  //- List of cell labels corresponding to injector positions
89 
90  //- List of tetFace labels corresponding to injector positions
92 
93  //- List of tetPt labels corresponding to injector positions
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("kinematicLookupTableInjection");
101 
102 
103  // Constructors
104 
105  //- Construct from dictionary
107  (
108  const dictionary& dict,
109  CloudType& owner,
110  const word& modelName
111  );
112 
113  //- Construct copy
115  (
117  );
118 
119  //- Construct and return a clone
120  virtual autoPtr<InjectionModel<CloudType> > clone() const
121  {
123  (
125  );
126  }
127 
128 
129  //- Destructor
131 
132 
133  // Member Functions
134 
135  //- Set injector locations when mesh is updated
136  virtual void updateMesh();
137 
138  //- Return the end-of-injection time
139  scalar timeEnd() const;
140 
141  //- Number of parcels to introduce relative to SOI
142  virtual label parcelsToInject(const scalar time0, const scalar time1);
143 
144  //- Volume of parcels to introduce relative to SOI
145  virtual scalar volumeToInject(const scalar time0, const scalar time1);
146 
147 
148  // Injection geometry
149 
150  //- Set the injection position and owner cell, tetFace and tetPt
151  virtual void setPositionAndCell
152  (
153  const label parcelI,
154  const label nParcels,
155  const scalar time,
156  vector& position,
157  label& cellOwner,
158  label& tetFaceI,
159  label& tetPtI
160  );
161 
162  //- Set the parcel properties
163  virtual void setProperties
164  (
165  const label parcelI,
166  const label nParcels,
167  const scalar time,
168  typename CloudType::parcelType& parcel
169  );
170 
171  //- Flag to identify whether model fully describes the parcel
172  virtual bool fullyDescribed() const;
173 
174  //- Return flag to identify whether or not injection of parcelI is
175  // permitted
176  virtual bool validInjection(const label parcelI);
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #ifdef NoRepository
188 #endif
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
Foam::KinematicLookupTableInjection::fullyDescribed
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
Definition: KinematicLookupTableInjection.C:223
Foam::KinematicLookupTableInjection::parcelsPerSecond_
const scalar parcelsPerSecond_
Number of parcels per injector - common to all injection sources.
Definition: KinematicLookupTableInjection.H:78
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::KinematicLookupTableInjection::KinematicLookupTableInjection
KinematicLookupTableInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Definition: KinematicLookupTableInjection.C:33
Foam::KinematicLookupTableInjection::injectors_
kinematicParcelInjectionDataIOList injectors_
List of injectors.
Definition: KinematicLookupTableInjection.H:84
KinematicLookupTableInjection.C
Foam::KinematicLookupTableInjection::clone
virtual autoPtr< InjectionModel< CloudType > > clone() const
Construct and return a clone.
Definition: KinematicLookupTableInjection.H:119
Foam::KinematicLookupTableInjection::duration_
scalar duration_
Injection duration - common to all injection sources.
Definition: KinematicLookupTableInjection.H:75
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::KinematicLookupTableInjection::injectorTetFaces_
labelList injectorTetFaces_
List of tetFace labels corresponding to injector positions.
Definition: KinematicLookupTableInjection.H:90
Foam::subModelBase::modelName
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
InjectionModel.H
Foam::KinematicLookupTableInjection::validInjection
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
Definition: KinematicLookupTableInjection.C:231
Foam::KinematicLookupTableInjection::inputFileName_
const word inputFileName_
Name of file containing injector/parcel data.
Definition: KinematicLookupTableInjection.H:72
Foam::KinematicLookupTableInjection::~KinematicLookupTableInjection
virtual ~KinematicLookupTableInjection()
Destructor.
Definition: KinematicLookupTableInjection.C:102
Foam::KinematicLookupTableInjection::setProperties
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
Definition: KinematicLookupTableInjection.C:202
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::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Foam::KinematicLookupTableInjection::parcelsToInject
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
Definition: KinematicLookupTableInjection.C:134
Foam::KinematicLookupTableInjection::injectorCells_
labelList injectorCells_
List of cell labels corresponding to injector positions.
Definition: KinematicLookupTableInjection.H:87
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::KinematicLookupTableInjection
Particle injection sources read from look-up table. Each row corresponds to an injection site.
Definition: KinematicLookupTableInjection.H:65
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::KinematicLookupTableInjection::randomise_
bool randomise_
Flag to indicate to randomise injection positions.
Definition: KinematicLookupTableInjection.H:81
Foam::KinematicLookupTableInjection::updateMesh
virtual void updateMesh()
Set injector locations when mesh is updated.
Definition: KinematicLookupTableInjection.C:109
Foam::KinematicLookupTableInjection::timeEnd
scalar timeEnd() const
Return the end-of-injection time.
Definition: KinematicLookupTableInjection.C:126
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::KinematicLookupTableInjection::volumeToInject
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
Definition: KinematicLookupTableInjection.C:152
Foam::KinematicLookupTableInjection::injectorTetPts_
labelList injectorTetPts_
List of tetPt labels corresponding to injector positions.
Definition: KinematicLookupTableInjection.H:93
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::IOList< kinematicParcelInjectionData >
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
Foam::KinematicLookupTableInjection::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: KinematicLookupTableInjection.C:172
Foam::KinematicLookupTableInjection::TypeName
TypeName("kinematicLookupTableInjection")
Runtime type information.
kinematicParcelInjectionDataIOList.H