ConeNozzleInjection.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-2015 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::ConeNozzleInjection
26 
27 Description
28  Cone injection
29 
30  User specifies
31  - time of start of injection
32  - injector position
33  - direction (along injection axis)
34  - parcel flow rate
35  - inner and outer half-cone angles
36 
37  Additional
38  - Parcel diameters obtained by size distribution model
39  - Parcel velocity is calculated as:
40  - Constant velocity
41  U = <specified by user>
42  - Pressure driven velocity
43  U = sqrt(2*(Pinj - Pamb)/rho)
44  - Flow rate and discharge
45  U = V_dot/(A*Cd)
46 
47 SourceFiles
48  ConeNozzleInjection.C
49 
50 \*---------------------------------------------------------------------------*/
51 
52 #ifndef ConeNozzleInjection_H
53 #define ConeNozzleInjection_H
54 
55 #include "InjectionModel.H"
56 
57 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
58 
59 namespace Foam
60 {
61 
62 // Forward declaration of classes
63 
64 template<class Type>
65 class TimeDataEntry;
66 
67 class distributionModel;
68 
69 /*---------------------------------------------------------------------------*\
70  Class ConeNozzleInjection Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 template<class CloudType>
75 :
76  public InjectionModel<CloudType>
77 {
78 public:
79 
80  //- Injection method enumeration
81  enum injectionMethod
82  {
84  imDisc
85  };
86 
87  //- Flow type enumeration
88  enum flowType
89  {
93  };
94 
95 
96 private:
97 
98  // Private data
99 
100  //- Point/disc injection method
102 
103  //- Flow type
105 
106  //- Outer nozzle diameter [m]
107  const scalar outerDiameter_;
108 
109  //- Inner nozzle diameter [m]
110  const scalar innerDiameter_;
111 
112  //- Injection duration [s]
113  scalar duration_;
114 
115  //- Injector position [m]
117 
118  //- Cell containing injector position []
120 
121  //- Index of tet face for injector cell
123 
124  //- Index of tet point for injector cell
125  label tetPtI_;
126 
127  //- Injector direction []
129 
130  //- Number of parcels to introduce per second []
131  const label parcelsPerSecond_;
132 
133  //- Flow rate profile relative to SOI []
135 
136  //- Inner half-cone angle relative to SOI [deg]
138 
139  //- Outer half-cone angle relative to SOI [deg]
141 
142  //- Parcel size PDF model
144 
145 
146  // Tangential vectors to the direction vector
147 
148  //- First tangential vector
150 
151  //- Second tangential vector
153 
154  //- Injection vector orthogonal to direction
155  vector normal_;
156 
157 
158  // Velocity model coefficients
159 
160  //- Constant velocity [m/s]
161  scalar UMag_;
162 
163  //- Discharge coefficient, relative to SOI [m/s]
165 
166  //- Injection pressure [Pa]
168 
169 
170  // Private Member Functions
171 
172  //- Set the injection type
173  void setInjectionMethod();
174 
175  //- Set the injection flow type
176  void setFlowType();
177 
178 
179 public:
180 
181  //- Runtime type information
182  TypeName("coneNozzleInjection");
183 
184 
185  // Constructors
186 
187  //- Construct from dictionary
189  (
190  const dictionary& dict,
191  CloudType& owner,
192  const word& modelName
193  );
194 
195  //- Construct copy
197 
198  //- Construct and return a clone
199  virtual autoPtr<InjectionModel<CloudType> > clone() const
200  {
202  (
204  );
205  }
206 
207 
208  //- Destructor
209  virtual ~ConeNozzleInjection();
210 
211 
212  // Member Functions
213 
214  //- Set injector locations when mesh is updated
215  virtual void updateMesh();
216 
217  //- Return the end-of-injection time
218  scalar timeEnd() const;
219 
220  //- Number of parcels to introduce relative to SOI
221  virtual label parcelsToInject(const scalar time0, const scalar time1);
222 
223  //- Volume of parcels to introduce relative to SOI
224  virtual scalar volumeToInject(const scalar time0, const scalar time1);
225 
226 
227  // Injection geometry
228 
229  //- Set the injection position and owner cell
230  virtual void setPositionAndCell
231  (
232  const label parcelI,
233  const label nParcels,
234  const scalar time,
235  vector& position,
236  label& cellOwner,
237  label& tetFaceI,
238  label& tetPtI
239  );
240 
241  //- Set the parcel properties
242  virtual void setProperties
243  (
244  const label parcelI,
245  const label nParcels,
246  const scalar time,
247  typename CloudType::parcelType& parcel
248  );
249 
250  //- Flag to identify whether model fully describes the parcel
251  virtual bool fullyDescribed() const;
252 
253  //- Return flag to identify whether or not injection of parcelI is
254  // permitted
255  virtual bool validInjection(const label parcelI);
256 };
257 
258 
259 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260 
261 } // End namespace Foam
262 
263 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
264 
265 #ifdef NoRepository
266 # include "ConeNozzleInjection.C"
267 #endif
268 
269 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
270 
271 #endif
272 
273 // ************************************************************************* //
Foam::ConeNozzleInjection::injectionMethod
injectionMethod
Injection method enumeration.
Definition: ConeNozzleInjection.H:80
Foam::ConeNozzleInjection::TypeName
TypeName("coneNozzleInjection")
Runtime type information.
Foam::ConeNozzleInjection::tanVec2_
vector tanVec2_
Second tangential vector.
Definition: ConeNozzleInjection.H:151
Foam::ConeNozzleInjection::flowRateProfile_
const TimeDataEntry< scalar > flowRateProfile_
Flow rate profile relative to SOI [].
Definition: ConeNozzleInjection.H:133
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::ConeNozzleInjection::imDisc
@ imDisc
Definition: ConeNozzleInjection.H:83
Foam::ConeNozzleInjection::UMag_
scalar UMag_
Constant velocity [m/s].
Definition: ConeNozzleInjection.H:160
Foam::ConeNozzleInjection::position_
vector position_
Injector position [m].
Definition: ConeNozzleInjection.H:115
Foam::ConeNozzleInjection::parcelsToInject
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
Definition: ConeNozzleInjection.C:278
Foam::ConeNozzleInjection::direction_
vector direction_
Injector direction [].
Definition: ConeNozzleInjection.H:127
Foam::ConeNozzleInjection::normal_
vector normal_
Injection vector orthogonal to direction.
Definition: ConeNozzleInjection.H:154
Foam::ConeNozzleInjection::validInjection
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
Definition: ConeNozzleInjection.C:441
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::ConeNozzleInjection::tetFaceI_
label tetFaceI_
Index of tet face for injector cell.
Definition: ConeNozzleInjection.H:121
distributionModel
A library of runtime-selectable distribution models.
Foam::subModelBase::modelName
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:104
Foam::ConeNozzleInjection::injectorCell_
label injectorCell_
Cell containing injector position [].
Definition: ConeNozzleInjection.H:118
InjectionModel.H
Foam::ConeNozzleInjection::tanVec1_
vector tanVec1_
First tangential vector.
Definition: ConeNozzleInjection.H:148
Foam::TimeDataEntry
Light wrapper around DataEntry to provide a mechanism to update time-based entries.
Definition: ConeNozzleInjection.H:64
Foam::ConeNozzleInjection::ftFlowRateAndDischarge
@ ftFlowRateAndDischarge
Definition: ConeNozzleInjection.H:91
Foam::ConeNozzleInjection::setInjectionMethod
void setInjectionMethod()
Set the injection type.
Definition: ConeNozzleInjection.C:36
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::ConeNozzleInjection::volumeToInject
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
Definition: ConeNozzleInjection.C:296
Foam::subModelBase::dict
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:110
Foam::ConeNozzleInjection::setFlowType
void setFlowType()
Set the injection flow type.
Definition: ConeNozzleInjection.C:67
Foam::ConeNozzleInjection::parcelsPerSecond_
const label parcelsPerSecond_
Number of parcels to introduce per second [].
Definition: ConeNozzleInjection.H:130
Foam::ConeNozzleInjection::ConeNozzleInjection
ConeNozzleInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Definition: ConeNozzleInjection.C:99
Foam::ConeNozzleInjection::Cd_
TimeDataEntry< scalar > Cd_
Discharge coefficient, relative to SOI [m/s].
Definition: ConeNozzleInjection.H:163
Foam::ConeNozzleInjection::flowType_
flowType flowType_
Flow type.
Definition: ConeNozzleInjection.H:103
Foam::ConeNozzleInjection
Cone injection.
Definition: ConeNozzleInjection.H:73
Foam::ConeNozzleInjection::updateMesh
virtual void updateMesh()
Set injector locations when mesh is updated.
Definition: ConeNozzleInjection.C:246
Foam::ConeNozzleInjection::thetaInner_
const TimeDataEntry< scalar > thetaInner_
Inner half-cone angle relative to SOI [deg].
Definition: ConeNozzleInjection.H:136
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
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::ConeNozzleInjection::Pinj_
TimeDataEntry< scalar > Pinj_
Injection pressure [Pa].
Definition: ConeNozzleInjection.H:166
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::ConeNozzleInjection::injectionMethod_
injectionMethod injectionMethod_
Point/disc injection method.
Definition: ConeNozzleInjection.H:100
Foam::ConeNozzleInjection::innerDiameter_
const scalar innerDiameter_
Inner nozzle diameter [m].
Definition: ConeNozzleInjection.H:109
Foam::ConeNozzleInjection::timeEnd
scalar timeEnd() const
Return the end-of-injection time.
Definition: ConeNozzleInjection.C:270
Foam::ConeNozzleInjection::ftConstantVelocity
@ ftConstantVelocity
Definition: ConeNozzleInjection.H:89
Foam::Vector< scalar >
Foam::ConeNozzleInjection::tetPtI_
label tetPtI_
Index of tet point for injector cell.
Definition: ConeNozzleInjection.H:124
Foam::ConeNozzleInjection::flowType
flowType
Flow type enumeration.
Definition: ConeNozzleInjection.H:87
Foam::ConeNozzleInjection::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.
Definition: ConeNozzleInjection.C:314
Foam::ConeNozzleInjection::setProperties
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
Definition: ConeNozzleInjection.C:369
Foam::ConeNozzleInjection::fullyDescribed
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
Definition: ConeNozzleInjection.C:434
Foam::ConeNozzleInjection::thetaOuter_
const TimeDataEntry< scalar > thetaOuter_
Outer half-cone angle relative to SOI [deg].
Definition: ConeNozzleInjection.H:139
ConeNozzleInjection.C
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
Foam::ConeNozzleInjection::duration_
scalar duration_
Injection duration [s].
Definition: ConeNozzleInjection.H:112
Foam::ConeNozzleInjection::ftPressureDrivenVelocity
@ ftPressureDrivenVelocity
Definition: ConeNozzleInjection.H:90
Foam::ConeNozzleInjection::sizeDistribution_
const autoPtr< distributionModels::distributionModel > sizeDistribution_
Parcel size PDF model.
Definition: ConeNozzleInjection.H:142
Foam::ConeNozzleInjection::~ConeNozzleInjection
virtual ~ConeNozzleInjection()
Destructor.
Definition: ConeNozzleInjection.C:239
Foam::ConeNozzleInjection::outerDiameter_
const scalar outerDiameter_
Outer nozzle diameter [m].
Definition: ConeNozzleInjection.H:106
Foam::ConeNozzleInjection::clone
virtual autoPtr< InjectionModel< CloudType > > clone() const
Construct and return a clone.
Definition: ConeNozzleInjection.H:198
Foam::ConeNozzleInjection::imPoint
@ imPoint
Definition: ConeNozzleInjection.H:82