WallModel.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-2020 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::WallModel
26 
27 Description
28  Templated wall interaction class
29 
30 SourceFiles
31  WallModel.C
32  WallModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef WallModel_H
37 #define WallModel_H
38 
39 #include "IOdictionary.H"
40 #include "autoPtr.H"
41 #include "runTimeSelectionTables.H"
42 #include "WallSiteData.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class WallModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class CloudType>
54 class WallModel
55 {
56  // Private Data
57 
58  //- The CollisionModel 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("wallModel");
72 
73  //- Declare runtime constructor selection table
75  (
76  autoPtr,
77  WallModel,
78  dictionary,
79  (
80  const dictionary& dict,
82  ),
83  (dict, owner)
84  );
85 
86 
87  // Constructors
88 
89  //- Construct from components
90  WallModel
91  (
92  const dictionary& dict,
93  CloudType& owner,
94  const word& type
95  );
96 
97 
98  //- Destructor
99  virtual ~WallModel();
100 
101 
102  //- Selector
103  static autoPtr<WallModel<CloudType>> New
104  (
105  const dictionary& dict,
106  CloudType& owner
107  );
108 
109 
110  // Access
111 
112  //- Return the owner cloud object
113  const CloudType& owner() const;
114 
115  //- Return non-const access to the owner cloud object
116  CloudType& owner();
117 
118  //- Return the dictionary
119  const dictionary& dict() const;
120 
121  //- Return the coefficients dictionary
122  const dictionary& coeffDict() const;
123 
124 
125  // Member Functions
126 
127  //- Return the effective radius for a particle for the model
128  virtual scalar pREff(const typename CloudType::parcelType& p) const = 0;
129 
130  //- Whether the WallModel has a timestep limit that will
131  // require subCycling
132  virtual bool controlsTimestep() const = 0;
133 
134  //- For WallModels that control the timestep, calculate the
135  // number of subCycles needed to satisfy the minimum
136  // allowable timestep
137  virtual label nSubCycles() const = 0;
138 
139  //- Calculate the wall interaction for a parcel
140  virtual void evaluateWall
141  (
142  typename CloudType::parcelType& p,
143  const List<point>& flatSitePoints,
144  const List<WallSiteData<vector>>& flatSiteData,
145  const List<point>& sharpSitePoints,
146  const List<WallSiteData<vector>>& sharpSiteData
147  ) const = 0;
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 #define makeWallModel(CloudType) \
158  \
159  typedef Foam::CloudType::collidingCloudType collidingCloudType; \
160  \
161  defineNamedTemplateTypeNameAndDebug \
162  ( \
163  Foam::WallModel<collidingCloudType>, \
164  0 \
165  ); \
166  \
167  namespace Foam \
168  { \
169  defineTemplateRunTimeSelectionTable \
170  ( \
171  WallModel<collidingCloudType>, \
172  dictionary \
173  ); \
174  }
175 
177 #define makeWallModelType(SS, CloudType) \
178  \
179  typedef Foam::CloudType::collidingCloudType collidingCloudType; \
180  \
181  defineNamedTemplateTypeNameAndDebug(Foam::SS<collidingCloudType>, 0); \
182  \
183  Foam::WallModel<collidingCloudType>:: \
184  adddictionaryConstructorToTable<Foam::SS<collidingCloudType>> \
185  add##SS##CloudType##ConstructorToTable_;
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 #ifdef NoRepository
191  #include "WallModel.C"
192 #endif
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
virtual label nSubCycles() const =0
For WallModels that control the timestep, calculate the.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
DSMCCloud< dsmcParcel > CloudType
const dictionary & coeffDict() const
Return the coefficients dictionary.
Definition: WallModel.C:78
const CloudType & owner() const
Return the owner cloud object.
Definition: WallModel.C:55
virtual void evaluateWall(typename CloudType::parcelType &p, const List< point > &flatSitePoints, const List< WallSiteData< vector >> &flatSiteData, const List< point > &sharpSitePoints, const List< WallSiteData< vector >> &sharpSiteData) const =0
Calculate the wall interaction for a parcel.
WallModel(const dictionary &dict, CloudType &owner, const word &type)
Construct from components.
Definition: WallModel.C:32
declareRunTimeSelectionTable(autoPtr, WallModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:221
const dictionary & dict() const
Return the dictionary.
Definition: WallModel.C:70
TypeName("wallModel")
Runtime type information.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
virtual bool controlsTimestep() const =0
Whether the WallModel has a timestep limit that will.
static autoPtr< WallModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: WallModelNew.C:33
virtual ~WallModel()
Destructor.
Definition: WallModel.C:47
virtual scalar pREff(const typename CloudType::parcelType &p) const =0
Return the effective radius for a particle for the model.
Macros to ease declaration of run-time selection tables.
volScalarField & p
Namespace for OpenFOAM.