FreeFOAM The Cross-Platform CFD Toolkit
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 | Copyright (C) 2009-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::BinaryCollisionModel
26 
27 Description
28  Templated DSMC particle collision class
29 
30 SourceFiles
31  BinaryCollisionModel.C
32  NewBinaryCollisionModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef BinaryCollisionModel_H
37 #define BinaryCollisionModel_H
38 
39 #include <OpenFOAM/IOdictionary.H>
40 #include <OpenFOAM/autoPtr.H>
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class BinaryCollisionModel Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class CloudType>
54 {
55  // Private data
56 
57  //- The cloud dictionary
58  const dictionary& dict_;
59 
60  // reference to the owner cloud class
61  CloudType& owner_;
62 
63  //- The coefficients dictionary
64  const dictionary coeffDict_;
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("BinaryCollisionModel");
71 
72  //- Declare runtime constructor selection table
74  (
75  autoPtr,
77  dictionary,
78  (
79  const dictionary& dict,
80  CloudType& owner
81  ),
82  (dict, owner)
83  );
84 
85 
86  // Constructors
87 
88  //- Construct from components
90  (
91  const dictionary& dict,
92  CloudType& owner,
93  const word& type
94  );
95 
96 
97  // Destructor
98  virtual ~BinaryCollisionModel();
99 
100 
101  //- Selector
103  (
104  const dictionary& dict,
105  CloudType& owner
106  );
107 
108 
109  // Access
110 
111  //- Return the owner cloud object
112  const CloudType& owner() const;
113 
114  //- Return non-const access to the owner cloud object
115  CloudType& owner();
116 
117  //- Return the dictionary
118  const dictionary& dict() const;
119 
120  //- Return the coefficients dictionary
121  const dictionary& coeffDict() const;
122 
123 
124  // Member Functions
125 
126  //- Return the collision cross section * relative velocity product
127  virtual scalar sigmaTcR
128  (
129  label typeIdP,
130  label typeIdQ,
131  const vector& UP,
132  const vector& UQ
133  ) const = 0;
134 
135  //- Apply collision
136  virtual void collide
137  (
138  label typeIdP,
139  label typeIdQ,
140  vector& UP,
141  vector& UQ,
142  scalar& EiP,
143  scalar& EiQ
144  ) = 0;
145 };
146 
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 } // End namespace Foam
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 #define makeBinaryCollisionModel(CloudType) \
155  \
156  defineNamedTemplateTypeNameAndDebug \
157  ( \
158  BinaryCollisionModel<CloudType>, \
159  0 \
160  ); \
161  \
162  defineTemplateRunTimeSelectionTable \
163  ( \
164  BinaryCollisionModel<CloudType>, \
165  dictionary \
166  );
167 
168 
169 #define makeBinaryCollisionModelType(SS, CloudType, ParcelType) \
170  \
171  defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \
172  \
173  BinaryCollisionModel<CloudType<ParcelType> >:: \
174  adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \
175  add##SS##CloudType##ParcelType##ConstructorToTable_;
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #ifdef NoRepository
181 # include "BinaryCollisionModel.C"
182 #endif
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************ vim: set sw=4 sts=4 et: ************************ //