heatTransferCoeffModel.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-2023 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 Namespace
27  Foam::heatTransferCoeffModels
28 
29 Description
30  A namespace for various heat transfer coefficient model implementations.
31 
32 Class
33  Foam::heatTransferCoeffModel
34 
35 Description
36  A base class for heat transfer coefficient models.
37 
38 SourceFiles
39  heatTransferCoeffModel.C
40  heatTransferCoeffModelNew.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef Foam_heatTransferCoeffModel_H
45 #define Foam_heatTransferCoeffModel_H
46 
47 #include "volFields.H"
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 // Forward Declarations
55 class fvMesh;
56 
57 /*---------------------------------------------------------------------------*\
58  Class heatTransferCoeffModel Declaration
59 \*---------------------------------------------------------------------------*/
60 
62 {
63 protected:
64 
65  // Protected Data
66 
67  //- Const reference to the mesh
68  const fvMesh& mesh_;
69 
70  //- List of (wall) patches to process (selected by name)
72 
73  //- Name of temperature field
74  const word TName_;
75 
76  //- Name of radiative heat flux field
77  word qrName_;
78 
79 
80  // Protected Member Functions
81 
82  //- Set the heat transfer coefficient
83  virtual void htc
84  (
87  ) = 0;
88 
89 
90 public:
91 
92  //- Runtime type information
93  TypeName("heatTransferCoeffModel");
94 
95 
96  // Declare runtime constructor selection table
97 
99  (
100  autoPtr,
102  dictionary,
103  (
104  const dictionary& dict,
105  const fvMesh& mesh,
106  const word& TName
107  ),
108  (dict, mesh, TName)
109  );
110 
111 
112  // Selectors
113 
114  //- Return a reference to the selected heat transfer coefficient model
116  (
117  const dictionary& dict,
118  const fvMesh& mesh,
119  const word& TName
120  );
121 
122 
123  // Constructors
124 
125  //- Construct from components
127  (
128  const dictionary& dict,
129  const fvMesh& mesh,
130  const word& TName
131  );
132 
133  //- No copy construct
135 
136  //- No copy assignment
137  void operator=(const heatTransferCoeffModel&) = delete;
138 
139 
140  //- Destructor
141  virtual ~heatTransferCoeffModel() = default;
142 
143 
144  // Member Functions
145 
146  // Access
147 
148  //- Return const reference to the mesh
149  const fvMesh& mesh() const noexcept
150  {
151  return mesh_;
152  }
153 
154  //- Return const reference to wall patches to process
155  const labelList& patchIDs() const noexcept
156  {
157  return patchIDs_;
158  }
159 
160  //- Return const reference to name of temperature field
161  const word& TName() const noexcept
162  {
163  return TName_;
164  }
165 
166  //- Return const reference to name of radiative heat-flux field
167  const word& qrName() const noexcept
168  {
169  return qrName_;
170  }
171 
172 
173  // Evaluation
174 
175  //- Return boundary fields of heat-flux field
178  //- Calculate the heat transfer coefficient field and return true
179  //- if successful
180  virtual bool calc
181  (
182  volScalarField& result,
184  );
186 
187  // I-O
188 
189  //- Read from dictionary
190  virtual bool read(const dictionary& dict);
191 };
192 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************************************************************* //
const word & qrName() const noexcept
Return const reference to name of radiative heat-flux field.
dictionary dict
static autoPtr< heatTransferCoeffModel > New(const dictionary &dict, const fvMesh &mesh, const word &TName)
Return a reference to the selected heat transfer coefficient model.
word qrName_
Name of radiative heat flux field.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual ~heatTransferCoeffModel()=default
Destructor.
TypeName("heatTransferCoeffModel")
Runtime type information.
const labelList & patchIDs() const noexcept
Return const reference to wall patches to process.
virtual bool read(const dictionary &dict)
Read from dictionary.
const word & TName() const noexcept
Return const reference to name of temperature field.
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:51
A base class for heat transfer coefficient models.
declareRunTimeSelectionTable(autoPtr, heatTransferCoeffModel, dictionary,(const dictionary &dict, const fvMesh &mesh, const word &TName),(dict, mesh, TName))
virtual bool calc(volScalarField &result, const FieldField< Field, scalar > &q)
Calculate the heat transfer coefficient field and return true if successful.
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual void htc(volScalarField &htc, const FieldField< Field, scalar > &q)=0
Set the heat transfer coefficient.
void operator=(const heatTransferCoeffModel &)=delete
No copy assignment.
const fvMesh & mesh_
Const reference to the mesh.
const fvMesh & mesh() const noexcept
Return const reference to the mesh.
const direction noexcept
Definition: Scalar.H:258
const word TName_
Name of temperature field.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
heatTransferCoeffModel(const dictionary &dict, const fvMesh &mesh, const word &TName)
Construct from components.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
tmp< FieldField< Field, scalar > > q() const
Return boundary fields of heat-flux field.
A class for managing temporary objects.
Definition: HashPtrTable.H:50
labelList patchIDs_
List of (wall) patches to process (selected by name)
Namespace for OpenFOAM.