ReactingMultiphaseLookupTableInjection.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::ReactingMultiphaseLookupTableInjection
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 (
37 (x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
38 (x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
39 ...
40 (x y z) (u v w) d rho mDot T cp (Y0..Y2) (Yg0..YgN) (Yl0..YlN) (Ys0..YsN)
41 );
42
43 where:
44 x, y, z = global cartesian coordinates [m]
45 u, v, w = global cartesian velocity components [m/s]
46 d = diameter [m]
47 rho = density [kg/m3]
48 mDot = mass flow rate [kg/s]
49 T = temperature [K]
50 cp = specific heat capacity [J/kg/K]
51 Y(3) = total mass fraction of gas (Y0), liquid (Y1), solid (Y3)
52 Yg(Ngas) = mass fractions of gaseous components
53 Yl(Nliq) = mass fractions of liquid components
54 Ys(Nsld) = mass fractions of solid components
55
56SourceFiles
57 ReactingMultiphaseLookupTableInjection.C
58
59\*---------------------------------------------------------------------------*/
60
61#ifndef ReactingMultiphaseLookupTableInjection_H
62#define ReactingMultiphaseLookupTableInjection_H
63
64#include "InjectionModel.H"
66
67// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68
69namespace Foam
70{
71
72/*---------------------------------------------------------------------------*\
73 Class ReactingMultiphaseLookupTableInjection Declaration
74\*---------------------------------------------------------------------------*/
75
76template<class CloudType>
78:
79 public InjectionModel<CloudType>
80{
81 // Private data
82
83 //- Name of file containing injector/parcel data
84 const word inputFileName_;
85
86 //- Injection duration - common to all injection sources
87 scalar duration_;
88
89 //- Number of parcels per injector - common to all injection sources
90 const scalar parcelsPerSecond_;
91
92 //- Flag to indicate to randomise injection positions
93 bool randomise_;
94
95 //- List of injectors
97
98 //- List of cell labels corresponding to injector positions
99 labelList injectorCells_;
100
101 //- List of tetFace labels corresponding to injector positions
102 labelList injectorTetFaces_;
103
104 //- List of tetPt labels corresponding to injector positions
105 labelList injectorTetPts_;
106
107
108public:
109
110 //- Runtime type information
111 TypeName("reactingMultiphaseLookupTableInjection");
112
113
114 // Constructors
115
116 //- Construct from dictionary
118 (
119 const dictionary& dict,
121 const word& modelName
122 );
123
124 //- Construct copy
126 (
128 );
129
130 //- Construct and return a clone
132 {
134 (
136 );
137 }
138
139
140 //- Destructor
141 virtual ~ReactingMultiphaseLookupTableInjection() = default;
142
143
144 // Member Functions
145
146 //- Set injector locations when mesh is updated
147 virtual void updateMesh();
148
149 //- Return the end-of-injection time
150 scalar timeEnd() const;
151
152 //- Number of parcels to introduce relative to SOI
153 virtual label parcelsToInject(const scalar time0, const scalar time1);
154
155 //- Volume of parcels to introduce relative to SOI
156 virtual scalar volumeToInject(const scalar time0, const scalar time1);
157
158
159 // Injection geometry
160
161 //- Set the injection position and owner cell, tetFace and tetPt
162 virtual void setPositionAndCell
163 (
164 const label parcelI,
165 const label nParcels,
166 const scalar time,
167 vector& position,
168 label& cellOwner,
169 label& tetFacei,
170 label& tetPti
171 );
172
173 //- Set the parcel properties
174 virtual void setProperties
175 (
176 const label parcelI,
177 const label nParcels,
178 const scalar time,
179 typename CloudType::parcelType& parcel
180 );
181
182 //- Flag to identify whether model fully describes the parcel
183 virtual bool fullyDescribed() const;
184
185 //- Return flag to identify whether or not injection of parcelI is
186 //- permitted
187 virtual bool validInjection(const label parcelI);
188};
189
190
191// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192
193} // End namespace Foam
194
195// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196
197#ifdef NoRepository
199#endif
200
201// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202
203#endif
204
205// ************************************************************************* //
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.
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 ~ReactingMultiphaseLookupTableInjection()=default
Destructor.
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
TypeName("reactingMultiphaseLookupTableInjection")
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.
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