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