BinaryCollisionModel.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::BinaryCollisionModel
28
29Description
30 Templated DSMC particle collision class
31
32SourceFiles
33 BinaryCollisionModel.C
34 BinaryCollisionModelNew.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef BinaryCollisionModel_H
39#define BinaryCollisionModel_H
40
41#include "IOdictionary.H"
42#include "autoPtr.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class BinaryCollisionModel Declaration
52\*---------------------------------------------------------------------------*/
53
54template<class CloudType>
56{
57 // Private data
58
59 //- The cloud dictionary
60 const dictionary& dict_;
61
62 // reference to the owner cloud class
63 CloudType& owner_;
64
65 //- The coefficients dictionary
66 const dictionary coeffDict_;
67
68
69public:
70
71 //- Runtime type information
72 TypeName("BinaryCollisionModel");
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
102 //- Destructor
103 virtual ~BinaryCollisionModel();
104
105
106 //- Selector
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 //- Flag to indicate whether model activates collision model
132 virtual bool active() const = 0;
133
134 //- Return the collision cross section * relative velocity product
135 virtual scalar sigmaTcR
136 (
137 const typename CloudType::parcelType& pP,
138 const typename CloudType::parcelType& pQ
139 ) const = 0;
140
141 //- Apply collision
142 virtual void collide
143 (
144 typename CloudType::parcelType& pP,
145 typename CloudType::parcelType& pQ
146 ) = 0;
147};
148
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152} // End namespace Foam
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156#define makeBinaryCollisionModel(CloudType) \
157 \
158 defineNamedTemplateTypeNameAndDebug \
159 ( \
160 BinaryCollisionModel<CloudType>, \
161 0 \
162 ); \
163 \
164 defineTemplateRunTimeSelectionTable \
165 ( \
166 BinaryCollisionModel<CloudType>, \
167 dictionary \
168 );
169
171#define makeBinaryCollisionModelType(SS, CloudType) \
172 \
173 defineNamedTemplateTypeNameAndDebug(SS<CloudType>, 0); \
174 \
175 BinaryCollisionModel<CloudType>:: \
176 adddictionaryConstructorToTable<SS<CloudType>> \
177 add##SS##CloudType##ConstructorToTable_;
178
179
180// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181
182#ifdef NoRepository
183 #include "BinaryCollisionModel.C"
184#endif
185
186// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187
188#endif
189
190// ************************************************************************* //
Templated DSMC particle collision class.
TypeName("BinaryCollisionModel")
Runtime type information.
virtual scalar sigmaTcR(const typename CloudType::parcelType &pP, const typename CloudType::parcelType &pQ) const =0
Return the collision cross section * relative velocity product.
static autoPtr< BinaryCollisionModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
virtual bool active() const =0
Flag to indicate whether model activates collision model.
const dictionary & coeffDict() const
Return the coefficients dictionary.
virtual ~BinaryCollisionModel()
Destructor.
const dictionary & dict() const
Return the dictionary.
const CloudType & owner() const
Return the owner cloud object.
declareRunTimeSelectionTable(autoPtr, BinaryCollisionModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
virtual void collide(typename CloudType::parcelType &pP, typename CloudType::parcelType &pQ)=0
Apply collision.
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
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