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 | Copyright (C) 2011-2016 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 Class
25  Foam::externalWallHeatFluxTemperatureFvPatchScalarField
26 
27 Group
28  grpThermoBoundaryConditions grpWallBoundaryConditions
29 
30 Description
31  This boundary condition supplies a heat flux condition for temperature
32  on an external wall. Optional thin thermal layer resistances can be
33  specified through thicknessLayers and kappaLayers entries for the
34  fixed heat transfer coefficient mode.
35 
36  The condition can operate in two modes:
37  - fixed heat transfer coefficient: supply h and Ta
38  - fixed heat flux: supply q
39 
40  where:
41  \vartable
42  h | heat transfer coefficient [W/m^2/K]
43  Ta | ambient temperature [K]
44  q | heat flux [W/m^2]
45  \endvartable
46 
47  The thermal conductivity \c kappa can either be retrieved from various
48  possible sources, as detailed in the class temperatureCoupledBase.
49 
50 Usage
51  \table
52  Property | Description | Required | Default value
53  q | heat flux [W/m^2] | yes* |
54  Ta | ambient temperature [K] | yes* |
55  h | heat transfer coefficient [W/m^2/K] | yes*|
56  thicknessLayers | list of thicknesses per layer [m] | yes |
57  kappaLayers | list of thermal conductivities per layer [W/m/K] | yes |
58  Qr | name of the radiative field | no | no
59  relaxation | relaxation factor for radiative field | no | 1
60  kappaMethod | inherited from temperatureCoupledBase | inherited |
61  kappa | inherited from temperatureCoupledBase | inherited |
62  \endtable
63 
64  Example of the boundary condition specification:
65  \verbatim
66  <patchName>
67  {
68  type externalWallHeatFluxTemperature;
69  q uniform 1000;
70  Ta uniform 300.0;
71  h uniform 10.0;
72  thicknessLayers (0.1 0.2 0.3 0.4);
73  kappaLayers (1 2 3 4);
74  value uniform 300.0;
75  Qr none;
76  relaxation 1;
77  kappaMethod fluidThermo;
78  kappa none;
79  }
80  \endverbatim
81 
82  Note:
83  - Only supply \c h and \c Ta, or \c q in the dictionary (see above)
84 
85 See also
86  Foam::temperatureCoupledBase
87 
88 SourceFiles
89  externalWallHeatFluxTemperatureFvPatchScalarField.C
90 
91 \*---------------------------------------------------------------------------*/
92 
93 #ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H
94 #define solidWallHeatFluxTemperatureFvPatchScalarField_H
95 
96 #include "mixedFvPatchFields.H"
97 #include "temperatureCoupledBase.H"
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 namespace Foam
102 {
103 
104 /*---------------------------------------------------------------------------*\
105  Class externalWallHeatFluxTemperatureFvPatchScalarField Declaration
106 \*---------------------------------------------------------------------------*/
107 
108 class externalWallHeatFluxTemperatureFvPatchScalarField
109 :
110  public mixedFvPatchScalarField,
111  public temperatureCoupledBase
112 {
113 public:
114 
115  // Public data
116 
117  //- Operation mode enumeration
118  enum operationMode
119  {
122  unknown
123  };
124 
125  static const NamedEnum<operationMode, 3> operationModeNames;
126 
127 
128 private:
129 
130  // Private data
131 
132  //- Operation mode
133  operationMode mode_;
134 
135  //- Heat flux / [W/m2]
136  scalarField q_;
137 
138  //- Heat transfer coefficient / [W/m2K]
139  scalarField h_;
140 
141  //- Ambient temperature / [K]
142  scalarField Ta_;
143 
144  //- Chache Qr for relaxation
145  scalarField QrPrevious_;
146 
147  //- Relaxation for Qr
148  scalar QrRelaxation_;
149 
150  //- Name of the radiative heat flux
151  const word QrName_;
152 
153  //- Thickness of layers
154  scalarList thicknessLayers_;
155 
156  //- Conductivity of layers
157  scalarList kappaLayers_;
158 
159 
160 public:
161 
162  //- Runtime type information
163  TypeName("externalWallHeatFluxTemperature");
164 
165 
166  // Constructors
167 
168  //- Construct from patch and internal field
170  (
171  const fvPatch&,
173  );
174 
175  //- Construct from patch, internal field and dictionary
177  (
178  const fvPatch&,
180  const dictionary&
181  );
183  //- Construct by mapping given
184  // externalWallHeatFluxTemperatureFvPatchScalarField
185  // onto a new patch
187  (
189  const fvPatch&,
191  const fvPatchFieldMapper&
192  );
193 
194  //- Construct as copy
196  (
198  );
199 
200  //- Construct and return a clone
201  virtual tmp<fvPatchScalarField> clone() const
202  {
204  (
206  );
207  }
208 
209  //- Construct as copy setting internal field reference
211  (
214  );
215 
216  //- Construct and return a clone setting internal field reference
218  (
220  ) const
221  {
223  (
225  );
226  }
227 
228 
229  // Member functions
230 
231  // Mapping functions
232 
233  //- Map (and resize as needed) from self given a mapping object
234  virtual void autoMap
235  (
236  const fvPatchFieldMapper&
237  );
238 
239  //- Reverse map the given fvPatchField onto this fvPatchField
240  virtual void rmap
241  (
242  const fvPatchScalarField&,
243  const labelList&
244  );
245 
246 
247  // Evaluation functions
248 
249  //- Update the coefficients associated with the patch field
250  virtual void updateCoeffs();
251 
252 
253  // I-O
254 
255  //- Write
256  void write(Ostream&) const;
257 };
258 
259 
260 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
261 
262 } // End namespace Foam
263 
264 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
265 
266 #endif
267 
268 // ************************************************************************* //
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Foam::fvPatchFieldMapper.
List< scalar > scalarList
A List of scalars.
Definition: scalarList.H:50
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
externalWallHeatFluxTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A class for managing temporary objects.
Definition: PtrList.H:54
TypeName("externalWallHeatFluxTemperature")
Runtime type information.
This boundary condition supplies a heat flux condition for temperature on an external wall...
Namespace for OpenFOAM.