CollisionModel.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-------------------------------------------------------------------------------
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::CollisionModel
28
29Group
30 grpLagrangianIntermediateCollisionSubModels
31
32Description
33 Templated collision model class.
34
35SourceFiles
36 CollisionModel.C
37 CollisionModelNew.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef CollisionModel_H
42#define CollisionModel_H
43
44#include "IOdictionary.H"
45#include "autoPtr.H"
47#include "CloudSubModelBase.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54/*---------------------------------------------------------------------------*\
55 Class CollisionModel Declaration
56\*---------------------------------------------------------------------------*/
57
58template<class CloudType>
60:
61 public CloudSubModelBase<CloudType>
62{
63 // Protected data
64
65 //- Convenience typedef for parcel type
66 typedef typename CloudType::parcelType parcelType;
67
68
69public:
70
71 //- Runtime type information
72 TypeName("collisionModel");
73
74 //- Declare runtime constructor selection table
76 (
77 autoPtr,
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 //- Construct copy
103
104 //- Construct and return a clone
105 virtual autoPtr<CollisionModel<CloudType>> clone() const = 0;
106
107
108 //- Destructor
109 virtual ~CollisionModel();
110
111
112 //- Selector
114 (
115 const dictionary& dict,
117 );
118
119
120 // Member Functions
121
122 //- Return the number of times to subcycle the current
123 // timestep to meet the criteria of the collision model
124 virtual label nSubCycles() const = 0;
125
126 // Collision function
127 virtual void collide() = 0;
128};
129
130
131// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132
133} // End namespace Foam
134
135// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137#define makeCollisionModel(CloudType) \
138 \
139 typedef Foam::CloudType::collidingCloudType collidingCloudType; \
140 defineNamedTemplateTypeNameAndDebug \
141 ( \
142 Foam::CollisionModel<collidingCloudType>, \
143 0 \
144 ); \
145 namespace Foam \
146 { \
147 defineTemplateRunTimeSelectionTable \
148 ( \
149 CollisionModel<collidingCloudType>, \
150 dictionary \
151 ); \
152 }
153
155#define makeCollisionModelType(SS, CloudType) \
156 \
157 typedef Foam::CloudType::collidingCloudType collidingCloudType; \
158 defineNamedTemplateTypeNameAndDebug(Foam::SS<collidingCloudType>, 0); \
159 \
160 Foam::CollisionModel<collidingCloudType>:: \
161 adddictionaryConstructorToTable<Foam::SS<collidingCloudType>> \
162 add##SS##CloudType##collidingCloudType##ConstructorToTable_;
163
164
165// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166
167#ifdef NoRepository
168 #include "CollisionModel.C"
169#endif
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173#endif
174
175// ************************************************************************* //
Base class for cloud sub-models.
const CloudType & owner() const
Return const access to the owner cloud.
Templated collision model class.
virtual ~CollisionModel()
Destructor.
virtual void collide()=0
virtual label nSubCycles() const =0
Return the number of times to subcycle the current.
TypeName("collisionModel")
Runtime type information.
virtual autoPtr< CollisionModel< CloudType > > clone() const =0
Construct and return a clone.
declareRunTimeSelectionTable(autoPtr, CollisionModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
static autoPtr< CollisionModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
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
const dictionary & dict() const
Return const access to the cloud dictionary.
Definition: subModelBase.C:113
A class for handling words, derived from Foam::string.
Definition: word.H:68
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