faceZoneReferenceTemperature.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) 2022 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::heatTransferCoeffModels::faceZoneReferenceTemperature
28 
29 Description
30  Heat transfer coefficient calculation that employs the area-average
31  temperature of a specified face zone as the reference temperature.
32 
33  The heat transfer coefficient is calculated by:
34 
35  \f[
36  h = \frac{q}{T_{ref} - T_p}
37  \f]
38 
39  where
40  \vartable
41  h | Heat transfer coefficient [W/m^2/K]
42  q | Heat flux [W/m^2]
43  T_{ref} | Area average of reference face zone temperature [K]
44  T_p | Temperature field of current patch [K]
45  \endvartable
46 
47 Usage
48  Minimal example by using \c system/controlDict.functions:
49  \verbatim
50  heatTransferCoeff1
51  {
52  // Inherited entries
53  ...
54 
55  // Mandatory entries
56  htcModel faceZoneReferenceTemperature;
57  referenceFaceZone <word>;
58 
59  // Optional entries
60  referenceRegion <word>;
61  }
62  \endverbatim
63 
64  where the entries mean:
65  \table
66  Property | Description | Type | Reqd | Deflt
67  htcModel | Model name: faceZoneReferenceTemperature | word | yes | -
68  referenceFaceZone | Name of reference face zone | word | yes | -
69  referenceRegion | Name of region that reference face zone resides <!--
70  --> | word | no | region0
71  \endtable
72 
73 SourceFiles
74  faceZoneReferenceTemperature.C
75 
76 \*---------------------------------------------------------------------------*/
77 
78 #ifndef heatTransferCoeffModels_faceZoneReferenceTemperature_H
79 #define heatTransferCoeffModels_faceZoneReferenceTemperature_H
80 
81 #include "heatTransferCoeffModel.H"
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 namespace heatTransferCoeffModels
88 {
89 
90 /*---------------------------------------------------------------------------*\
91  Class faceZoneReferenceTemperature Declaration
92 \*---------------------------------------------------------------------------*/
93 
94 class faceZoneReferenceTemperature
95 :
96  public heatTransferCoeffModel
97 {
98  // Private Data
99 
100  //- Patch index of reference face zone
101  label faceZonei_;
102 
103  //- Name of region that the reference face zone resides
104  word refRegionName_;
105 
106  //- Local list of face IDs
107  labelList faceId_;
108 
109  //- Local list of patch ID per face
110  labelList facePatchId_;
111 
112 
113  // Private Member Functions
114 
115  //- Set faces to evaluate based on a face zone
116  void setFaceZoneFaces(const dictionary& dict);
117 
118  //- Return area average of face-zone temperature field
119  scalar faceZoneAverageTemperature();
120 
121  //- Set the heat transfer coefficient
122  virtual void htc
123  (
124  volScalarField& htc,
125  const FieldField<Field, scalar>& q
126  );
127 
128 
129 public:
130 
131  //- Runtime type information
132  TypeName("faceZoneReferenceTemperature");
133 
134 
135  // Constructors
136 
137  //- Construct from components
139  (
140  const dictionary& dict,
141  const fvMesh& mesh,
142  const word& TName
143  );
144 
145  //- No copy construct
147 
148  //- No copy assignment
149  void operator=(const faceZoneReferenceTemperature&) = delete;
150 
151 
152  //- Destructor
153  virtual ~faceZoneReferenceTemperature() = default;
154 
155 
156  // Member Functions
157 
158  //- Read from dictionary
159  virtual bool read(const dictionary& dict);
160 };
161 
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 } // End namespace heatTransferCoeffModels
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:120
faceZoneReferenceTemperature(const dictionary &dict, const fvMesh &mesh, const word &TName)
Construct from components.
const word & TName() const noexcept
Return const reference to name of temperature field.
void operator=(const faceZoneReferenceTemperature &)=delete
No copy assignment.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:81
A class for handling words, derived from Foam::string.
Definition: word.H:63
const fvMesh & mesh() const noexcept
Return const reference to the mesh.
TypeName("faceZoneReferenceTemperature")
Runtime type information.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:79
Heat transfer coefficient calculation that employs the area-average temperature of a specified face z...
tmp< FieldField< Field, scalar > > q() const
Return boundary fields of heat-flux field.
virtual bool read(const dictionary &dict)
Read from dictionary.
List< label > labelList
A List of labels.
Definition: List.H:62
Namespace for OpenFOAM.