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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::WallModel
28
29Description
30 Templated wall interaction class
31
32SourceFiles
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"
44#include "WallSiteData.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class WallModel Declaration
53\*---------------------------------------------------------------------------*/
54
55template<class CloudType>
56class 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
70public:
71
72 //- Runtime type information
73 TypeName("wallModel");
74
75 //- Declare runtime constructor selection table
77 (
78 autoPtr,
81 (
82 const dictionary& dict,
84 ),
85 (dict, owner)
86 );
87
88
89 // Constructors
90
91 //- Construct from components
93 (
94 const dictionary& dict,
96 const word& type
97 );
98
99
100 //- Destructor
101 virtual ~WallModel();
102
103
104 //- Selector
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// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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
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// ************************************************************************* //
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
Templated wall interaction class.
Definition: WallModel.H:56
virtual scalar pREff(const typename CloudType::parcelType &p) const =0
Return the effective radius for a particle for the model.
virtual label nSubCycles() const =0
For WallModels that control the timestep, calculate the.
const dictionary & coeffDict() const
Return the coefficients dictionary.
Definition: WallModel.C:80
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.
virtual ~WallModel()
Destructor.
Definition: WallModel.C:49
virtual bool controlsTimestep() const =0
Whether the WallModel has a timestep limit that will.
const dictionary & dict() const
Return the dictionary.
Definition: WallModel.C:72
const CloudType & owner() const
Return the owner cloud object.
Definition: WallModel.C:57
TypeName("wallModel")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, WallModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
static autoPtr< WallModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: WallModelNew.C:36
Stores the patch ID and templated data to represent a collision with a wall to be passed to the wall ...
Definition: WallSiteData.H:67
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73