wallLayersHeatTransferCoefficient_DimensionedFieldFunction.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 #include "DimensionedFields.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 namespace DimensionedFieldFunctions
35 {
37  (
39  0
40  );
41 
45  (
49  );
50 }
51 }
52 
53 
54 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
55 
58 (
59  const dictionary& dict,
61 )
62 :
64  thicknessLayers_(dict.lookup<scalarList>("thicknessLayers", dimLength)),
65  kappaLayers_(dict.lookup<scalarList>("kappaLayers", dimThermalConductivity))
66 {}
67 
68 
71 (
74 )
75 :
77  thicknessLayers_(dff.thicknessLayers_),
78  kappaLayers_(dff.kappaLayers_)
79 {}
80 
81 
83 <
85  <
87  >
88 >
90 (
92 ) const
93 {
95  (
97  (
98  *this,
99  field
100  )
101  );
102 }
103 
104 
105 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
106 
109 {
110  // Calculate effective heat transfer coefficient by harmonic averaging
111  scalar h = 0;
112  forAll(thicknessLayers_, i)
113  {
114  h += thicknessLayers_[i]/kappaLayers_[i];
115  }
116  h = 1/h;
117 
118  this->field_.primitiveFieldRef() = h;
119 }
120 
121 
124 (
125  Ostream& os
126 ) const
127 {
128  writeEntry(os, "thicknessLayers", thicknessLayers_);
129  writeEntry(os, "kappaLayers", kappaLayers_);
130 }
131 
132 
133 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:449
Macros for easy insertion into run-time selection tables.
Base class for run-time selectable internal and patch field initialisation evaluation and update with...
virtual autoPtr< DimensionedFieldFunction< DimensionedField< scalar, fvPatch > > > clone() const
Construct and return a clone for the specified field.
Runtime selectable DimensionedFieldFunction providing the heat transfer coefficient for a number of l...
wallLayersHeatTransferCoefficient(const dictionary &dict, DimensionedField< scalar, fvPatch > &field)
Construct with dictionary to initialise given field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:58
defineTypeNameAndDebug(externalWallLayersHeatTransferCoefficient, 0)
DimensionedFieldFunction< DimensionedField< scalar, fvPatch > > DimensionedFieldFunctionScalarFvPatch
addToRunTimeSelectionTable(DimensionedFieldFunctionScalarFvPatch, externalWallLayersHeatTransferCoefficient, dictionary)
const dimensionedScalar h
Planck constant.
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
Definition: units.C:346
Namespace for OpenFOAM.
const dimensionSet & dimThermalConductivity
Definition: dimensions.C:175
const dimensionSet & dimLength
Definition: dimensions.C:141
void writeEntry(Ostream &os, const word &key, const DimensionedFieldFunction< DimensionedFieldType > &f)
dictionary dict