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) 2011-2015 OpenFOAM Foundation
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  HeatTransferModelNew.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef HeatTransferModel_H
37 #define HeatTransferModel_H
38 
39 #include "IOdictionary.H"
40 #include "autoPtr.H"
41 #include "runTimeSelectionTables.H"
42 #include "CloudSubModelBase.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class HeatTransferModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class CloudType>
54 class HeatTransferModel
55 :
56  public CloudSubModelBase<CloudType>
57 {
58  // Private data
59 
60  //- Apply Bird's correction to the htc
61  const Switch BirdCorrection_;
62 
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("heatTransferModel");
68 
69  //- Declare runtime constructor selection table
71  (
72  autoPtr,
74  dictionary,
75  (
76  const dictionary& dict,
77  CloudType& owner
78  ),
79  (dict, owner)
80  );
81 
82 
83  // Constructors
84 
85  //- Construct null from owner
87 
88  //- Construct from dictionary
90  (
91  const dictionary& dict,
92  CloudType& owner,
93  const word& type
94  );
95 
96  //- Construct copy
98 
99  //- Construct and return a clone
100  virtual autoPtr<HeatTransferModel<CloudType> > clone() const = 0;
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 Bird htc correction flag
120  const Switch& BirdCorrection() const;
121 
122 
123  // Evaluation
124 
125  //- Nusselt number
126  virtual scalar Nu
127  (
128  const scalar Re,
129  const scalar Pr
130  ) const = 0;
131 
132  //- Return heat transfer coefficient
133  virtual scalar htc
134  (
135  const scalar dp,
136  const scalar Re,
137  const scalar Pr,
138  const scalar kappa,
139  const scalar NCpW
140  ) const;
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #define makeHeatTransferModel(CloudType) \
151  \
152  typedef Foam::CloudType::thermoCloudType thermoCloudType; \
153  defineNamedTemplateTypeNameAndDebug \
154  ( \
155  Foam::HeatTransferModel<thermoCloudType>, \
156  0 \
157  ); \
158  namespace Foam \
159  { \
160  defineTemplateRunTimeSelectionTable \
161  ( \
162  HeatTransferModel<thermoCloudType>, \
163  dictionary \
164  ); \
165  }
166 
167 
168 #define makeHeatTransferModelType(SS, CloudType) \
169  \
170  typedef Foam::CloudType::thermoCloudType thermoCloudType; \
171  defineNamedTemplateTypeNameAndDebug(Foam::SS<thermoCloudType>, 0); \
172  \
173  Foam::HeatTransferModel<thermoCloudType>:: \
174  adddictionaryConstructorToTable<Foam::SS<thermoCloudType> > \
175  add##SS##CloudType##thermoCloudType##ConstructorToTable_;
176 
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #ifdef NoRepository
181 # include "HeatTransferModel.C"
182 #endif
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::HeatTransferModel::HeatTransferModel
HeatTransferModel(CloudType &owner)
Construct null from owner.
Definition: HeatTransferModel.C:31
Foam::HeatTransferModel::~HeatTransferModel
virtual ~HeatTransferModel()
Destructor.
Definition: HeatTransferModel.C:65
Foam::Re
scalarField Re(const UList< complex > &cf)
Definition: complexFields.C:97
Foam::constant::electromagnetic::kappa
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Foam::HeatTransferModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, HeatTransferModel, dictionary,(const dictionary &dict, CloudType &owner),(dict, owner))
Declare runtime constructor selection table.
Foam::HeatTransferModel
Templated heat transfer model class.
Definition: ThermoCloud.H:53
Foam::HeatTransferModel::Nu
virtual scalar Nu(const scalar Re, const scalar Pr) const =0
Nusselt number.
HeatTransferModel.C
CloudSubModelBase.H
Pr
dimensionedScalar Pr("Pr", dimless, laminarTransport)
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:68
Foam::HeatTransferModel::TypeName
TypeName("heatTransferModel")
Runtime type information.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
IOdictionary.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::HeatTransferModel::clone
virtual autoPtr< HeatTransferModel< CloudType > > clone() const =0
Construct and return a clone.
Foam::HeatTransferModel::BirdCorrection_
const Switch BirdCorrection_
Apply Bird's correction to the htc.
Definition: HeatTransferModel.H:60
Foam::type
fileName::Type type(const fileName &)
Return the file type: DIRECTORY or FILE.
Definition: POSIX.C:588
Foam::HeatTransferModel::htc
virtual scalar htc(const scalar dp, const scalar Re, const scalar Pr, const scalar kappa, const scalar NCpW) const
Return heat transfer coefficient.
Definition: HeatTransferModel.C:80
Foam::HeatTransferModel::New
static autoPtr< HeatTransferModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: HeatTransferModelNew.C:33
Foam::HeatTransferModel::BirdCorrection
const Switch & BirdCorrection() const
Return the Bird htc correction flag.
Definition: HeatTransferModel.C:72
autoPtr.H