initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / dsmc / submodels / BinaryCollisionModel / BinaryCollisionModel / BinaryCollisionModel.H
blob0dc8f02ea7d73f24da679049d2a3172e442e2c0d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2009-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::BinaryCollisionModel
28 Description
29     Templated DSMC particle collision class
31 SourceFiles
32     BinaryCollisionModel.C
33     NewBinaryCollisionModel.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef BinaryCollisionModel_H
38 #define BinaryCollisionModel_H
40 #include "IOdictionary.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                      Class BinaryCollisionModel Declaration
51 \*---------------------------------------------------------------------------*/
53 template<class CloudType>
54 class BinaryCollisionModel
56     // Private data
58         //- The cloud dictionary
59         const dictionary& dict_;
61         // reference to the owner cloud class
62         CloudType& owner_;
64         //- The coefficients dictionary
65         const dictionary coeffDict_;
68 public:
70     //- Runtime type information
71     TypeName("BinaryCollisionModel");
73     //- Declare runtime constructor selection table
74     declareRunTimeSelectionTable
75     (
76         autoPtr,
77         BinaryCollisionModel,
78         dictionary,
79         (
80             const dictionary& dict,
81             CloudType& owner
82         ),
83         (dict, owner)
84     );
87     // Constructors
89         //- Construct from components
90         BinaryCollisionModel
91         (
92             const dictionary& dict,
93             CloudType& owner,
94             const word& type
95         );
98     // Destructor
99     virtual ~BinaryCollisionModel();
102     //- Selector
103     static autoPtr<BinaryCollisionModel<CloudType> > New
104     (
105         const dictionary& dict,
106         CloudType& owner
107     );
110     // Access
112         //- Return the owner cloud object
113         const CloudType& owner() const;
115         //- Return non-const access to the owner cloud object
116         CloudType& owner();
118         //- Return the dictionary
119         const dictionary& dict() const;
121         //- Return the coefficients dictionary
122         const dictionary& coeffDict() const;
125     // Member Functions
127         //- Return the collision cross section * relative velocity product
128         virtual scalar sigmaTcR
129         (
130             label typeIdP,
131             label typeIdQ,
132             const vector& UP,
133             const vector& UQ
134         ) const = 0;
136         //- Apply collision
137         virtual void collide
138         (
139             label typeIdP,
140             label typeIdQ,
141             vector& UP,
142             vector& UQ,
143             scalar& EiP,
144             scalar& EiQ
145         ) = 0;
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 } // End namespace Foam
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 #define makeBinaryCollisionModel(CloudType)                                   \
156                                                                               \
157     defineNamedTemplateTypeNameAndDebug                                       \
158     (                                                                         \
159         BinaryCollisionModel<CloudType>,                                      \
160         0                                                                     \
161     );                                                                        \
162                                                                               \
163     defineTemplateRunTimeSelectionTable                                       \
164     (                                                                         \
165         BinaryCollisionModel<CloudType>,                                      \
166         dictionary                                                            \
167     );
170 #define makeBinaryCollisionModelType(SS, CloudType, ParcelType)               \
171                                                                               \
172     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
173                                                                               \
174     BinaryCollisionModel<CloudType<ParcelType> >::                            \
175         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
176             add##SS##CloudType##ParcelType##ConstructorToTable_;
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 #ifdef NoRepository
182 #   include "BinaryCollisionModel.C"
183 #endif
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 #endif
189 // ************************************************************************* //