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 -------------------------------------------------------------------------------
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  An abstract base class for heat transfer coeffcient models.
37 
38 Usage
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 
61 SourceFiles
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"
73 #include "runTimeSelectionTables.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 // Forward Declarations
81 class fvMesh;
82 
83 /*---------------------------------------------------------------------------*\
84  Class heatTransferCoeffModel Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class heatTransferCoeffModel
88 {
89 protected:
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_;
104 
105 
106  // Protected Member Functions
107 
108  //- Set the heat transfer coefficient
109  virtual void htc
110  (
113  ) = 0;
114 
115 
116 public:
117 
118  //- Runtime type information
119  TypeName("heatTransferCoeffModel");
120 
121 
122  // Declare runtime constructor selection table
123 
125  (
126  autoPtr,
128  dictionary,
129  (
130  const dictionary& dict,
131  const fvMesh& mesh,
132  const word& TName
133  ),
134  (dict, mesh, TName)
135  );
136 
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  }
177 
178  //- Wall patches to process
179  const labelHashSet& patchSet() const
180  {
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 };
208 
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 } // End namespace Foam
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 #endif
217 
218 // ************************************************************************* //
volFields.H
Foam::heatTransferCoeffModel::mesh
const fvMesh & mesh() const
The mesh reference.
Definition: heatTransferCoeffModel.H:190
Foam::heatTransferCoeffModel
An abstract base class for heat transfer coeffcient models.
Definition: heatTransferCoeffModel.H:104
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::FieldField
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:53
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::heatTransferCoeffModel::mesh_
const fvMesh & mesh_
Mesh reference.
Definition: heatTransferCoeffModel.H:111
Foam::HashSet< label, Hash< label > >
Foam::heatTransferCoeffModel::TypeName
TypeName("heatTransferCoeffModel")
Runtime type information.
Foam::heatTransferCoeffModel::heatTransferCoeffModel
heatTransferCoeffModel(const dictionary &dict, const fvMesh &mesh, const word &TName)
Construct from components.
Definition: heatTransferCoeffModel.C:124
Foam::heatTransferCoeffModel::patchSet_
labelHashSet patchSet_
Optional list of (wall) patches to process.
Definition: heatTransferCoeffModel.H:114
Foam::heatTransferCoeffModel::calc
virtual bool calc(volScalarField &result, const FieldField< Field, scalar > &q)
Definition: heatTransferCoeffModel.C:150
Foam::heatTransferCoeffModel::New
static autoPtr< heatTransferCoeffModel > New(const dictionary &dict, const fvMesh &mesh, const word &TName)
Return a reference to the selected heat transfer coefficient model.
Definition: heatTransferCoeffModelNew.C:35
Foam::heatTransferCoeffModel::TName
const word & TName() const
Temperature name.
Definition: heatTransferCoeffModel.H:202
HashSet.H
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:123
Foam::heatTransferCoeffModel::operator=
void operator=(const heatTransferCoeffModel &)=delete
No copy assignment.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::heatTransferCoeffModel::~heatTransferCoeffModel
virtual ~heatTransferCoeffModel()=default
Destructor.
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::heatTransferCoeffModel::read
virtual bool read(const dictionary &dict)
Read from dictionary.
Definition: heatTransferCoeffModel.C:139
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
dictionary.H
Foam::heatTransferCoeffModel::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, heatTransferCoeffModel, dictionary,(const dictionary &dict, const fvMesh &mesh, const word &TName),(dict, mesh, TName))
Foam::heatTransferCoeffModel::TName_
const word TName_
Temperature name.
Definition: heatTransferCoeffModel.H:117
Foam::labelHashSet
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
Definition: HashSet.H:85
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::heatTransferCoeffModel::patchSet
const labelHashSet & patchSet() const
Wall patches to process.
Definition: heatTransferCoeffModel.H:196
Foam::heatTransferCoeffModel::htc
virtual void htc(volScalarField &htc, const FieldField< Field, scalar > &q)=0
Set the heat transfer coefficient.
Foam::heatTransferCoeffModel::q
tmp< FieldField< Field, scalar > > q() const
Return q boundary fields.
Definition: heatTransferCoeffModel.C:46
Foam::heatTransferCoeffModel::qrName
const word & qrName() const
Name of radiative heat flux.
Definition: heatTransferCoeffModel.H:208
Foam::heatTransferCoeffModel::qrName_
word qrName_
Name of radiative heat flux.
Definition: heatTransferCoeffModel.H:120