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