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
72  {
74  (
76  );
77  }
78 
79 
80  //- Destructor
81  virtual ~InjectionModelList();
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 to stream
131  virtual void info(Ostream& os);
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 // ************************************************************************* //
Foam::InjectionModelList::inject
void inject(TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td)
Main injection loop.
Definition: InjectionModelList.C:189
Foam::InjectionModelList::injectSteadyState
void injectSteadyState(TrackCloudType &cloud, typename CloudType::parcelType::trackingData &td, const scalar trackTime)
Main injection loop - steady-state.
Definition: InjectionModelList.C:204
InjectionModel.H
Foam::InjectionModelList::clone
virtual autoPtr< InjectionModelList< CloudType > > clone() const
Construct and return a clone.
Definition: InjectionModelList.H:70
Foam::InjectionModelList::timeEnd
scalar timeEnd() const
Return the maximum end-of-injection time.
Definition: InjectionModelList.C:131
Foam::InjectionModelList::averageParcelMass
scalar averageParcelMass()
Return the average parcel mass.
Definition: InjectionModelList.C:161
Foam::InjectionModelList::volumeToInject
scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
Definition: InjectionModelList.C:145
Foam::InjectionModelList::~InjectionModelList
virtual ~InjectionModelList()
Destructor.
Definition: InjectionModelList.C:111
Foam::CloudType
DSMCCloud< dsmcParcel > CloudType
Definition: makeDSMCParcelBinaryCollisionModels.C:38
dict
dictionary dict
Definition: searchingEngine.H:14
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::InjectionModelList::InjectionModelList
InjectionModelList(CloudType &owner)
Construct null from owner.
Definition: InjectionModelList.C:33
Foam::InjectionModelList::updateMesh
void updateMesh()
Set injector locations when mesh is updated.
Definition: InjectionModelList.C:177
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::cloud
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:57
Foam::InjectionModelList::info
virtual void info(Ostream &os)
Write injection info to stream.
Definition: InjectionModelList.C:218
PtrList.H
Foam::InjectionModelList::timeStart
scalar timeStart() const
Return the minimum start-of-injection time.
Definition: InjectionModelList.C:118
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::InjectionModelList
List of injection models.
Definition: KinematicCloud.H:83
InjectionModelList.C