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-2022 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. Heat flux can be specified in the following ways:
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  If more than one parameter is given then the heat fluxes are summed.
44 
45  If a heat transfer coefficient is given optional thin thermal layer
46  resistances can be specified through thicknessLayers and kappaLayers
47  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  Q | Power [W] | no | 0
59  q | Heat flux [W/m^2] | no | 0
60  h | Heat transfer coefficient [W/m^2/K] | no | 0
61  Ta | Ambient temperature [K] | if h is given |
62  thicknessLayers | Layer thicknesses [m] | no |
63  kappaLayers | Layer thermal conductivities [W/m/K] | no |
64  relaxation | Relaxation for the wall temperature | no | 1
65  emissivity | Surface emissivity for radiative flux to ambient | no | 0
66  qr | Name of the radiative field | no | none
67  qrRelaxation | Relaxation factor for radiative field | no | 1
68  \endtable
69 
70  Example of the boundary condition specification:
71  \verbatim
72  <patchName>
73  {
74  type externalWallHeatFluxTemperature;
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  // Private Data
116 
117  // Heat power
118 
119  //- Do we have a heat power?
120  bool haveQ_;
121 
122  //- Heat power [W]
123  scalar Q_;
124 
125 
126  // Heat flux
127 
128  //- Do we have a heat flux?
129  bool haveq_;
130 
131  //- Heat flux [W/m^2]
132  scalarField q_;
133 
134 
135  // Heat transfer coefficient
136 
137  //- Do we have a heat transfer coefficient?
138  bool haveh_;
139 
140  //- Heat transfer coefficient [W/m^2K]
141  scalarField h_;
142 
143  //- Ambient temperature [K]
144  autoPtr<Function1<scalar>> Ta_;
145 
146  //- Optional surface emissivity for radiative transfer to ambient
147  scalar emissivity_;
148 
149  //- Thickness of layers
150  scalarList thicknessLayers_;
151 
152  //- Conductivity of layers
153  scalarList kappaLayers_;
154 
155 
156  //- Relaxation for the wall temperature (thermal inertia)
157  scalar relaxation_;
158 
159 
160  // Radiation
161 
162  //- Name of the radiative heat flux
163  const word qrName_;
164 
165  //- Relaxation for qr
166  scalar qrRelaxation_;
167 
168  //- Cache qr for relaxation
169  scalarField qrPrevious_;
170 
171 
172 public:
173 
174  //- Runtime type information
175  TypeName("externalWallHeatFluxTemperature");
176 
177 
178  // Constructors
179 
180  //- Construct from patch and internal field
182  (
183  const fvPatch&,
185  );
186 
187  //- Construct from patch, internal field and dictionary
189  (
190  const fvPatch&,
192  const dictionary&
193  );
194 
195  //- Construct by mapping given
196  // externalWallHeatFluxTemperatureFvPatchScalarField
197  // onto a new patch
199  (
201  const fvPatch&,
203  const fvPatchFieldMapper&
204  );
205 
206  //- Disallow copy without setting internal field reference
208  (
210  ) = delete;
211 
212  //- Copy constructor setting internal field reference
214  (
217  );
218 
219  //- Construct and return a clone setting internal field reference
221  (
223  ) const
224  {
226  (
228  );
229  }
230 
231 
232  // Member Functions
233 
234  // Access
235 
236  //- Allow manipulation of the boundary values
237  virtual bool fixesValue() const
238  {
239  return false;
240  }
241 
242 
243  // Mapping functions
244 
245  //- Map (and resize as needed) from self given a mapping object
246  // Used to update fields following mesh topology change
247  virtual void autoMap(const fvPatchFieldMapper&);
248 
249  //- Reverse map the given fvPatchField onto this fvPatchField
250  // Used to reconstruct fields
251  virtual void rmap(const fvPatchScalarField&, const labelList&);
252 
253  //- Reset the fvPatchField to the given fvPatchField
254  // Used for mesh to mesh mapping
255  virtual void reset(const fvPatchScalarField&);
256 
257 
258  // Evaluation functions
259 
260  //- Update the coefficients associated with the patch field
261  virtual void updateCoeffs();
262 
263 
264  // I-O
265 
266  //- Write
267  void write(Ostream&) const;
268 };
269 
270 
271 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
272 
273 } // End namespace Foam
274 
275 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
276 
277 #endif
278 
279 // ************************************************************************* //
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
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...
Namespace for OpenFOAM.
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.