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

DragModel.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) 1991-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::DragModel
00027 
00028 Description
00029     Templated drag model class
00030 
00031 SourceFiles
00032     DragModel.C
00033     NewDragModel.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef DragModel_H
00038 #define DragModel_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 DragModel Declaration
00051 \*---------------------------------------------------------------------------*/
00052 
00053 template<class CloudType>
00054 class DragModel
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 
00065 public:
00066 
00067     //- Runtime type information
00068     TypeName("DragModel");
00069 
00070     //- Declare runtime constructor selection table
00071     declareRunTimeSelectionTable
00072     (
00073         autoPtr,
00074         DragModel,
00075         dictionary,
00076         (
00077             const dictionary& dict,
00078             CloudType& owner
00079         ),
00080         (dict, owner)
00081     );
00082 
00083 
00084     // Constructors
00085 
00086         //- Construct from components
00087         DragModel
00088         (
00089             const dictionary& dict,
00090             CloudType& owner
00091         );
00092 
00093 
00094     //- Destructor
00095     virtual ~DragModel();
00096 
00097 
00098     //- Selector
00099     static autoPtr<DragModel<CloudType> > New
00100     (
00101         const dictionary& dict,
00102         CloudType& cloud
00103     );
00104 
00105 
00106     // Access
00107 
00108         //- Return the owner cloud object
00109         const CloudType& owner() const;
00110 
00111         //- Return the dictionary
00112         const dictionary& dict() const;
00113 
00114 
00115     // Member Functions
00116 
00117         //- Flag to indicate whether model activates drag model
00118         virtual bool active() const = 0;
00119 
00120         //- Return drag coefficient
00121         virtual scalar Cd(const scalar Re) const = 0;
00122 
00123         //- Return momentum transfer coefficient
00124         //  Drag force per unit particle surface area = utc(U - Up)
00125         scalar utc
00126         (
00127             const vector& Ur,
00128             const scalar d,
00129             const scalar rhoc,
00130             const scalar mu
00131         ) const;
00132 };
00133 
00134 
00135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00136 
00137 } // End namespace Foam
00138 
00139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00140 
00141 #define makeDragModel(CloudType)                                              \
00142                                                                               \
00143     defineNamedTemplateTypeNameAndDebug(DragModel<CloudType>, 0);             \
00144                                                                               \
00145     defineTemplateRunTimeSelectionTable(DragModel<CloudType>, dictionary);
00146 
00147 
00148 #define makeDragModelType(SS, CloudType, ParcelType)                          \
00149                                                                               \
00150     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
00151                                                                               \
00152     DragModel<CloudType<ParcelType> >::                                       \
00153         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
00154             add##SS##CloudType##ParcelType##ConstructorToTable_;
00155 
00156 
00157 #define makeDragModelThermoType(SS, CloudType, ParcelType, ThermoType)        \
00158                                                                               \
00159     defineNamedTemplateTypeNameAndDebug                                       \
00160     (                                                                         \
00161         SS<CloudType<ParcelType<ThermoType> > >,                              \
00162         0                                                                     \
00163     );                                                                        \
00164                                                                               \
00165     DragModel<CloudType<ParcelType<ThermoType> > >::                          \
00166         adddictionaryConstructorToTable                                       \
00167             <SS<CloudType<ParcelType<ThermoType> > > >                        \
00168             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
00169 
00170 
00171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00172 
00173 #ifdef NoRepository
00174 #   include "DragModel.C"
00175 #endif
00176 
00177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00178 
00179 #endif
00180 
00181 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd