heatTransferCoeff.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) 2017-2020 OpenCFD Ltd.
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::functionObjects::heatTransferCoeff
28 
29 Group
30  grpFieldFunctionObjects
31 
32 Description
33  Computes the heat transfer coefficient as a \c volScalarField
34  for a set of patches.
35 
36  The field is stored on the mesh database so that it can be retrieved and
37  used for other applications.
38 
39  Operands:
40  \table
41  Operand | Type | Location
42  input | - | -
43  output file | - | -
44  output field | volScalarField | $FOAM_CASE/<time>/<outField>
45  \endtable
46 
47 Usage
48  Minimal example by using \c system/controlDict.functions:
49  \verbatim
50  heatTransferCoeff1
51  {
52  // Mandatory entries (unmodifiable)
53  type heatTransferCoeff;
54  libs (fieldFunctionObjects);
55 
56  field T;
57  patches ("walls.*");
58 
59  htcModel ReynoldsAnalogy;
60  UInf (20 0 0);
61  Cp CpInf;
62  CpInf 1000;
63  rho rhoInf;
64  rhoInf 1.2;
65  }
66  \endverbatim
67 
68  Example usage for mode \c ReynoldsAnalogy for incompressible case:
69  \verbatim
70  heatTransferCoeff1
71  {
72  // Mandatory entries (unmodifiable)
73  type heatTransferCoeff;
74  libs (fieldFunctionObjects);
75 
76  field T;
77  patches ("walls.*");
78 
79  htcModel ReynoldsAnalogy;
80  UInf (20 0 0);
81  Cp CpInf;
82  CpInf 1000;
83  rho rhoInf;
84  rhoInf 1.2;
85  }
86  \endverbatim
87 
88  Example usage for mode \c ReynoldsAnalogy for compressible case:
89  \verbatim
90  htc
91  {
92  type heatTransferCoeff;
93  libs (fieldFunctionObjects);
94 
95  field T;
96  patches ("walls.*");
97 
98  htcModel ReynoldsAnalogy;
99  UInf (20 0 0);
100  }
101  \endverbatim
102 
103  Example usage for mode \c localReferenceTemperature for compressible case:
104  \verbatim
105  htc
106  {
107  type heatTransferCoeff;
108  libs (fieldFunctionObjects);
109 
110  field T;
111  patches ("walls.*");
112  htcModel localReferenceTemperature;
113  }
114  \endverbatim
115 
116  Example usage for mode \c fixedReferenceTemperature for compressible case:
117  \verbatim
118  htc
119  {
120  type heatTransferCoeff;
121  libs (fieldFunctionObjects);
122 
123  field T;
124  patches ("walls.*");
125  htcModel fixedReferenceTemperature;
126  TRef 300;
127  }
128  \endverbatim
129 
130  Options for the \c htcModel entry:
131  \verbatim
132  ReynoldsAnalogy | Reynold's analogy
133  localReferenceTemperature | Local reference temperature
134  fixedReferenceTemperature | Specified reference temperature
135  \endverbatim
136 
137  The inherited entries are elaborated in:
138  - \link functionObject.H \endlink
139  - \link fieldExpression.H \endlink
140 
141  Usage by the \c postProcess utility is not available.
142 
143 See also
144  - Foam::functionObject
145  - Foam::functionObjects::fieldExpression
146  - Foam::heatTransferCoeffModels::fixedReferenceTemperature
147  - Foam::heatTransferCoeffModels::localReferenceTemperature
148  - ExtendedCodeGuide::functionObjects::field::heatTransferCoeff
149 
150 SourceFiles
151  heatTransferCoeff.C
152 
153 \*---------------------------------------------------------------------------*/
154 
155 #ifndef functionObjects_heatTransferCoeff_H
156 #define functionObjects_heatTransferCoeff_H
157 
158 #include "fieldExpression.H"
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 namespace Foam
163 {
164 
165 // Forward Declarations
166 class heatTransferCoeffModel;
167 
168 namespace functionObjects
169 {
170 
171 /*---------------------------------------------------------------------------*\
172  Class heatTransferCoeff Declaration
173 \*---------------------------------------------------------------------------*/
174 
175 class heatTransferCoeff
176 :
177  public fieldExpression
178 {
179  // Private Data
180 
181  //- Heat transfer coefficient model
182  autoPtr<heatTransferCoeffModel> htcModelPtr_;
183 
184 
185 protected:
186 
187  //- Calculate the heat transfer coefficient field and return true
188  //- if successful
189  virtual bool calc();
190 
191 
192 public:
193 
194  //- Runtime type information
195  TypeName("heatTransferCoeff");
196 
197 
198  // Constructors
199 
200  //- Construct for given objectRegistry and dictionary.
201  // Allow the possibility to load fields from files
203  (
204  const word& name,
205  const Time& runTime,
206  const dictionary& dict
207  );
208 
209  //- No copy construct
210  heatTransferCoeff(const heatTransferCoeff&) = delete;
211 
212  //- No copy assignment
213  void operator=(const heatTransferCoeff&) = delete;
214 
215 
216  //- Destructor
217  virtual ~heatTransferCoeff() = default;
218 
219 
220  // Member Functions
221 
222  //- Read the heatTransferCoeff data
223  virtual bool read(const dictionary& dict);
224 };
225 
226 
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
228 
229 } // End namespace functionObjects
230 } // End namespace Foam
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 #endif
235 
236 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::functionObjects::heatTransferCoeff::operator=
void operator=(const heatTransferCoeff &)=delete
No copy assignment.
Foam::functionObjects::heatTransferCoeff::~heatTransferCoeff
virtual ~heatTransferCoeff()=default
Destructor.
Foam::functionObjects::heatTransferCoeff::read
virtual bool read(const dictionary &dict)
Read the heatTransferCoeff data.
Definition: heatTransferCoeff.C:93
Foam::functionObjects::heatTransferCoeff::heatTransferCoeff
heatTransferCoeff(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
Definition: heatTransferCoeff.C:59
Foam::functionObjects::heatTransferCoeff::calc
virtual bool calc()
Definition: heatTransferCoeff.C:46
Foam::functionObjects::heatTransferCoeff
Computes the heat transfer coefficient as a volScalarField for a set of patches.
Definition: heatTransferCoeff.H:190
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::functionObjects::fieldExpression
Intermediate class for handling field expression function objects (e.g. blendingFactor etc....
Definition: fieldExpression.H:103
Foam::functionObject::name
const word & name() const
Return the name of this functionObject.
Definition: functionObject.C:131
fieldExpression.H
Foam::functionObjects::heatTransferCoeff::TypeName
TypeName("heatTransferCoeff")
Runtime type information.