NoInjection.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-2016 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::NoInjection
28 
29 Group
30  grpLagrangianIntermediateInjectionSubModels
31 
32 Description
33  Place holder for 'none' option
34 
35 SourceFiles
36  NoInjection.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef NoInjection_H
41 #define NoInjection_H
42 
43 #include "InjectionModel.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class NoInjection Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class CloudType>
55 class NoInjection
56 :
57  public InjectionModel<CloudType>
58 {
59 
60 public:
61 
62  //- Runtime type information
63  TypeName("none");
64 
65 
66  // Constructors
67 
68  //- Construct from components
69  NoInjection(const dictionary&, CloudType&, const word&);
70 
71  //- Construct copy
73 
74  //- Construct and return a clone
76  {
78  (
79  new NoInjection<CloudType>(*this)
80  );
81  }
82 
83 
84  //- Destructor
85  virtual ~NoInjection();
86 
87 
88  // Member Functions
89 
90  //- Flag to indicate whether model activates injection model
91  bool active() const;
92 
93  //- Return the end-of-injection time
94  scalar timeEnd() const;
95 
96  //- Number of parcels to introduce relative to SOI
97  virtual label parcelsToInject(const scalar time0, const scalar time1);
98 
99  //- Volume of parcels to introduce relative to SOI
100  virtual scalar volumeToInject(const scalar time0, const scalar time1);
101 
102 
103  // Injection geometry
104 
105  //- Set the injection position and owner cell, tetFace and tetPt
106  virtual void setPositionAndCell
107  (
108  const label parcelI,
109  const label nParcels,
110  const scalar time,
111  vector& position,
112  label& cellOwner,
113  label& tetFacei,
114  label& tetPti
115  );
116 
117  virtual void setProperties
118  (
119  const label parcelI,
120  const label nParcels,
121  const scalar time,
122  typename CloudType::parcelType& parcel
123  );
124 
125  //- Flag to identify whether model fully describes the parcel
126  virtual bool fullyDescribed() const;
127 
128  //- Return flag to identify whether or not injection of parcelI is
129  // permitted
130  virtual bool validInjection(const label parcelI);
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #ifdef NoRepository
141  #include "NoInjection.C"
142 #endif
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
Foam::NoInjection::clone
virtual autoPtr< InjectionModel< CloudType > > clone() const
Construct and return a clone.
Definition: NoInjection.H:74
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::NoInjection::setPositionAndCell
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.
Definition: NoInjection.C:99
Foam::NoInjection::fullyDescribed
virtual bool fullyDescribed() const
Flag to identify whether model fully describes the parcel.
Definition: NoInjection.C:129
Foam::InjectionModel
Templated injection model class.
Definition: InjectionModel.H:73
Foam::NoInjection::active
bool active() const
Flag to indicate whether model activates injection model.
Definition: NoInjection.C:62
InjectionModel.H
Foam::NoInjection::volumeToInject
virtual scalar volumeToInject(const scalar time0, const scalar time1)
Volume of parcels to introduce relative to SOI.
Definition: NoInjection.C:88
Foam::NoInjection
Place holder for 'none' option.
Definition: NoInjection.H:54
Foam::NoInjection::~NoInjection
virtual ~NoInjection()
Destructor.
Definition: NoInjection.C:55
Foam::NoInjection::validInjection
virtual bool validInjection(const label parcelI)
Return flag to identify whether or not injection of parcelI is.
Definition: NoInjection.C:136
Foam::NoInjection::TypeName
TypeName("none")
Runtime type information.
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::NoInjection::setProperties
virtual void setProperties(const label parcelI, const label nParcels, const scalar time, typename CloudType::parcelType &parcel)
Set the parcel properties.
Definition: NoInjection.C:113
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
NoInjection.C
Foam::Vector< scalar >
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::NoInjection::timeEnd
scalar timeEnd() const
Return the end-of-injection time.
Definition: NoInjection.C:69
Foam::NoInjection::NoInjection
NoInjection(const dictionary &, CloudType &, const word &)
Construct from components.
Definition: NoInjection.C:35
Foam::NoInjection::parcelsToInject
virtual label parcelsToInject(const scalar time0, const scalar time1)
Number of parcels to introduce relative to SOI.
Definition: NoInjection.C:77