StochasticCollisionModel.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::StochasticCollisionModel
28
29Group
30 grpLagrangianIntermediateCollisionSubModels
31
32Description
33 Templated stochastic collision model class
34
35SourceFiles
36 StochasticCollisionModel.C
37 StochasticCollisionModelNew.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef StochasticCollisionModel_H
42#define StochasticCollisionModel_H
43
44#include "IOdictionary.H"
45#include "autoPtr.H"
47#include "CloudSubModelBase.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54/*---------------------------------------------------------------------------*\
55 Class StochasticCollisionModel Declaration
56\*---------------------------------------------------------------------------*/
57
58template<class CloudType>
60:
61 public CloudSubModelBase<CloudType>
62{
63protected:
64
65 //- Main collision routine
66 virtual void collide
67 (
69 const scalar dt
70 ) = 0;
71
72
73public:
74
75 //- Runtime type information
76 TypeName("collisionModel");
77
78 //- Declare runtime constructor selection table
80 (
81 autoPtr,
84 (
85 const dictionary& dict,
87 ),
88 (dict, owner)
89 );
90
91
92 // Constructors
93
94 //- Construct null from owner
96
97 //- Construct from dictionary
99 (
100 const dictionary& dict,
102 const word& type
103 );
104
105 //- Construct copy
107
108 //- Construct and return a clone
110
111
112 //- Destructor
114
115
116 //- Selector
118 (
119 const dictionary& dict,
121 );
122
123
124 // Member Functions
125
126 //- Update the model
127 void update
128 (
130 const scalar dt
131 );
132};
133
134
135// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136
137} // End namespace Foam
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141#define makeStochasticCollisionModel(CloudType) \
142 \
143 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
144 defineNamedTemplateTypeNameAndDebug \
145 ( \
146 Foam::StochasticCollisionModel<kinematicCloudType>, \
147 0 \
148 ); \
149 namespace Foam \
150 { \
151 defineTemplateRunTimeSelectionTable \
152 ( \
153 StochasticCollisionModel<kinematicCloudType>, \
154 dictionary \
155 ); \
156 }
157
159#define makeStochasticCollisionModelType(SS, CloudType) \
160 \
161 typedef Foam::CloudType::kinematicCloudType kinematicCloudType; \
162 defineNamedTemplateTypeNameAndDebug(Foam::SS<kinematicCloudType>, 0); \
163 \
164 Foam::StochasticCollisionModel<kinematicCloudType>:: \
165 adddictionaryConstructorToTable<Foam::SS<kinematicCloudType>> \
166 add##SS##CloudType##kinematicCloudType##ConstructorToTable_;
167
168
169
170// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171
172#ifdef NoRepository
174#endif
175
176// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177
178#endif
179
180// ************************************************************************* //
Base class for cloud sub-models.
const CloudType & owner() const
Return const access to the owner cloud.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
Templated stochastic collision model class.
declareRunTimeSelectionTable(autoPtr, StochasticCollisionModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
virtual ~StochasticCollisionModel()
Destructor.
static autoPtr< StochasticCollisionModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
TypeName("collisionModel")
Runtime type information.
virtual autoPtr< StochasticCollisionModel< CloudType > > clone() const =0
Construct and return a clone.
virtual void collide(typename CloudType::parcelType::trackingData &td, const scalar dt)=0
Main collision routine.
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
Class used to pass data into container.
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
mesh update()
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