InjectionModelList.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2012-2022 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::InjectionModelList
26 
27 Description
28  List of injection models
29 
30 SourceFiles
31  InjectionModelListList.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef InjectionModelList_H
36 #define InjectionModelList_H
37 
38 #include "PtrList.H"
39 #include "InjectionModel.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class InjectionModelList Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class CloudType>
51 class InjectionModelList
52 :
53  public PtrList<InjectionModel<CloudType>>
54 {
55 public:
56 
57  // Constructors
58 
59  //- Construct null from owner
61 
62  //- Construct from dictionary and cloud owner
63  InjectionModelList(const dictionary& dict, CloudType& owner);
64 
65  //- Construct copy
66  InjectionModelList(const InjectionModelList<CloudType>& im);
67 
68  //- Construct and return a clone
70  {
72  (
74  );
75  }
76 
77 
78  //- Destructor
79  virtual ~InjectionModelList();
80 
81 
82 
83  // Member Functions
84 
85  // Access
86 
87  //- Return the minimum start-of-injection time
88  scalar timeStart() const;
89 
90  //- Return the maximum end-of-injection time
91  scalar timeEnd() const;
92 
93  //- Volume of parcels to introduce relative to SOI
94  scalar volumeToInject(const scalar time0, const scalar time1);
95 
96  //- Return the average parcel mass
97  scalar averageParcelMass();
98 
99 
100  // Edit
101 
102  //- Set injector locations when mesh is updated
103  void topoChange();
104 
105 
106  // Per-injection event functions
107 
108  //- Main injection loop
109  template<class TrackCloudType>
110  void inject
111  (
112  TrackCloudType& cloud,
113  typename CloudType::parcelType::trackingData& td
114  );
115 
116  //- Main injection loop - steady-state
117  template<class TrackCloudType>
118  void injectSteadyState
119  (
120  TrackCloudType& cloud,
121  typename CloudType::parcelType::trackingData& td,
122  const scalar trackTime
123  );
124 
125 
126  // I-O
127 
128  //- Write injection info to stream
129  virtual void info(Ostream& os);
130 };
131 
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 } // End namespace Foam
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #ifdef NoRepository
140  #include "InjectionModelList.C"
141 #endif
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
virtual ~InjectionModelList()
Destructor.
void inject(TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td)
Main injection loop.
dictionary dict
scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
void topoChange()
Set injector locations when mesh is updated.
DSMCCloud< dsmcParcel > CloudType
InjectionModelList(CloudType &owner)
Construct null from owner.
void injectSteadyState(TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td, const scalar trackTime)
Main injection loop - steady-state.
virtual autoPtr< InjectionModelList< CloudType > > clone() const
Construct and return a clone.
scalar timeStart() const
Return the minimum start-of-injection time.
scalar averageParcelMass()
Return the average parcel mass.
A cloud is a collection of lagrangian particles.
Definition: cloud.H:51
List of injection models.
Definition: MomentumCloud.H:77
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual void info(Ostream &os)
Write injection info to stream.
scalar timeEnd() const
Return the maximum end-of-injection time.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Namespace for OpenFOAM.