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  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::HeatTransferModel
29 
30 Group
31  grpLagrangianIntermediateHeatTransferSubModels
32 
33 Description
34  Templated heat transfer model class
35 
36 SourceFiles
37  HeatTransferModel.C
38  HeatTransferModelNew.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef HeatTransferModel_H
43 #define HeatTransferModel_H
44 
45 #include "IOdictionary.H"
46 #include "autoPtr.H"
47 #include "runTimeSelectionTables.H"
48 #include "CloudSubModelBase.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class HeatTransferModel Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class CloudType>
60 class HeatTransferModel
61 :
62  public CloudSubModelBase<CloudType>
63 {
64  // Private Data
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
93 
94  //- Construct from dictionary
96  (
97  const dictionary& dict,
98  CloudType& owner,
99  const word& type
100  );
101 
102  //- Construct copy
103  HeatTransferModel(const HeatTransferModel<CloudType>& htm);
104 
105  //- Construct and return a clone
106  virtual autoPtr<HeatTransferModel<CloudType>> clone() const = 0;
107 
108 
109  //- Destructor
110  virtual ~HeatTransferModel();
111 
112 
113  //- Selector
114  static autoPtr<HeatTransferModel<CloudType>> New
115  (
116  const dictionary& dict,
117  CloudType& owner
118  );
119 
120 
121  // Member Functions
122 
123  //- The Bird HTC correction flag
124  bool BirdCorrection() const
125  {
126  return BirdCorrection_;
127  }
128 
129 
130  // Evaluation
131 
132  //- Nusselt number
133  virtual scalar Nu
134  (
135  const scalar Re,
136  const scalar Pr
137  ) const = 0;
138 
139  //- Return heat transfer coefficient
140  virtual scalar htc
141  (
142  const scalar dp,
143  const scalar Re,
144  const scalar Pr,
145  const scalar kappa,
146  const scalar NCpW
147  ) const;
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #define makeHeatTransferModel(CloudType) \
158  \
159  typedef Foam::CloudType::thermoCloudType thermoCloudType; \
160  defineNamedTemplateTypeNameAndDebug \
161  ( \
162  Foam::HeatTransferModel<thermoCloudType>, \
163  0 \
164  ); \
165  namespace Foam \
166  { \
167  defineTemplateRunTimeSelectionTable \
168  ( \
169  HeatTransferModel<thermoCloudType>, \
170  dictionary \
171  ); \
172  }
173 
174 
175 #define makeHeatTransferModelType(SS, CloudType) \
176  \
177  typedef Foam::CloudType::thermoCloudType thermoCloudType; \
178  defineNamedTemplateTypeNameAndDebug(Foam::SS<thermoCloudType>, 0); \
179  \
180  Foam::HeatTransferModel<thermoCloudType>:: \
181  adddictionaryConstructorToTable<Foam::SS<thermoCloudType>> \
182  add##SS##CloudType##thermoCloudType##ConstructorToTable_;
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #ifdef NoRepository
188  #include "HeatTransferModel.C"
189 #endif
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
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::HeatTransferModel::BirdCorrection
bool BirdCorrection() const
The Bird HTC correction flag.
Definition: HeatTransferModel.H:123
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:75
Foam::HeatTransferModel::New
static autoPtr< HeatTransferModel< CloudType > > New(const dictionary &dict, CloudType &owner)
Selector.
Definition: HeatTransferModelNew.C:36
autoPtr.H