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

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