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-2020 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  \endtable
67 
68  Example of the boundary condition specification:
69  \verbatim
70  <patchName>
71  {
72  type externalWallHeatFluxTemperature;
73 
74  mode coefficient;
75 
76  Ta constant 300.0;
77  h uniform 10.0;
78  thicknessLayers (0.1 0.2 0.3 0.4);
79  kappaLayers (1 2 3 4);
80 
81  value $internalField;
82  }
83  \endverbatim
84 
85 See also
86  Foam::temperatureCoupledBase
87  Foam::mixedFvPatchScalarField
88 
89 SourceFiles
90  externalWallHeatFluxTemperatureFvPatchScalarField.C
91 
92 \*---------------------------------------------------------------------------*/
93 
94 #ifndef externalWallHeatFluxTemperatureFvPatchScalarField_H
95 #define externalWallHeatFluxTemperatureFvPatchScalarField_H
96 
97 #include "mixedFvPatchFields.H"
98 #include "temperatureCoupledBase.H"
99 #include "Function1.H"
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 namespace Foam
104 {
105 
106 /*---------------------------------------------------------------------------*\
107  Class externalWallHeatFluxTemperatureFvPatchScalarField Declaration
108 \*---------------------------------------------------------------------------*/
109 
110 class externalWallHeatFluxTemperatureFvPatchScalarField
111 :
112  public mixedFvPatchScalarField,
113  public temperatureCoupledBase
114 {
115 public:
116 
117  // Public data
118 
119  //- Operation mode enumeration
120  enum operationMode
121  {
122  fixedPower,
125  };
126 
127  static const NamedEnum<operationMode, 3> operationModeNames;
128 
129 
130 private:
131 
132  // Private Data
133 
134  //- Operation mode
135  operationMode mode_;
136 
137  //- Heat power [W]
138  scalar Q_;
139 
140  //- Heat flux [W/m^2]
141  scalarField q_;
142 
143  //- Heat transfer coefficient [W/m^2K]
144  scalarField h_;
145 
146  //- Ambient temperature [K]
147  autoPtr<Function1<scalar>> Ta_;
148 
149  //- Relaxation for the wall temperature (thermal inertia)
150  scalar relaxation_;
151 
152  //- Optional surface emissivity for radiative transfer to ambient
153  scalar emissivity_;
154 
155  //- Cache qr for relaxation
156  scalarField qrPrevious_;
157 
158  //- Relaxation for qr
159  scalar qrRelaxation_;
160 
161  //- Name of the radiative heat flux
162  const word qrName_;
163 
164  //- Thickness of layers
165  scalarList thicknessLayers_;
166 
167  //- Conductivity of layers
168  scalarList kappaLayers_;
169 
170 
171 public:
172 
173  //- Runtime type information
174  TypeName("externalWallHeatFluxTemperature");
175 
176 
177  // Constructors
178 
179  //- Construct from patch and internal field
181  (
182  const fvPatch&,
183  const DimensionedField<scalar, volMesh>&
184  );
186  //- Construct from patch, internal field and dictionary
188  (
189  const fvPatch&,
191  const dictionary&
192  );
193 
194  //- Construct by mapping given
195  // externalWallHeatFluxTemperatureFvPatchScalarField
196  // onto a new patch
198  (
200  const fvPatch&,
203  );
204 
205  //- Copy constructor
207  (
209  );
210 
211  //- Construct and return a clone
212  virtual tmp<fvPatchScalarField> clone() const
213  {
215  (
217  );
218  }
219 
220  //- Copy constructor setting internal field reference
222  (
225  );
226 
227  //- Construct and return a clone setting internal field reference
229  (
231  ) const
232  {
234  (
236  );
237  }
238 
239 
240  // Member Functions
241 
242  // Access
243 
244  //- Allow manipulation of the boundary values
245  virtual bool fixesValue() const
246  {
247  return false;
248  }
249 
250 
251  // Mapping functions
252 
253  //- Map (and resize as needed) from self given a mapping object
254  // Used to update fields following mesh topology change
255  virtual void autoMap(const fvPatchFieldMapper&);
256 
257  //- Reverse map the given fvPatchField onto this fvPatchField
258  // Used to reconstruct fields
259  virtual void rmap(const fvPatchScalarField&, const labelList&);
260 
261 
262  // Evaluation functions
263 
264  //- Update the coefficients associated with the patch field
265  virtual void updateCoeffs();
266 
267 
268  // I-O
269 
270  //- Write
271  void write(Ostream&) const;
272 };
273 
274 
275 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
276 
277 } // End namespace Foam
278 
279 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
280 
281 #endif
282 
283 // ************************************************************************* //
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
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:54
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.