CellZoneInjection.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-2012 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::CellZoneInjection
26 
27 Description
28  Injection positions specified by a particle number density within a cell set
29 
30  User specifies
31  - Number density of particles in cell set (effective)
32  - Total mass to inject
33  - Initial parcel velocity
34 
35  Additional
36  - Parcel diameters obtained by PDF model
37  - All parcels introduced at SOI
38 
39 SourceFiles
40  CellZoneInjection.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef CellZoneInjection_H
45 #define CellZoneInjection_H
46 
47 #include "InjectionModel.H"
48 #include "distributionModel.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class CellZoneInjection Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class CloudType>
61 :
62  public InjectionModel<CloudType>
63 {
64  // Private data
65 
66  //- Name of cell zone
67  const word cellZoneName_;
68 
69  //- Number density
70  const scalar numberDensity_;
71 
72  //- Field of parcel positions
74 
75  //- List of cell labels corresponding to injector positions
77 
78  //- List of tetFace labels corresponding to injector positions
80 
81  //- List of tetPt labels corresponding to injector positions
83 
84  //- Field of parcel diameters
86 
87  //- Initial parcel velocity
88  const vector U0_;
89 
90  //- Parcel size distribution model
92 
93 
94  // Private Member Functions
95 
96  //- Set the parcel injection positions
97  void setPositions(const labelList& cellZoneCells);
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("cellZoneInjection");
104 
105 
106  // Constructors
107 
108  //- Construct from dictionary
110  (
111  const dictionary& dict,
112  CloudType& owner,
113  const word& modelName
114  );
115 
116  //- Construct copy
118 
119  //- Construct and return a clone
120  virtual autoPtr<InjectionModel<CloudType> > clone() const
121  {
123  (
125  );
126  }
127 
128 
129  //- Destructor
130  virtual ~CellZoneInjection();
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  label parcelsToInject(const scalar time0, const scalar time1);
143 
144  //- Volume of parcels to introduce relative to SOI
145  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
187 # include "CellZoneInjection.C"
188 #endif
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
Foam::CellZoneInjection::injectorTetFaces_
labelList injectorTetFaces_
List of tetFace labels corresponding to injector positions.
Definition: CellZoneInjection.H:78
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::CellZoneInjection
Injection positions specified by a particle number density within a cell set.
Definition: CellZoneInjection.H:59
Foam::CellZoneInjection::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: CellZoneInjection.C:316
Foam::InjectionModel
Templated injection model class.
Definition: InjectionModel.H:67
Foam::CellZoneInjection::cellZoneName_
const word cellZoneName_
Name of cell zone.
Definition: CellZoneInjection.H:66
Foam::CellZoneInjection::injectorCells_
labelList injectorCells_
List of cell labels corresponding to injector positions.
Definition: CellZoneInjection.H:75
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::CellZoneInjection::U0_
const vector U0_
Initial parcel velocity.
Definition: CellZoneInjection.H:87
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::CellZoneInjection::timeEnd
scalar timeEnd() const
Return the end-of-injection time.
Definition: CellZoneInjection.C:270
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Foam::CellZoneInjection::parcelsToInject
label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
Definition: CellZoneInjection.C:279
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::CellZoneInjection::sizeDistribution_
const autoPtr< distributionModels::distributionModel > sizeDistribution_
Parcel size distribution model.
Definition: CellZoneInjection.H:90
Foam::CellZoneInjection::~CellZoneInjection
virtual ~CellZoneInjection()
Destructor.
Definition: CellZoneInjection.C:214
Foam::CellZoneInjection::clone
virtual autoPtr< InjectionModel< CloudType > > clone() const
Construct and return a clone.
Definition: CellZoneInjection.H:119
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::CellZoneInjection::CellZoneInjection
CellZoneInjection(const dictionary &dict, CloudType &owner, const word &modelName)
Construct from dictionary.
Definition: CellZoneInjection.C:165
Foam::CellZoneInjection::TypeName
TypeName("cellZoneInjection")
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::CellZoneInjection::setProperties
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
Definition: CellZoneInjection.C:335
Foam::CellZoneInjection::volumeToInject
scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
Definition: CellZoneInjection.C:297
Foam::CellZoneInjection::updateMesh
virtual void updateMesh()
Set injector locations when mesh is updated.
Definition: CellZoneInjection.C:221
Foam::Vector< scalar >
Foam::List< vector >
Foam::CellZoneInjection::validInjection
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
Definition: CellZoneInjection.C:358
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:217
Foam::CellZoneInjection::fullyDescribed
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
Definition: CellZoneInjection.C:351
CellZoneInjection.C
Foam::CellZoneInjection::diameters_
scalarList diameters_
Field of parcel diameters.
Definition: CellZoneInjection.H:84
Foam::CellZoneInjection::injectorTetPts_
labelList injectorTetPts_
List of tetPt labels corresponding to injector positions.
Definition: CellZoneInjection.H:81
Foam::CellZoneInjection::numberDensity_
const scalar numberDensity_
Number density.
Definition: CellZoneInjection.H:69
distributionModel.H
Foam::CellZoneInjection::setPositions
void setPositions(const labelList &cellZoneCells)
Set the parcel injection positions.
Definition: CellZoneInjection.C:36
Foam::CellZoneInjection::positions_
List< vector > positions_
Field of parcel positions.
Definition: CellZoneInjection.H:72