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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::KinematicLookupTableInjection
28
29Group
30 grpLagrangianIntermediateInjectionSubModels
31
32Description
33 Particle injection sources read from look-up table. Each row corresponds to
34 an injection site.
35
36 \verbatim
37 (
38 (x y z) (u v w) d rho mDot // injector 1
39 (x y z) (u v w) d rho mDot // injector 2
40 ...
41 (x y z) (u v w) d rho mDot // injector N
42 );
43 \endverbatim
44
45 where:
46 \plaintable
47 x, y, z | global cartesian coordinates [m]
48 u, v, w | global cartesian velocity components [m/s]
49 d | diameter [m]
50 rho | density [kg/m3]
51 mDot | mass flow rate [kg/s]
52 \endplaintable
53
54SourceFiles
55 KinematicLookupTableInjection.C
56
57\*---------------------------------------------------------------------------*/
58
59#ifndef KinematicLookupTableInjection_H
60#define KinematicLookupTableInjection_H
61
62#include "InjectionModel.H"
64
65// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
66
67namespace Foam
68{
69
70/*---------------------------------------------------------------------------*\
71 Class KinematicLookupTableInjection Declaration
72\*---------------------------------------------------------------------------*/
73
74template<class CloudType>
75class KinematicLookupTableInjection
76:
77 public InjectionModel<CloudType>
78{
79 // Private data
80
81 //- Name of file containing injector/parcel data
82 const word inputFileName_;
83
84 //- Injection duration - common to all injection sources
85 scalar duration_;
86
87 //- Number of parcels per injector - common to all injection sources
88 const scalar parcelsPerSecond_;
89
90 //- Flag to indicate to randomise injection positions
91 bool randomise_;
92
93 //- List of injectors
95
96 //- List of cell labels corresponding to injector positions
97 labelList injectorCells_;
98
99 //- List of tetFace labels corresponding to injector positions
100 labelList injectorTetFaces_;
101
102 //- List of tetPt labels corresponding to injector positions
103 labelList injectorTetPts_;
104
105
106public:
107
108 //- Runtime type information
109 TypeName("kinematicLookupTableInjection");
110
111
112 // Constructors
113
114 //- Construct from dictionary
116 (
117 const dictionary& dict,
119 const word& modelName
120 );
121
122 //- Construct copy
124 (
126 );
127
128 //- Construct and return a clone
130 {
132 (
134 );
135 }
136
137
138 //- Destructor
139 virtual ~KinematicLookupTableInjection() = default;
140
141
142 // Member Functions
143
144 //- Set injector locations when mesh is updated
145 virtual void updateMesh();
146
147 //- Return the end-of-injection time
148 scalar timeEnd() const;
149
150 //- Number of parcels to introduce relative to SOI
151 virtual label parcelsToInject(const scalar time0, const scalar time1);
152
153 //- Volume of parcels to introduce relative to SOI
154 virtual scalar volumeToInject(const scalar time0, const scalar time1);
155
156
157 // Injection geometry
159 //- Set the injection position and owner cell, tetFace and tetPt
160 virtual void setPositionAndCell
161 (
162 const label parcelI,
163 const label nParcels,
164 const scalar time,
165 vector& position,
166 label& cellOwner,
167 label& tetFacei,
168 label& tetPti
169 );
170
171 //- Set the parcel properties
172 virtual void setProperties
173 (
174 const label parcelI,
175 const label nParcels,
176 const scalar time,
177 typename CloudType::parcelType& parcel
178 );
179
180 //- Flag to identify whether model fully describes the parcel
181 virtual bool fullyDescribed() const;
182
183 //- Return flag to identify whether or not injection of parcelI is
184 //- permitted
185 virtual bool validInjection(const label parcelI);
186};
187
188
189// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190
191} // End namespace Foam
192
193// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194
195#ifdef NoRepository
197#endif
198
199// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200
201#endif
202
203// ************************************************************************* //
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Templated injection model class.
Particle injection sources read from look-up table. Each row corresponds to an injection site.
virtual autoPtr< InjectionModel< CloudType > > clone() const
Construct and return a clone.
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
TypeName("kinematicLookupTableInjection")
Runtime type information.
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.
virtual bool validInjection(const label parcelI)
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
virtual void updateMesh()
Set injector locations when mesh is updated.
virtual ~KinematicLookupTableInjection()=default
Destructor.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
scalar timeEnd() const
Return the end-of-injection time.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
const word & modelName() const
Return const access to the name of the sub-model.
Definition: subModelBase.C:107
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73