InflationInjection.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 Copyright (C) 2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::InflationInjection
29
30Group
31 grpLagrangianIntermediateInjectionSubModels
32
33Description
34 Inflation injection - creates new particles by splitting existing
35 particles within in a set of generation cells, then inflating them
36 to a target diameter within the generation cells and an additional
37 set of inflation cells.
38
39SourceFiles
40 InflationInjection.C
41
42\*---------------------------------------------------------------------------*/
43
44#ifndef InflationInjection_H
45#define InflationInjection_H
46
47#include "InjectionModel.H"
48#include "distributionModel.H"
49#include "Switch.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56// Structure to hold:
57// + position = vectorPairScalarPair::first().first()
58// + velocity = vectorPairScalarPair::first().second()
59// + diameter = vectorPairScalarPair::second().first()
60// + target diameter = vectorPairScalarPair::second().second()
61// One structure to allow single operation parallel comms
63
64
65/*---------------------------------------------------------------------------*\
66 Class InflationInjection Declaration
67\*---------------------------------------------------------------------------*/
68
69template<class CloudType>
71:
72 public InjectionModel<CloudType>
73{
74 // Private data
75
76 //- Name of cellSet for generating new particles
77 word generationSetName_;
78
79 //- Name of cellSet for inflating new particles
80 word inflationSetName_;
81
82 //- Set of cells to generate particles in
83 labelList generationCells_;
84
85 //- Set of cells to inflate particles in, includes all
86 // generation cells
87 labelList inflationCells_;
88
89 //- Injection duration [s]
90 scalar duration_;
91
92 //- Flow rate profile relative to SOI [m3/s]
93 autoPtr<Function1<scalar>> flowRateProfile_;
94
95 //- Growth rate of particle diameters towards target [m/s]
96 autoPtr<Function1<scalar>> growthRate_;
97
98 //- Positions, velocities, diameters and target diameters of
99 // new particles after splitting
101
102 //- Accumulation variable to carry over volume from one injection
103 // to the next
104 scalar volumeAccumulator_;
105
106 //- Fraction of injection controlled by this processor
107 scalar fraction_;
108
109 //- Switch to control whether or not the injector is allowed
110 // to create new particles in empty cells
111 Switch selfSeed_;
112
113 //- Diameter with which to create new seed particles
114 scalar dSeed_;
115
116 //- Parcel size distribution model
117 const autoPtr<distributionModel> sizeDistribution_;
118
119
120public:
121
122 //- Runtime type information
123 TypeName("inflationInjection");
124
125
126 // Constructors
127
128 //- Construct from dictionary
130 (
131 const dictionary& dict,
133 const word& modelName
134 );
135
136 //- Construct copy
138
139 //- Construct and return a clone
141 {
143 (
145 );
146 }
147
148
149 //- Destructor
150 virtual ~InflationInjection();
151
152
153 // Member Functions
154
155 //- Set injector locations when mesh is updated
156 virtual void updateMesh();
157
158 //- Return the end-of-injection time
159 scalar timeEnd() const;
160
161 //- Number of parcels to introduce relative to SOI
162 virtual label parcelsToInject(const scalar time0, const scalar time1);
163
164 //- Volume of parcels to introduce relative to SOI
165 virtual scalar volumeToInject(const scalar time0, const scalar time1);
166
167
168 // Injection geometry
169
170 //- Set the injection position and owner cell, tetFace and tetPt
171 virtual void setPositionAndCell
172 (
173 const label parcelI,
174 const label nParcels,
175 const scalar time,
176 vector& position,
177 label& cellOwner,
178 label& tetFacei,
179 label& tetPti
180 );
181
182 //- Set the parcel properties
183 virtual void setProperties
184 (
185 const label parcelI,
186 const label nParcels,
187 const scalar time,
188 typename CloudType::parcelType& parcel
189 );
190
191 //- Flag to identify whether model fully describes the parcel
192 virtual bool fullyDescribed() const;
193
194 //- Return flag to identify whether or not injection of parcelI is
195 // permitted
196 virtual bool validInjection(const label parcelI);
197};
198
199
200// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201
202} // End namespace Foam
203
204// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205
206#ifdef NoRepository
207 #include "InflationInjection.C"
208#endif
209
210// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211
212#endif
213
214// ************************************************************************* //
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
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
Inflation injection - creates new particles by splitting existing particles within in a set of genera...
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.
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)
Return flag to identify whether or not injection of parcelI is.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
virtual ~InflationInjection()
Destructor.
TypeName("inflationInjection")
Runtime type information.
virtual void updateMesh()
Set injector locations when mesh is updated.
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
scalar timeEnd() const
Return the end-of-injection time.
Templated injection model class.
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: Pair.H:69
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: Tuple2.H:58
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.
Tuple2< Pair< vector >, Pair< scalar > > vectorPairScalarPair
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73