OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::BinaryCollisionModel
00027 
00028 Description
00029     Templated DSMC particle collision class
00030 
00031 SourceFiles
00032     BinaryCollisionModel.C
00033     NewBinaryCollisionModel.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef BinaryCollisionModel_H
00038 #define BinaryCollisionModel_H
00039 
00040 #include "IOdictionary.H"
00041 #include "autoPtr.H"
00042 #include "runTimeSelectionTables.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 /*---------------------------------------------------------------------------*\
00050                      Class BinaryCollisionModel Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 template<class CloudType>
00054 class BinaryCollisionModel
00055 {
00056     // Private data
00057 
00058         //- The cloud dictionary
00059         const dictionary& dict_;
00060 
00061         // reference to the owner cloud class
00062         CloudType& owner_;
00063 
00064         //- The coefficients dictionary
00065         const dictionary coeffDict_;
00066 
00067 
00068 public:
00069 
00070     //- Runtime type information
00071     TypeName("BinaryCollisionModel");
00072 
00073     //- Declare runtime constructor selection table
00074     declareRunTimeSelectionTable
00075     (
00076         autoPtr,
00077         BinaryCollisionModel,
00078         dictionary,
00079         (
00080             const dictionary& dict,
00081             CloudType& owner
00082         ),
00083         (dict, owner)
00084     );
00085 
00086 
00087     // Constructors
00088 
00089         //- Construct from components
00090         BinaryCollisionModel
00091         (
00092             const dictionary& dict,
00093             CloudType& owner,
00094             const word& type
00095         );
00096 
00097 
00098     // Destructor
00099     virtual ~BinaryCollisionModel();
00100 
00101 
00102     //- Selector
00103     static autoPtr<BinaryCollisionModel<CloudType> > New
00104     (
00105         const dictionary& dict,
00106         CloudType& owner
00107     );
00108 
00109 
00110     // Access
00111 
00112         //- Return the owner cloud object
00113         const CloudType& owner() const;
00114 
00115         //- Return non-const access to the owner cloud object
00116         CloudType& owner();
00117 
00118         //- Return the dictionary
00119         const dictionary& dict() const;
00120 
00121         //- Return the coefficients dictionary
00122         const dictionary& coeffDict() const;
00123 
00124 
00125     // Member Functions
00126 
00127         //- Return the collision cross section * relative velocity product
00128         virtual scalar sigmaTcR
00129         (
00130             label typeIdP,
00131             label typeIdQ,
00132             const vector& UP,
00133             const vector& UQ
00134         ) const = 0;
00135 
00136         //- Apply collision
00137         virtual void collide
00138         (
00139             label typeIdP,
00140             label typeIdQ,
00141             vector& UP,
00142             vector& UQ,
00143             scalar& EiP,
00144             scalar& EiQ
00145         ) = 0;
00146 };
00147 
00148 
00149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00150 
00151 } // End namespace Foam
00152 
00153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00154 
00155 #define makeBinaryCollisionModel(CloudType)                                   \
00156                                                                               \
00157     defineNamedTemplateTypeNameAndDebug                                       \
00158     (                                                                         \
00159         BinaryCollisionModel<CloudType>,                                      \
00160         0                                                                     \
00161     );                                                                        \
00162                                                                               \
00163     defineTemplateRunTimeSelectionTable                                       \
00164     (                                                                         \
00165         BinaryCollisionModel<CloudType>,                                      \
00166         dictionary                                                            \
00167     );
00168 
00169 
00170 #define makeBinaryCollisionModelType(SS, CloudType, ParcelType)               \
00171                                                                               \
00172     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
00173                                                                               \
00174     BinaryCollisionModel<CloudType<ParcelType> >::                            \
00175         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
00176             add##SS##CloudType##ParcelType##ConstructorToTable_;
00177 
00178 
00179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00180 
00181 #ifdef NoRepository
00182 #   include "BinaryCollisionModel.C"
00183 #endif
00184 
00185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00186 
00187 #endif
00188 
00189 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd