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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::HeatTransferModel
28 
29 Group
30  grpLagrangianIntermediateHeatTransferSubModels
31 
32 Description
33  Templated heat transfer model class
34 
35 SourceFiles
36  HeatTransferModel.C
37  HeatTransferModelNew.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef HeatTransferModel_H
42 #define HeatTransferModel_H
43 
44 #include "IOdictionary.H"
45 #include "autoPtr.H"
46 #include "runTimeSelectionTables.H"
47 #include "CloudSubModelBase.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class HeatTransferModel Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 template<class CloudType>
59 class HeatTransferModel
60 :
61  public CloudSubModelBase<CloudType>
62 {
63  // Private data
64 
65  //- Apply Bird's correction to the htc
66  const Switch BirdCorrection_;
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("heatTransferModel");
73 
74  //- Declare runtime constructor selection table
76  (
77  autoPtr,
79  dictionary,
80  (
81  const dictionary& dict,
82  CloudType& owner
83  ),
84  (dict, owner)
85  );
86 
87 
88  // Constructors
89 
90  //- Construct null from owner
92 
93  //- Construct from dictionary
95  (
96  const dictionary& dict,
97  CloudType& owner,
98  const word& type
99  );
100 
101  //- Construct copy
102  HeatTransferModel(const HeatTransferModel<CloudType>& htm);
103 
104  //- Construct and return a clone
105  virtual autoPtr<HeatTransferModel<CloudType>> clone() const = 0;
106 
107 
108  //- Destructor
109  virtual ~HeatTransferModel();
110 
111 
112  //- Selector
113  static autoPtr<HeatTransferModel<CloudType>> New
114  (
115  const dictionary& dict,
116  CloudType& owner
117  );
118 
119 
120  // Member Functions
121 
122  // Access
123 
124  //- Return the Bird htc correction flag
125  const Switch& BirdCorrection() const;
126 
127 
128  // Evaluation
129 
130  //- Nusselt number
131  virtual scalar Nu
132  (
133  const scalar Re,
134  const scalar Pr
135  ) const = 0;
136 
137  //- Return heat transfer coefficient
138  virtual scalar htc
139  (
140  const scalar dp,
141  const scalar Re,
142  const scalar Pr,
143  const scalar kappa,
144  const scalar NCpW
145  ) const;
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #define makeHeatTransferModel(CloudType) \
156  \
157  typedef Foam::CloudType::thermoCloudType thermoCloudType; \
158  defineNamedTemplateTypeNameAndDebug \
159  ( \
160  Foam::HeatTransferModel<thermoCloudType>, \
161  0 \
162  ); \
163  namespace Foam \
164  { \
165  defineTemplateRunTimeSelectionTable \
166  ( \
167  HeatTransferModel<thermoCloudType>, \
168  dictionary \
169  ); \
170  }
171 
172 
173 #define makeHeatTransferModelType(SS, CloudType) \
174  \
175  typedef Foam::CloudType::thermoCloudType thermoCloudType; \
176  defineNamedTemplateTypeNameAndDebug(Foam::SS<thermoCloudType>, 0); \
177  \
178  Foam::HeatTransferModel<thermoCloudType>:: \
179  adddictionaryConstructorToTable<Foam::SS<thermoCloudType>> \
180  add##SS##CloudType##thermoCloudType##ConstructorToTable_;
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 #ifdef NoRepository
186  #include "HeatTransferModel.C"
187 #endif
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #endif
192 
193 // ************************************************************************* //
Foam::HeatTransferModel::HeatTransferModel
HeatTransferModel(CloudType &owner)
Construct null from owner.
Definition: HeatTransferModel.C:33
Foam::HeatTransferModel::~HeatTransferModel
virtual ~HeatTransferModel()
Destructor.
Definition: HeatTransferModel.C:67
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::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::CloudType
DSMCCloud< dsmcParcel > CloudType
Definition: makeDSMCParcelBinaryCollisionModels.C:38
Foam::HeatTransferModel::TypeName
TypeName("heatTransferModel")
Runtime type information.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
IOdictionary.H
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
Foam::Re
scalarField Re(const UList< complex > &cf)
Extract real component.
Definition: complexField.C:159
Foam::HeatTransferModel::clone
virtual autoPtr< HeatTransferModel< CloudType > > clone() const =0
Construct and return a clone.
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:82
Foam::HeatTransferModel::New
static autoPtr< HeatTransferModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: HeatTransferModelNew.C:36
Foam::HeatTransferModel::BirdCorrection
const Switch & BirdCorrection() const
Return the Bird htc correction flag.
Definition: HeatTransferModel.C:74
autoPtr.H