InjectionModelList.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) 2012-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::InjectionModelList
28 
29 Description
30  List of injection models
31 
32 SourceFiles
33  InjectionModelListList.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef InjectionModelList_H
38 #define InjectionModelList_H
39 
40 #include "PtrList.H"
41 #include "InjectionModel.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class InjectionModelList Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class CloudType>
53 class InjectionModelList
54 :
55  public PtrList<InjectionModel<CloudType>>
56 {
57 public:
58 
59  // Constructors
60 
61  //- Construct null from owner
63 
64  //- Construct from dictionary and cloud owner
65  InjectionModelList(const dictionary& dict, CloudType& owner);
66 
67  //- Construct copy
68  InjectionModelList(const InjectionModelList<CloudType>& im);
69 
70  //- Construct and return a clone
71  virtual autoPtr<InjectionModelList<CloudType>> clone() const
72  {
73  return autoPtr<InjectionModelList<CloudType>>
74  (
76  );
77  }
78 
79 
80  //- Destructor
81  virtual ~InjectionModelList() = default;
82 
83 
84 
85  // Member Functions
86 
87  // Access
88 
89  //- Return the minimum start-of-injection time
90  scalar timeStart() const;
91 
92  //- Return the maximum end-of-injection time
93  scalar timeEnd() const;
94 
95  //- Volume of parcels to introduce relative to SOI
96  scalar volumeToInject(const scalar time0, const scalar time1);
97 
98  //- Return the average parcel mass
99  scalar averageParcelMass();
100 
101 
102  // Edit
103 
104  //- Set injector locations when mesh is updated
105  void updateMesh();
106 
107 
108  // Per-injection event functions
109 
110  //- Main injection loop
111  template<class TrackCloudType>
112  void inject
113  (
114  TrackCloudType& cloud,
115  typename CloudType::parcelType::trackingData& td
116  );
117 
118  //- Main injection loop - steady-state
119  template<class TrackCloudType>
120  void injectSteadyState
121  (
122  TrackCloudType& cloud,
123  typename CloudType::parcelType::trackingData& td,
124  const scalar trackTime
125  );
126 
127 
128  // I-O
129 
130  //- Write injection info
131  virtual void info();
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #ifdef NoRepository
142  #include "InjectionModelList.C"
143 #endif
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
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.
DSMCCloud< dsmcParcel > CloudType
InjectionModelList(CloudType &owner)
Construct null from owner.
void updateMesh()
Set injector locations when mesh is updated.
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 registry collection of lagrangian particles.
Definition: cloud.H:53
virtual ~InjectionModelList()=default
Destructor.
List of injection models.
virtual void info()
Write injection info.
scalar timeEnd() const
Return the maximum end-of-injection time.
Namespace for OpenFOAM.