FreeFOAM The Cross-Platform CFD Toolkit
HeatTransferModel.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::HeatTransferModel
26 
27 Description
28  Templated heat transfer model class
29 
30 SourceFiles
31  HeatTransferModel.C
32  NewHeatTransferModel.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef HeatTransferModel_H
37 #define HeatTransferModel_H
38 
39 #include <OpenFOAM/IOdictionary.H>
40 #include <OpenFOAM/autoPtr.H>
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class HeatTransferModel Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 template<class CloudType>
54 {
55  // Private data
56 
57  //- The cloud dictionary
58  const dictionary& dict_;
59 
60  //- Reference to the owner cloud class
61  CloudType& owner_;
62 
63  //- The coefficients dictionary
64  const dictionary coeffDict_;
65 
66  //- Apply Bird's correction to the htc
67  const Switch BirdCorrection_;
68 
69 
70 public:
71 
72  //- Runtime type information
73  TypeName("HeatTransferModel");
74 
75  //- Declare runtime constructor selection table
77  (
78  autoPtr,
80  dictionary,
81  (
82  const dictionary& dict,
83  CloudType& owner
84  ),
85  (dict, owner)
86  );
87 
88 
89  // Constructors
90 
91  //- Construct null from owner
92  HeatTransferModel(CloudType& owner);
93 
94  //- Construct from dictionary
96  (
97  const dictionary& dict,
98  CloudType& owner,
99  const word& type
100  );
101 
102 
103  //- Destructor
104  virtual ~HeatTransferModel();
105 
106 
107  //- Selector
109  (
110  const dictionary& dict,
111  CloudType& owner
112  );
113 
114 
115  // Member Functions
116 
117  // Access
118 
119  //- Return the cloud dictionary
120  const dictionary& dict() const;
121 
122  //- Return the coefficients dictionary
123  const dictionary& coeffDict() const;
124 
125  //- Return the owner cloud object
126  const CloudType& owner() const;
127 
128  //- Return the Bird htc correction flag
129  const Switch& BirdCorrection() const;
130 
131  //- Flag to indicate whether model activates heat transfer model
132  virtual bool active() const = 0;
133 
134 
135  // Evaluation
136 
137  //- Nusselt number
138  virtual scalar Nu
139  (
140  const scalar Re,
141  const scalar Pr
142  ) const = 0;
143 
144  //- Return heat transfer coefficient
145  virtual scalar htc
146  (
147  const scalar dp,
148  const scalar Re,
149  const scalar Pr,
150  const scalar kappa,
151  const scalar NCpW
152  ) const;
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #define makeHeatTransferModel(CloudType) \
163  \
164  defineNamedTemplateTypeNameAndDebug(HeatTransferModel<CloudType>, 0); \
165  \
166  defineTemplateRunTimeSelectionTable \
167  ( \
168  HeatTransferModel<CloudType>, \
169  dictionary \
170  );
171 
172 
173 #define makeHeatTransferModelType(SS, CloudType, ParcelType) \
174  \
175  defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \
176  \
177  HeatTransferModel<CloudType<ParcelType> >:: \
178  adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \
179  add##SS##CloudType##ParcelType##ConstructorToTable_;
180 
181 
182 #define makeHeatTransferModelThermoType(SS, CloudType, ParcelType, ThermoType)\
183  \
184  defineNamedTemplateTypeNameAndDebug \
185  ( \
186  SS<CloudType<ParcelType<ThermoType> > >, \
187  0 \
188  ); \
189  \
190  HeatTransferModel<CloudType<ParcelType<ThermoType> > >:: \
191  adddictionaryConstructorToTable \
192  <SS<CloudType<ParcelType<ThermoType> > > > \
193  add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
194 
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 #ifdef NoRepository
200 #endif
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 #endif
205 
206 // ************************ vim: set sw=4 sts=4 et: ************************ //