initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / submodels / Thermodynamic / HeatTransferModel / HeatTransferModel / HeatTransferModel.H
blobbaf61f2395e973377c975c5f21b4c8f5c6b313fd
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::HeatTransferModel
28 Description
29     Templated heat transfer model class
31 SourceFiles
32     HeatTransferModel.C
33     NewHeatTransferModel.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef HeatTransferModel_H
38 #define HeatTransferModel_H
40 #include "IOdictionary.H"
41 #include "autoPtr.H"
42 #include "runTimeSelectionTables.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 /*---------------------------------------------------------------------------*\
50                        Class HeatTransferModel Declaration
51 \*---------------------------------------------------------------------------*/
53 template<class CloudType>
54 class HeatTransferModel
56     // Private data
58         //- The cloud dictionary
59         const dictionary& dict_;
61         //- Reference to the owner cloud class
62         CloudType& owner_;
64         //- The coefficients dictionary
65         const dictionary coeffDict_;
68 public:
70     //- Runtime type information
71     TypeName("HeatTransferModel");
73     //- Declare runtime constructor selection table
74     declareRunTimeSelectionTable
75     (
76         autoPtr,
77         HeatTransferModel,
78         dictionary,
79         (
80             const dictionary& dict,
81             CloudType& owner
82         ),
83         (dict, owner)
84     );
87     // Constructors
89         //- Construct null from owner
90         HeatTransferModel(CloudType& owner);
92         //- Construct from dictionary
93         HeatTransferModel
94         (
95             const dictionary& dict,
96             CloudType& owner,
97             const word& type
98         );
101     //- Destructor
102     virtual ~HeatTransferModel();
105     //- Selector
106     static autoPtr<HeatTransferModel<CloudType> > New
107     (
108         const dictionary& dict,
109         CloudType& owner
110     );
113     // Access
115         //- Return the cloud dictionary
116         const dictionary& dict() const;
118         //- Return the coefficients dictionary
119         const dictionary& coeffDict() const;
121         //- Return the owner cloud object
122         const CloudType& owner() const;
125     // Member Functions
127         //- Flag to indicate whether model activates heat transfer model
128         virtual bool active() const = 0;
130         //- Nusselt number
131         virtual scalar Nu
132         (
133             const scalar Re,
134             const scalar Pr
135         ) const = 0;
137         //- Prandtl number
138         virtual scalar Pr() const = 0;
140         //- Return heat transfer coefficient
141         virtual scalar h
142         (
143             const scalar dp,
144             const vector& Ur,
145             const scalar rhoc,
146             const scalar rhop,
147             const scalar cpc,
148             const scalar cpp,
149             const scalar muc
150         ) const;
152         //- Return linearised coefficient for temperature equation
153         virtual scalar Cu
154         (
155             const scalar dp,
156             const vector& Ur,
157             const scalar rhoc,
158             const scalar rhop,
159             const scalar cpc,
160             const scalar cpp,
161             const scalar muc
162         ) const;
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 } // End namespace Foam
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 #define makeHeatTransferModel(CloudType)                                      \
173                                                                               \
174     defineNamedTemplateTypeNameAndDebug(HeatTransferModel<CloudType>, 0);     \
175                                                                               \
176     defineTemplateRunTimeSelectionTable                                       \
177     (                                                                         \
178         HeatTransferModel<CloudType>,                                         \
179         dictionary                                                            \
180     );
183 #define makeHeatTransferModelType(SS, CloudType, ParcelType)                  \
184                                                                               \
185     defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0);       \
186                                                                               \
187     HeatTransferModel<CloudType<ParcelType> >::                               \
188         adddictionaryConstructorToTable<SS<CloudType<ParcelType> > >          \
189             add##SS##CloudType##ParcelType##ConstructorToTable_;
192 #define makeHeatTransferModelThermoType(SS, CloudType, ParcelType, ThermoType)\
193                                                                               \
194     defineNamedTemplateTypeNameAndDebug                                       \
195     (                                                                         \
196         SS<CloudType<ParcelType<ThermoType> > >,                              \
197         0                                                                     \
198     );                                                                        \
199                                                                               \
200     HeatTransferModel<CloudType<ParcelType<ThermoType> > >::                  \
201         adddictionaryConstructorToTable                                       \
202             <SS<CloudType<ParcelType<ThermoType> > > >                        \
203             add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 #ifdef NoRepository
209 #   include "HeatTransferModel.C"
210 #endif
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 #endif
216 // ************************************************************************* //