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-2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Namespace
27 Foam::heatTransferCoeffModels
28
29Description
30 A namespace for various heat transfer coefficient model implementations.
31
32Class
33 Foam::heatTransferCoeffModel
34
35Description
36 An abstract base class for heat transfer coeffcient models.
37
38Usage
39 Minimal example by using \c system/controlDict.functions:
40 \verbatim
41 heatTransferCoeff1
42 {
43 // Mandatory and other optional entries
44 ...
45
46 // Mandatory (inherited) entries (runtime modifiable)
47 patches (<patch1> <patch2> ... <patchN>);
48
49 // Optional (inherited) entries (runtime modifiable)
50 qr <qrName>;
51 }
52 \endverbatim
53
54 where the entries mean:
55 \table
56 Property | Description | Type | Reqd | Dflt
57 patches | Names of operand patches | wordRes | yes | -
58 qr | Name of radiative heat flux | word | no | qr
59 \endtable
60
61SourceFiles
62 - heatTransferCoeffModel.C
63 - heatTransferCoeffModelNew.C
64
65\*---------------------------------------------------------------------------*/
66
67#ifndef heatTransferCoeffModel_H
68#define heatTransferCoeffModel_H
69
70#include "dictionary.H"
71#include "HashSet.H"
72#include "volFields.H"
74
75// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76
77namespace Foam
78{
79
80// Forward Declarations
81class fvMesh;
82
83/*---------------------------------------------------------------------------*\
84 Class heatTransferCoeffModel Declaration
85\*---------------------------------------------------------------------------*/
86
87class heatTransferCoeffModel
88{
89protected:
90
91 // Protected Data
92
93 //- Mesh reference
94 const fvMesh& mesh_;
95
96 //- Optional list of (wall) patches to process
98
99 //- Temperature name
100 const word TName_;
101
102 //- Name of radiative heat flux
103 word qrName_;
105
106 // Protected Member Functions
107
108 //- Set the heat transfer coefficient
109 virtual void htc
110 (
113 ) = 0;
115
116public:
118 //- Runtime type information
119 TypeName("heatTransferCoeffModel");
121
122 // Declare runtime constructor selection table
123
125 (
129 (
130 const dictionary& dict,
131 const fvMesh& mesh,
132 const word& TName
133 ),
134 (dict, mesh, TName)
135 );
137
138 // Selectors
139
140 //- Return a reference to the selected heat transfer coefficient model
142 (
143 const dictionary& dict,
144 const fvMesh& mesh,
145 const word& TName
146 );
147
148
149 // Constructors
150
151 //- Construct from components
153 (
154 const dictionary& dict,
155 const fvMesh& mesh,
156 const word& TName
157 );
158
159 //- No copy construct
161
162 //- No copy assignment
163 void operator=(const heatTransferCoeffModel&) = delete;
164
165
166 //- Destructor
167 virtual ~heatTransferCoeffModel() = default;
168
169
170 // Member Functions
171
172 //- The mesh reference
173 const fvMesh& mesh() const
174 {
175 return mesh_;
176 }
178 //- Wall patches to process
179 const labelHashSet& patchSet() const
181 return patchSet_;
182 }
183
184 //- Temperature name
185 const word& TName() const
186 {
187 return TName_;
188 }
189
190 //- Name of radiative heat flux
191 const word& qrName() const
192 {
193 return qrName_;
194 }
195
196 //- Read from dictionary
197 virtual bool read(const dictionary& dict);
198
199 virtual bool calc
200 (
201 volScalarField& result,
203 );
204
205 //- Return q boundary fields
207};
209
210// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211
212} // End namespace Foam
213
214// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215
216#endif
217
218// ************************************************************************* //
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:80
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
An abstract base class for heat transfer coeffcient models.
const word TName_
Temperature name.
static autoPtr< heatTransferCoeffModel > New(const dictionary &dict, const fvMesh &mesh, const word &TName)
Return a reference to the selected heat transfer coefficient model.
virtual ~heatTransferCoeffModel()=default
Destructor.
declareRunTimeSelectionTable(autoPtr, heatTransferCoeffModel, dictionary,(const dictionary &dict, const fvMesh &mesh, const word &TName),(dict, mesh, TName))
const fvMesh & mesh_
Mesh reference.
word qrName_
Name of radiative heat flux.
virtual bool read(const dictionary &dict)
Read from dictionary.
void operator=(const heatTransferCoeffModel &)=delete
No copy assignment.
heatTransferCoeffModel(const heatTransferCoeffModel &)=delete
No copy construct.
const word & qrName() const
Name of radiative heat flux.
tmp< FieldField< Field, scalar > > q() const
Return q boundary fields.
TypeName("heatTransferCoeffModel")
Runtime type information.
labelHashSet patchSet_
Optional list of (wall) patches to process.
const fvMesh & mesh() const
The mesh reference.
const labelHashSet & patchSet() const
Wall patches to process.
const word & TName() const
Temperature name.
virtual bool calc(volScalarField &result, const FieldField< Field, scalar > &q)
virtual void htc(volScalarField &htc, const FieldField< Field, scalar > &q)=0
Set the heat transfer coefficient.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition: HashSet.H:85
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73