Loading...
Searching...
No Matches
externalWallHeatFluxTemperatureFvPatchScalarField.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) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::externalWallHeatFluxTemperatureFvPatchScalarField
29
30Group
31 grpThermoBoundaryConditions grpWallBoundaryConditions
32
33Description
34 This boundary condition applies a heat flux condition to temperature
35 on an external wall in one of three modes:
36
37 - fixed power: supply Q
38 - fixed heat flux: supply q
39 - fixed heat transfer coefficient: supply h and Ta
40
41 where:
42 \vartable
43 Q | Power [W]
44 q | Heat flux [W/m^2]
45 h | Heat transfer coefficient [W/m^2/K]
46 Ta | Ambient temperature [K]
47 \endvartable
48
49 For heat transfer coefficient mode optional thin thermal layer resistances
50 can be specified through thicknessLayers and kappaLayers entries.
51
52 The thermal conductivity \c kappa can either be retrieved from various
53 possible sources, as detailed in the class temperatureCoupledBase.
54
55 The ambient temperature Ta is specified as a Foam::Function1 of time but
56 uniform in space.
57
58Usage
59 \table
60 Property | Description | Required | Default
61 mode | 'power', 'flux' or 'coefficient' | yes |
62 Q | Power [W] | for mode 'power' |
63 q | Heat flux [W/m^2] | for mode 'flux' |
64 h | Heat transfer coefficient [W/m^2/K] | for mode 'coefficient' |
65 Ta | Ambient temperature [K] | for mode 'coefficient' |
66 thicknessLayers | Layer thicknesses [m] | no |
67 kappaLayers | Layer thermal conductivities [W/m/K] | no |
68 relaxation | Relaxation for the wall temperature | no | 1
69 emissivity | Surface emissivity for radiative flux to ambient | no | 0
70 qr | Name of the radiative field | no | none
71 qrRelaxation | Relaxation factor for radiative field | no | 1
72 kappaMethod | Inherited from temperatureCoupledBase | inherited |
73 kappa | Inherited from temperatureCoupledBase | inherited |
74 \endtable
75
76 Example of the boundary condition specification:
77 \verbatim
78 <patchName>
79 {
80 type externalWallHeatFluxTemperature;
81
82 mode coefficient;
83
84 Ta constant 300.0;
85 h constant 10.0;
86 thicknessLayers (0.1 0.2 0.3 0.4);
87 kappaLayers (1 2 3 4);
88
89 kappaMethod fluidThermo;
90
91 value $internalField;
92 }
93 \endverbatim
94
95Note
96 Quantities that are considered "global" (eg, power, ambient temperature)
97 can be specified as Function1 types.
98 Quantities that may have local variations (eg, htc, heat-flux)
99 can be specified as PatchFunction1 types.
100
101See also
102 Foam::temperatureCoupledBase
103 Foam::mixedFvPatchScalarField
104
105SourceFiles
106 externalWallHeatFluxTemperatureFvPatchScalarField.C
107
108\*---------------------------------------------------------------------------*/
109
110#ifndef externalWallHeatFluxTemperatureFvPatchScalarField_H
111#define externalWallHeatFluxTemperatureFvPatchScalarField_H
112
113#include "mixedFvPatchFields.H"
115#include "PatchFunction1.H"
116
117// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118
119namespace Foam
120{
121
122/*---------------------------------------------------------------------------*\
123 Class externalWallHeatFluxTemperatureFvPatchScalarField Declaration
124\*---------------------------------------------------------------------------*/
125
127:
128 public mixedFvPatchScalarField,
130{
131public:
132
133 // Public Data
134
135 //- Operation mode enumeration
136 enum operationMode
137 {
138 fixedPower,
141 };
142
143 static const Enum<operationMode> operationModeNames;
144
145
146private:
147
148 // Private Data
149
150 //- Operation mode
151 operationMode mode_;
152
153 //- Heat power [W]
154 autoPtr<Function1<scalar>> Q_;
155
156 //- Heat flux [W/m2]
157 autoPtr<PatchFunction1<scalar>> q_;
158
159 //- Heat transfer coefficient [W/m2K]
160 autoPtr<PatchFunction1<scalar>> h_;
161
162 //- Ambient temperature [K]
163 autoPtr<Function1<scalar>> Ta_;
164
165 //- Relaxation for the wall temperature (thermal inertia)
166 scalar relaxation_;
167
168 //- Optional surface emissivity for radiative transfer to ambient
169 scalar emissivity_;
170
171 //- Cache qr for relaxation
172 scalarField qrPrevious_;
173
174 //- Relaxation for qr
175 scalar qrRelaxation_;
176
177 //- Name of the radiative heat flux
178 const word qrName_;
179
180 //- Thickness of layers
181 scalarList thicknessLayers_;
182
183 //- Conductivity of layers
184 scalarList kappaLayers_;
185
186
187public:
188
189 //- Runtime type information
190 TypeName("externalWallHeatFluxTemperature");
191
192
193 // Constructors
194
195 //- Construct from patch and internal field
197 (
198 const fvPatch&,
199 const DimensionedField<scalar, volMesh>&
200 );
201
202 //- Construct from patch, internal field and dictionary
204 (
205 const fvPatch&,
206 const DimensionedField<scalar, volMesh>&,
208 );
209
210 //- Construct by mapping given
211 // externalWallHeatFluxTemperatureFvPatchScalarField
212 // onto a new patch
214 (
216 const fvPatch&,
218 const fvPatchFieldMapper&
225 );
227 //- Construct as copy setting internal field reference
229 (
232 );
233
234 //- Return a clone
235 virtual tmp<fvPatchField<scalar>> clone() const
236 {
237 return fvPatchField<scalar>::Clone(*this);
238 }
239
240 //- Clone with an internal field reference
242 (
244 ) const
245 {
246 return fvPatchField<scalar>::Clone(*this, iF);
247 }
248
249
250 // Member functions
251
252 // Access
253
254 //- Allow manipulation of the boundary values
255 virtual bool fixesValue() const
256 {
257 return false;
258 }
259
260
261 // Mapping functions
262
263 //- Map (and resize as needed) from self given a mapping object
264 virtual void autoMap
265 (
266 const fvPatchFieldMapper&
267 );
268
269 //- Reverse map the given fvPatchField onto this fvPatchField
270 virtual void rmap
271 (
272 const fvPatchScalarField&,
273 const labelList&
274 );
275
276
277 // Evaluation functions
278
279 //- Update the coefficients associated with the patch field
280 virtual void updateCoeffs();
281
282
283 // I-O
284
285 //- Write
286 void write(Ostream&) const;
287};
288
289
290// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
291
292} // End namespace Foam
293
294// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
295
296#endif
297
298// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition Enum.H:57
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
This boundary condition applies a heat flux condition to temperature on an external wall in one of th...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual bool fixesValue() const
Allow manipulation of the boundary values.
virtual tmp< fvPatchField< scalar > > clone(const DimensionedField< scalar, volMesh > &iF) const
Clone with an internal field reference.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
TypeName("externalWallHeatFluxTemperature")
Runtime type information.
externalWallHeatFluxTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A FieldMapper for finite-volume patch fields.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
Common functions used in temperature coupled boundaries.
temperatureCoupledBase(const fvPatch &patch, const KMethodType method=KMethodType::mtFluidThermo)
Default construct from patch, using fluidThermo (default) or specified method.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
List< scalar > scalarList
List of scalar.
Definition scalarList.H:32
fvPatchField< scalar > fvPatchScalarField
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68