InflowBoundaryModel.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) 2011-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::InflowBoundaryModel
26 
27 
28 Description
29  Templated inflow boundary model class
30 
31 SourceFiles
32  InflowBoundaryModel.C
33  InflowBoundaryModelNew.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef InflowBoundaryModel_H
38 #define InflowBoundaryModel_H
39 
40 #include "IOdictionary.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class InflowBoundaryModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class CloudType>
54 class InflowBoundaryModel
55 {
56  // Private Data
57 
58  //- The cloud dictionary
59  const dictionary& dict_;
60 
61  // Reference to the owner cloud class
62  CloudType& owner_;
63 
64  //- The coefficients dictionary
65  const dictionary coeffDict_;
66 
67 
68 public:
69 
70  //- Runtime type information
71  TypeName("InflowBoundaryModel");
72 
73  //- Declare runtime constructor selection table
75  (
76  autoPtr,
78  dictionary,
79  (
80  const dictionary& dict,
82  ),
83  (dict, owner)
84  );
85 
86 
87  // Constructors
88 
89  //- Construct null from owner
91 
92  //- Construct from dictionary
94  (
95  const dictionary& dict,
96  CloudType& owner,
97  const word& type
98  );
99 
100 
101  //- Destructor
102  virtual ~InflowBoundaryModel();
103 
104 
105  //- Selector
106  static autoPtr<InflowBoundaryModel<CloudType>> New
107  (
108  const dictionary& dict,
109  CloudType& owner
110  );
111 
112 
113  // Access
114 
115  //- Return const access the owner cloud object
116  inline const CloudType& owner() const;
117 
118  //- Return non-const access the owner cloud object for manipulation
119  inline CloudType& owner();
120 
121  //- Return the owner cloud dictionary
122  inline const dictionary& dict() const;
123 
124  //- Return the coefficients dictionary
125  inline const dictionary& coeffDict() const;
126 
127  // Mapping
128 
129  //- Remap the particles to the correct cells following mesh change
130  virtual void autoMap(const polyTopoChangeMap&)
131  {}
132 
133  //- Introduce particles
134  virtual void inflow() = 0;
135 };
136 
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 #define makeInflowBoundaryModel(CloudType) \
145  \
146  defineNamedTemplateTypeNameAndDebug(InflowBoundaryModel<CloudType>, 0); \
147  \
148  defineTemplateRunTimeSelectionTable \
149  ( \
150  InflowBoundaryModel<CloudType>, \
151  dictionary \
152  );
153 
155 #define makeInflowBoundaryModelType(SS, CloudType) \
156  \
157  defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \
158  \
159  InflowBoundaryModel<CloudType>:: \
160  adddictionaryConstructorToTable<SS<CloudType>> \
161  add##SS##CloudType##ConstructorToTable_;
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #ifdef NoRepository
167  #include "InflowBoundaryModel.C"
168 #endif
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
DSMCCloud< dsmcParcel > CloudType
const CloudType & owner() const
Return const access the owner cloud object.
const dictionary & coeffDict() const
Return the coefficients dictionary.
declareRunTimeSelectionTable(autoPtr, InflowBoundaryModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
virtual ~InflowBoundaryModel()
Destructor.
InflowBoundaryModel(CloudType &owner)
Construct null from owner.
virtual void inflow()=0
Introduce particles.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const dictionary & dict() const
Return the owner cloud dictionary.
virtual void autoMap(const polyTopoChangeMap &)
Remap the particles to the correct cells following mesh change.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
static autoPtr< InflowBoundaryModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Macros to ease declaration of run-time selection tables.
TypeName("InflowBoundaryModel")
Runtime type information.
Namespace for OpenFOAM.