ConeInjection.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::ConeInjection
26 
27 Description
28  Multi-point cone injection model
29 
30  User specifies
31  - time of start of injection
32  - list of injector positions and directions (along injection axes)
33  - number of parcels to inject per injector
34  - parcel velocities
35  - inner and outer half-cone angles
36 
37  Additional
38  - Parcel diameters obtained by distribution model
39 
40 SourceFiles
41  ConeInjection.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef ConeInjection_H
46 #define ConeInjection_H
47 
48 #include "InjectionModel.H"
49 #include "distributionModel.H"
50 #include "vectorList.H"
51 #include "TimeDataEntry.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class ConeInjection Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 template<class CloudType>
63 class ConeInjection
64 :
65  public InjectionModel<CloudType>
66 {
67  // Private data
68 
69  //- List of position and axis for each injector
71 
72  //- List of cell labels corresponding to injector positions
74 
75  //- List of tetFace labels corresponding to injector positions
77 
78  //- List of tetPt labels corresponding to injector positions
80 
81  //- Injection duration [s]
82  scalar duration_;
83 
84  //- Number of parcels to introduce per injector
86 
87  //- Flow rate profile relative to SOI []
89 
90  //- Parcel velocity magnitude relative to SOI [m/s]
92 
93  //- Inner half-cone angle relative to SOI [deg]
95 
96  //- Outer half-cone angle relative to SOI [deg]
98 
99  //- Parcel size distribution model
101 
102  //- Number of parcels per injector already injected
103  mutable label nInjected_;
104 
105 
106  // Tangential vectors to the direction vector
107 
108  //- First tangential vector
110 
111  //- Second tangential vector
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("coneInjection");
119 
120 
121  // Constructors
122 
123  //- Construct from dictionary
125  (
126  const dictionary& dict,
127  CloudType& owner,
128  const word& modelName
129  );
130 
131  //- Construct copy
133 
134  //- Construct and return a clone
135  virtual autoPtr<InjectionModel<CloudType> > clone() const
136  {
138  (
139  new ConeInjection<CloudType>(*this)
140  );
141  }
142 
143 
144  //- Destructor
145  virtual ~ConeInjection();
146 
147 
148  // Member Functions
149 
150  //- Set injector locations when mesh is updated
151  virtual void updateMesh();
152 
153  //- Return the end-of-injection time
154  scalar timeEnd() const;
155 
156  //- Number of parcels to introduce relative to SOI
157  virtual label parcelsToInject(const scalar time0, const scalar time1);
158 
159  //- Volume of parcels to introduce relative to SOI
160  virtual scalar volumeToInject(const scalar time0, const scalar time1);
161 
162 
163 
164  // Injection geometry
165 
166  //- Set the injection position and owner cell, tetFace and tetPt
167  virtual void setPositionAndCell
168  (
169  const label parcelI,
170  const label nParcels,
171  const scalar time,
172  vector& position,
173  label& cellOwner,
174  label& tetFaceI,
175  label& tetPtI
176  );
177 
178  //- Set the parcel properties
179  virtual void setProperties
180  (
181  const label parcelI,
182  const label nParcels,
183  const scalar time,
184  typename CloudType::parcelType& parcel
185  );
186 
187  //- Flag to identify whether model fully describes the parcel
188  virtual bool fullyDescribed() const;
189 
190  //- Return flag to identify whether or not injection of parcelI is
191  // permitted
192  virtual bool validInjection(const label parcelI);
193 };
194 
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 } // End namespace Foam
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #ifdef NoRepository
203 # include "ConeInjection.C"
204 #endif
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
Foam::ConeInjection::~ConeInjection
virtual ~ConeInjection()
Destructor.
Definition: ConeInjection.C:160
Foam::ConeInjection::parcelsPerInjector_
const label parcelsPerInjector_
Number of parcels to introduce per injector.
Definition: ConeInjection.H:84
ConeInjection.C
vectorList.H
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::ConeInjection::injectorCells_
labelList injectorCells_
List of cell labels corresponding to injector positions.
Definition: ConeInjection.H:72
Foam::ConeInjection::thetaInner_
const TimeDataEntry< scalar > thetaInner_
Inner half-cone angle relative to SOI [deg].
Definition: ConeInjection.H:93
Foam::ConeInjection::injectorTetFaces_
labelList injectorTetFaces_
List of tetFace labels corresponding to injector positions.
Definition: ConeInjection.H:75
Foam::ConeInjection::flowRateProfile_
const TimeDataEntry< scalar > flowRateProfile_
Flow rate profile relative to SOI [].
Definition: ConeInjection.H:87
Foam::ConeInjection::validInjection
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
Definition: ConeInjection.C:300
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::subModelBase::modelName
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
InjectionModel.H
Foam::TimeDataEntry< scalar >
Foam::ConeInjection::tanVec2_
vectorList tanVec2_
Second tangential vector.
Definition: ConeInjection.H:111
Foam::ConeInjection::thetaOuter_
const TimeDataEntry< scalar > thetaOuter_
Outer half-cone angle relative to SOI [deg].
Definition: ConeInjection.H:96
Foam::ConeInjection::volumeToInject
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
Definition: ConeInjection.C:217
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::ConeInjection::nInjected_
label nInjected_
Number of parcels per injector already injected.
Definition: ConeInjection.H:102
Foam::ConeInjection::fullyDescribed
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
Definition: ConeInjection.C:293
Foam::ConeInjection::ConeInjection
ConeInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Definition: ConeInjection.C:37
Foam::ConeInjection::duration_
scalar duration_
Injection duration [s].
Definition: ConeInjection.H:81
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
TimeDataEntry.H
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::ConeInjection::Umag_
const TimeDataEntry< scalar > Umag_
Parcel velocity magnitude relative to SOI [m/s].
Definition: ConeInjection.H:90
Foam::ConeInjection::TypeName
TypeName("coneInjection")
Runtime type information.
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::ConeInjection::sizeDistribution_
const autoPtr< distributionModels::distributionModel > sizeDistribution_
Parcel size distribution model.
Definition: ConeInjection.H:99
Foam::ConeInjection::parcelsToInject
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
Definition: ConeInjection.C:192
Foam::ConeInjection
Multi-point cone injection model.
Definition: ConeInjection.H:62
Foam::Vector< scalar >
Foam::ConeInjection::setProperties
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
Definition: ConeInjection.C:256
Foam::ConeInjection::injectorTetPts_
labelList injectorTetPts_
List of tetPt labels corresponding to injector positions.
Definition: ConeInjection.H:78
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::ConeInjection::updateMesh
virtual void updateMesh()
Set injector locations when mesh is updated.
Definition: ConeInjection.C:167
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
Foam::ConeInjection::clone
virtual autoPtr< InjectionModel< CloudType > > clone() const
Construct and return a clone.
Definition: ConeInjection.H:134
Foam::ConeInjection::tanVec1_
vectorList tanVec1_
First tangential vector.
Definition: ConeInjection.H:108
Foam::ConeInjection::timeEnd
scalar timeEnd() const
Return the end-of-injection time.
Definition: ConeInjection.C:184
Foam::ConeInjection::positionAxis_
List< Tuple2< vector, vector > > positionAxis_
List of position and axis for each injector.
Definition: ConeInjection.H:69
distributionModel.H
Foam::ConeInjection::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: ConeInjection.C:235