initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / Kinematic / DragModel / DragModel / DragModel.H
blob4b4d6c4dd83b46efae005017e1759445e3705326
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::DragModel
28 Description
29     Templated drag model class
31 SourceFiles
32     DragModel.C
33     NewDragModel.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef DragModel_H
38 #define DragModel_H
40 #include "IOdictionary.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                           Class DragModel Declaration
51 \*---------------------------------------------------------------------------*/
53 template<class CloudType>
54 class DragModel
56     // Private data
58         //- The cloud dictionary
59         const dictionary& dict_;
61         //- Reference to the owner cloud class
62         CloudType& owner_;
65 public:
67     //- Runtime type information
68     TypeName("DragModel");
70     //- Declare runtime constructor selection table
71     declareRunTimeSelectionTable
72     (
73         autoPtr,
74         DragModel,
75         dictionary,
76         (
77             const dictionary& dict,
78             CloudType& owner
79         ),
80         (dict, owner)
81     );
84     // Constructors
86         //- Construct from components
87         DragModel
88         (
89             const dictionary& dict,
90             CloudType& owner
91         );
94     //- Destructor
95     virtual ~DragModel();
98     //- Selector
99     static autoPtr<DragModel<CloudType> > New
100     (
101         const dictionary& dict,
102         CloudType& cloud
103     );
106     // Access
108         //- Return the owner cloud object
109         const CloudType& owner() const;
111         //- Return the dictionary
112         const dictionary& dict() const;
115     // Member Functions
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)
125         scalar utc
126         (
127             const vector& Ur,
128             const scalar d,
129             const scalar rhoc,
130             const scalar mu
131         ) const;
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 } // End namespace Foam
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 #define makeDragModel(CloudType)                                              \
142                                                                               \
143     defineNamedTemplateTypeNameAndDebug(DragModel<CloudType>, 0);             \
144                                                                               \
145     defineTemplateRunTimeSelectionTable(DragModel<CloudType>, dictionary);
148 #define makeDragModelType(SS, CloudType, ParcelType)                          \
149                                                                               \
150     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
151                                                                               \
152     DragModel<CloudType<ParcelType> >::                                       \
153         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
154             add##SS##CloudType##ParcelType##ConstructorToTable_;
157 #define makeDragModelThermoType(SS, CloudType, ParcelType, ThermoType)        \
158                                                                               \
159     defineNamedTemplateTypeNameAndDebug                                       \
160     (                                                                         \
161         SS<CloudType<ParcelType<ThermoType> > >,                              \
162         0                                                                     \
163     );                                                                        \
164                                                                               \
165     DragModel<CloudType<ParcelType<ThermoType> > >::                          \
166         adddictionaryConstructorToTable                                       \
167             <SS<CloudType<ParcelType<ThermoType> > > >                        \
168             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 #ifdef NoRepository
174 #   include "DragModel.C"
175 #endif
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 #endif
181 // ************************************************************************* //