WallInteractionModel.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-2017 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::WallInteractionModel
28 
29 Description
30  Templated wall interaction model class
31 
32 SourceFiles
33  WallInteractionModel.C
34  WallInteractionModelNew.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef WallInteractionModel_H
39 #define WallInteractionModel_H
40 
41 #include "IOdictionary.H"
42 #include "autoPtr.H"
43 #include "runTimeSelectionTables.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class WallInteractionModel Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class CloudType>
55 class WallInteractionModel
56 {
57  // Private data
58 
59  //- Reference to the owner cloud class
60  CloudType& owner_;
61 
62  //- Reference to the cloud dictionary
63  const dictionary& dict_;
64 
65  //- The coefficients dictionary
66  const dictionary coeffDict_;
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("WallInteractionModel");
73 
74  //- Declare runtime constructor selection table
76  (
77  autoPtr,
79  dictionary,
80  (
81  const dictionary& dict,
83  ),
84  (dict, owner)
85  );
86 
87 
88  // Constructors
89 
90  //- Construct null from owner
92 
93  //- Construct from components
95  (
96  const dictionary& dict,
98  const word& type
99  );
100 
101 
102  //- Destructor
103  virtual ~WallInteractionModel();
104 
105 
106  //- Selector
107  static autoPtr<WallInteractionModel<CloudType>> New
108  (
109  const dictionary& dict,
111  );
112 
113 
114  // Access
115 
116  //- Return the owner cloud object
117  const CloudType& owner() const;
118 
119  //- Return non-const access to the owner cloud object
120  CloudType& owner();
121 
122  //- Return the dictionary
123  const dictionary& dict() const;
124 
125  //- Return the coefficients dictionary
126  const dictionary& coeffDict() const;
127 
128 
129  // Member Functions
130 
131  //- Apply wall correction
132  virtual void correct(typename CloudType::parcelType& p) = 0;
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #define makeWallInteractionModel(CloudType) \
143  \
144  defineNamedTemplateTypeNameAndDebug(WallInteractionModel<CloudType>, 0); \
145  \
146  defineTemplateRunTimeSelectionTable \
147  ( \
148  WallInteractionModel<CloudType>, \
149  dictionary \
150  );
151 
152 
153 #define makeWallInteractionModelType(SS, CloudType) \
154  \
155  defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \
156  \
157  WallInteractionModel<CloudType>:: \
158  adddictionaryConstructorToTable<SS<CloudType>> \
159  add##SS##CloudType##ConstructorToTable_;
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #ifdef NoRepository
165  #include "WallInteractionModel.C"
166 #endif
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
Foam::WallInteractionModel::WallInteractionModel
WallInteractionModel(CloudType &owner)
Construct null from owner.
Definition: WallInteractionModel.C:34
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::WallInteractionModel::correct
virtual void correct(typename CloudType::parcelType &p)=0
Apply wall correction.
Foam::WallInteractionModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, WallInteractionModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
Foam::WallInteractionModel::dict
const dictionary & dict() const
Return the dictionary.
Definition: WallInteractionModel.C:80
WallInteractionModel.C
Foam::CloudType
DSMCCloud< dsmcParcel > CloudType
Definition: makeDSMCParcelBinaryCollisionModels.C:38
Foam::WallInteractionModel::owner
const CloudType & owner() const
Return the owner cloud object.
Definition: WallInteractionModel.C:66
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
IOdictionary.H
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
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::WallInteractionModel::~WallInteractionModel
virtual ~WallInteractionModel()
Destructor.
Definition: WallInteractionModel.C:59
Foam::DSMCCloud::parcelType
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Foam::WallInteractionModel::TypeName
TypeName("WallInteractionModel")
Runtime type information.
Foam::WallInteractionModel::New
static autoPtr< WallInteractionModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: WallInteractionModelNew.C:36
autoPtr.H
Foam::WallInteractionModel::coeffDict
const dictionary & coeffDict() const
Return the coefficients dictionary.
Definition: WallInteractionModel.C:88