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 SourceFiles
39  heatTransferCoeffModel.C
40  heatTransferCoeffModelNew.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef heatTransferCoeffModel_H
45 #define heatTransferCoeffModel_H
46 
47 #include "dictionary.H"
48 #include "HashSet.H"
49 #include "volFields.H"
50 #include "runTimeSelectionTables.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 // Forward Declarations
58 class fvMesh;
59 
60 /*---------------------------------------------------------------------------*\
61  Class heatTransferCoeffModel Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 {
66 protected:
67 
68  // Public Data
69 
70  //- Mesh reference
71  const fvMesh& mesh_;
72 
73  //- Optional list of (wall) patches to process
75 
76  //- Temperature name
77  const word TName_;
78 
79  //- Name of radiative heat flux (default = qr)
80  word qrName_;
81 
82 
83 protected:
84 
85  // Protected Member Functions
86 
87  //- Set the heat transfer coefficient
88  virtual void htc
89  (
92  ) = 0;
93 
94  //- No copy construct
96 
97  //- No copy assignment
98  void operator=(const heatTransferCoeffModel&) = delete;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("heatTransferCoeffModel");
105 
106 
107  // Declare runtime constructor selection table
108 
110  (
111  autoPtr,
113  dictionary,
114  (
115  const dictionary& dict,
116  const fvMesh& mesh,
117  const word& TName
118  ),
119  (dict, mesh, TName)
120  );
121 
122 
123  // Selectors
124 
125  //- Return a reference to the selected heat transfer coefficient model
127  (
128  const dictionary& dict,
129  const fvMesh& mesh,
130  const word& TName
131  );
132 
133 
134  // Constructors
135 
136  //- Construct from components
138  (
139  const dictionary& dict,
140  const fvMesh& mesh,
141  const word& TName
142  );
143 
144 
145  //- Destructor
146  virtual ~heatTransferCoeffModel() = default;
147 
148 
149  // Member Functions
150 
151  //- The mesh reference
152  const fvMesh& mesh() const
153  {
154  return mesh_;
155  }
156 
157  //- Wall patches to process
158  const labelHashSet& patchSet() const
159  {
160  return patchSet_;
161  }
162 
163  //- Temperature name
164  const word& TName() const
165  {
166  return TName_;
167  }
168 
169  //- Name of radiative heat flux
170  const word& qrName() const
171  {
172  return qrName_;
173  }
174 
175 
176  //- Read from dictionary
177  virtual bool read(const dictionary& dict);
178 
179  virtual bool calc
180  (
181  volScalarField& result,
183  );
184 
185  //- Return q boundary fields
187 };
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace Foam
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
volFields.H
Foam::heatTransferCoeffModel::mesh
const fvMesh & mesh() const
The mesh reference.
Definition: heatTransferCoeffModel.H:151
Foam::heatTransferCoeffModel
An abstract base class for heat transfer coeffcient models.
Definition: heatTransferCoeffModel.H:63
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
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:59
Foam::heatTransferCoeffModel::mesh_
const fvMesh & mesh_
Mesh reference.
Definition: heatTransferCoeffModel.H:70
Foam::HashSet< label, Hash< label > >
Foam::heatTransferCoeffModel::TypeName
TypeName("heatTransferCoeffModel")
Runtime type information.
Foam::heatTransferCoeffModel::patchSet_
labelHashSet patchSet_
Optional list of (wall) patches to process.
Definition: heatTransferCoeffModel.H:73
Foam::heatTransferCoeffModel::calc
virtual bool calc(volScalarField &result, const FieldField< Field, scalar > &q)
Definition: heatTransferCoeffModel.C:147
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:163
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:121
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:84
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:136
Foam::heatTransferCoeffModel::heatTransferCoeffModel
heatTransferCoeffModel(const heatTransferCoeffModel &)=delete
No copy construct.
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:76
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::heatTransferCoeffModel::patchSet
const labelHashSet & patchSet() const
Wall patches to process.
Definition: heatTransferCoeffModel.H:157
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:169
Foam::heatTransferCoeffModel::qrName_
word qrName_
Name of radiative heat flux (default = qr)
Definition: heatTransferCoeffModel.H:79