FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

BinaryCollisionModel.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2009-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::BinaryCollisionModel
00026 
00027 Description
00028     Templated DSMC particle collision class
00029 
00030 SourceFiles
00031     BinaryCollisionModel.C
00032     NewBinaryCollisionModel.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef BinaryCollisionModel_H
00037 #define BinaryCollisionModel_H
00038 
00039 #include <OpenFOAM/IOdictionary.H>
00040 #include <OpenFOAM/autoPtr.H>
00041 #include <OpenFOAM/runTimeSelectionTables.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 /*---------------------------------------------------------------------------*\
00049                      Class BinaryCollisionModel Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 template<class CloudType>
00053 class BinaryCollisionModel
00054 {
00055     // Private data
00056 
00057         //- The cloud dictionary
00058         const dictionary& dict_;
00059 
00060         // reference to the owner cloud class
00061         CloudType& owner_;
00062 
00063         //- The coefficients dictionary
00064         const dictionary coeffDict_;
00065 
00066 
00067 public:
00068 
00069     //- Runtime type information
00070     TypeName("BinaryCollisionModel");
00071 
00072     //- Declare runtime constructor selection table
00073     declareRunTimeSelectionTable
00074     (
00075         autoPtr,
00076         BinaryCollisionModel,
00077         dictionary,
00078         (
00079             const dictionary& dict,
00080             CloudType& owner
00081         ),
00082         (dict, owner)
00083     );
00084 
00085 
00086     // Constructors
00087 
00088         //- Construct from components
00089         BinaryCollisionModel
00090         (
00091             const dictionary& dict,
00092             CloudType& owner,
00093             const word& type
00094         );
00095 
00096 
00097     // Destructor
00098     virtual ~BinaryCollisionModel();
00099 
00100 
00101     //- Selector
00102     static autoPtr<BinaryCollisionModel<CloudType> > New
00103     (
00104         const dictionary& dict,
00105         CloudType& owner
00106     );
00107 
00108 
00109     // Access
00110 
00111         //- Return the owner cloud object
00112         const CloudType& owner() const;
00113 
00114         //- Return non-const access to the owner cloud object
00115         CloudType& owner();
00116 
00117         //- Return the dictionary
00118         const dictionary& dict() const;
00119 
00120         //- Return the coefficients dictionary
00121         const dictionary& coeffDict() const;
00122 
00123 
00124     // Member Functions
00125 
00126         //- Return the collision cross section * relative velocity product
00127         virtual scalar sigmaTcR
00128         (
00129             label typeIdP,
00130             label typeIdQ,
00131             const vector& UP,
00132             const vector& UQ
00133         ) const = 0;
00134 
00135         //- Apply collision
00136         virtual void collide
00137         (
00138             label typeIdP,
00139             label typeIdQ,
00140             vector& UP,
00141             vector& UQ,
00142             scalar& EiP,
00143             scalar& EiQ
00144         ) = 0;
00145 };
00146 
00147 
00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00149 
00150 } // End namespace Foam
00151 
00152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00153 
00154 #define makeBinaryCollisionModel(CloudType)                                   \
00155                                                                               \
00156     defineNamedTemplateTypeNameAndDebug                                       \
00157     (                                                                         \
00158         BinaryCollisionModel<CloudType>,                                      \
00159         0                                                                     \
00160     );                                                                        \
00161                                                                               \
00162     defineTemplateRunTimeSelectionTable                                       \
00163     (                                                                         \
00164         BinaryCollisionModel<CloudType>,                                      \
00165         dictionary                                                            \
00166     );
00167 
00168 
00169 #define makeBinaryCollisionModelType(SS, CloudType, ParcelType)               \
00170                                                                               \
00171     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
00172                                                                               \
00173     BinaryCollisionModel<CloudType<ParcelType> >::                            \
00174         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
00175             add##SS##CloudType##ParcelType##ConstructorToTable_;
00176 
00177 
00178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00179 
00180 #ifdef NoRepository
00181 #   include "BinaryCollisionModel.C"
00182 #endif
00183 
00184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00185 
00186 #endif
00187 
00188 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines