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-2017 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 applies a heat flux condition to temperature
32  on an external wall in one of three modes:
33 
34  - fixed power: supply Q
35  - fixed heat flux: supply q
36  - fixed heat transfer coefficient: supply h and Ta
37 
38  where:
39  \vartable
40  Q | Power [W]
41  q | Heat flux [W/m^2]
42  h | Heat transfer coefficient [W/m^2/K]
43  Ta | Ambient temperature [K]
44  \endvartable
45 
46  For heat transfer coefficient mode optional thin thermal layer resistances
47  can be specified through thicknessLayers and kappaLayers entries.
48 
49  The thermal conductivity \c kappa can either be retrieved from various
50  possible sources, as detailed in the class temperatureCoupledBase.
51 
52  The ambient temperature Ta is specified as a Foam::Function1 of time but
53  uniform is space.
54 
55 Usage
56  \table
57  Property | Description | Required | Default value
58  mode | 'power', 'flux' or 'coefficient' | yes |
59  Q | Power [W] | for mode 'power' |
60  q | Heat flux [W/m^2] | for mode 'flux' |
61  h | Heat transfer coefficient [W/m^2/K] | for mode 'coefficent' |
62  Ta | Ambient temperature [K] | for mode 'coefficient' |
63  thicknessLayers | Layer thicknesses [m] | no |
64  kappaLayers | Layer thermal conductivities [W/m/K] | no |
65  relaxation | Relaxation for the wall temperature | no | 1
66  emissivity | Surface emissivity for radiative flux to ambient | no | 0
67  qr | Name of the radiative field | no | none
68  qrRelaxation | Relaxation factor for radiative field | no | 1
69  kappaMethod | Inherited from temperatureCoupledBase | inherited |
70  kappa | Inherited from temperatureCoupledBase | inherited |
71  \endtable
72 
73  Example of the boundary condition specification:
74  \verbatim
75  <patchName>
76  {
77  type externalWallHeatFluxTemperature;
78 
79  mode coefficient;
80 
81  Ta constant 300.0;
82  h uniform 10.0;
83  thicknessLayers (0.1 0.2 0.3 0.4);
84  kappaLayers (1 2 3 4);
85 
86  kappaMethod fluidThermo;
87 
88  value $internalField;
89  }
90  \endverbatim
91 
92 See also
93  Foam::temperatureCoupledBase
94  Foam::mixedFvPatchScalarField
95 
96 SourceFiles
97  externalWallHeatFluxTemperatureFvPatchScalarField.C
98 
99 \*---------------------------------------------------------------------------*/
100 
101 #ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H
102 #define solidWallHeatFluxTemperatureFvPatchScalarField_H
103 
104 #include "mixedFvPatchFields.H"
105 #include "temperatureCoupledBase.H"
106 #include "Function1.H"
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 namespace Foam
111 {
112 
113 /*---------------------------------------------------------------------------*\
114  Class externalWallHeatFluxTemperatureFvPatchScalarField Declaration
115 \*---------------------------------------------------------------------------*/
116 
117 class externalWallHeatFluxTemperatureFvPatchScalarField
118 :
119  public mixedFvPatchScalarField,
120  public temperatureCoupledBase
121 {
122 public:
123 
124  // Public data
125 
126  //- Operation mode enumeration
127  enum operationMode
128  {
129  fixedPower,
132  };
133 
134  static const NamedEnum<operationMode, 3> operationModeNames;
135 
136 
137 private:
138 
139  // Private data
140 
141  //- Operation mode
142  operationMode mode_;
143 
144  //- Heat power [W]
145  scalar Q_;
146 
147  //- Heat flux [W/m2]
148  scalarField q_;
149 
150  //- Heat transfer coefficient [W/m2K]
151  scalarField h_;
152 
153  //- Ambient temperature [K]
154  autoPtr<Function1<scalar>> Ta_;
155 
156  //- Relaxation for the wall temperature (thermal inertia)
157  scalar relaxation_;
158 
159  //- Optional surface emissivity for radiative transfer to ambient
160  scalar emissivity_;
161 
162  //- Cache qr for relaxation
163  scalarField qrPrevious_;
164 
165  //- Relaxation for qr
166  scalar qrRelaxation_;
167 
168  //- Name of the radiative heat flux
169  const word qrName_;
170 
171  //- Thickness of layers
172  scalarList thicknessLayers_;
173 
174  //- Conductivity of layers
175  scalarList kappaLayers_;
176 
177 
178 public:
179 
180  //- Runtime type information
181  TypeName("externalWallHeatFluxTemperature");
182 
183 
184  // Constructors
185 
186  //- Construct from patch and internal field
188  (
189  const fvPatch&,
190  const DimensionedField<scalar, volMesh>&
191  );
192 
193  //- Construct from patch, internal field and dictionary
195  (
196  const fvPatch&,
197  const DimensionedField<scalar, volMesh>&,
198  const dictionary&
199  );
200 
201  //- Construct by mapping given
202  // externalWallHeatFluxTemperatureFvPatchScalarField
203  // onto a new patch
205  (
207  const fvPatch&,
209  const fvPatchFieldMapper&
210  );
211 
212  //- Construct as copy
214  (
216  );
217 
218  //- Construct and return a clone
220  {
222  (
224  );
225  }
226 
227  //- Construct as copy setting internal field reference
229  (
232  );
233 
234  //- Construct and return a clone setting internal field reference
236  (
238  ) const
239  {
241  (
243  );
244  }
245 
246 
247  // Member functions
248 
249  // Mapping functions
250 
251  //- Map (and resize as needed) from self given a mapping object
252  virtual void autoMap
253  (
254  const fvPatchFieldMapper&
255  );
256 
257  //- Reverse map the given fvPatchField onto this fvPatchField
258  virtual void rmap
259  (
260  const fvPatchScalarField&,
261  const labelList&
262  );
263 
264 
265  // Evaluation functions
266 
267  //- Update the coefficients associated with the patch field
268  virtual void updateCoeffs();
269 
270 
271  // I-O
272 
273  //- Write
274  void write(Ostream&) const;
275 };
276 
277 
278 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
279 
280 } // End namespace Foam
281 
282 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
283 
284 #endif
285 
286 // ************************************************************************* //
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 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:66
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:53
TypeName("externalWallHeatFluxTemperature")
Runtime type information.
This boundary condition applies a heat flux condition to temperature on an external wall in one of th...
Namespace for OpenFOAM.