1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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
29 Templated drag model class
35 \*---------------------------------------------------------------------------*/
40 #include "IOdictionary.H"
42 #include "runTimeSelectionTables.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class DragModel Declaration
51 \*---------------------------------------------------------------------------*/
53 template<class CloudType>
58 //- The cloud dictionary
59 const dictionary& dict_;
61 //- Reference to the owner cloud class
67 //- Runtime type information
68 TypeName("DragModel");
70 //- Declare runtime constructor selection table
71 declareRunTimeSelectionTable
77 const dictionary& dict,
86 //- Construct from components
89 const dictionary& dict,
99 static autoPtr<DragModel<CloudType> > New
101 const dictionary& dict,
108 //- Return the owner cloud object
109 const CloudType& owner() const;
111 //- Return the dictionary
112 const dictionary& dict() const;
117 //- Flag to indicate whether model activates drag model
118 virtual bool active() const = 0;
120 //- Return drag coefficient
121 virtual scalar Cd(const scalar Re) const = 0;
123 //- Return momentum transfer coefficient
124 // Drag force per unit particle surface area = utc(U - Up)
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 } // End namespace Foam
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 #define makeDragModel(CloudType) \
143 defineNamedTemplateTypeNameAndDebug(DragModel<CloudType>, 0); \
145 defineTemplateRunTimeSelectionTable(DragModel<CloudType>, dictionary);
148 #define makeDragModelType(SS, CloudType, ParcelType) \
150 defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \
152 DragModel<CloudType<ParcelType> >:: \
153 adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \
154 add##SS##CloudType##ParcelType##ConstructorToTable_;
157 #define makeDragModelThermoType(SS, CloudType, ParcelType, ThermoType) \
159 defineNamedTemplateTypeNameAndDebug \
161 SS<CloudType<ParcelType<ThermoType> > >, \
165 DragModel<CloudType<ParcelType<ThermoType> > >:: \
166 adddictionaryConstructorToTable \
167 <SS<CloudType<ParcelType<ThermoType> > > > \
168 add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 # include "DragModel.C"
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 // ************************************************************************* //