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-2015 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 the
48  mesh database using the \c lookup option, or from a \c solidThermo
49  thermophysical package.
50 
51 
52  \heading Patch usage
53 
54  \table
55  Property | Description | Required | Default value
56  kappa | thermal conductivity option | yes |
57  q | heat flux [W/m^2] | yes* |
58  Ta | ambient temperature [K] | yes* |
59  h | heat transfer coefficient [W/m^2/K] | yes*|
60  thicknessLayers | list of thicknesses per layer [m] | yes |
61  kappaLayers | list of thermal conductivites per layer [W/m/K] | yes |
62  kappaName | name of thermal conductivity field | yes |
63  Qr | name of the radiative field | no | no
64  relaxation | relaxation factor for radiative field | no | 1
65  \endtable
66 
67  Example of the boundary condition specification:
68  \verbatim
69  myPatch
70  {
71  type externalWallHeatFluxTemperature;
72  kappa fluidThermo;
73  q uniform 1000;
74  Ta uniform 300.0;
75  h uniform 10.0;
76  thicknessLayers (0.1 0.2 0.3 0.4);
77  kappaLayers (1 2 3 4);
78  value uniform 300.0;
79  kappaName none;
80  Qr none;
81  relaxation 1;
82  }
83  \endverbatim
84 
85 Note
86  - Only supply \c h and \c Ta, or \c q in the dictionary (see above)
87  - kappa entries can be: fluidThermo, solidThermo or lookup
88 
89 SourceFiles
90  externalWallHeatFluxTemperatureFvPatchScalarField.C
91 
92 \*---------------------------------------------------------------------------*/
93 
94 #ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H
95 #define solidWallHeatFluxTemperatureFvPatchScalarField_H
96 
97 #include "mixedFvPatchFields.H"
98 #include "temperatureCoupledBase.H"
99 
100 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101 
102 namespace Foam
103 {
104 
105 /*---------------------------------------------------------------------------*\
106  Class externalWallHeatFluxTemperatureFvPatchScalarField Declaration
107 \*---------------------------------------------------------------------------*/
108 
109 class externalWallHeatFluxTemperatureFvPatchScalarField
110 :
111  public mixedFvPatchScalarField,
112  public temperatureCoupledBase
113 {
114 public:
115 
116  // Public data
117 
118  //- Operation mode enumeration
119  enum operationMode
120  {
123  unknown
124  };
125 
126  static const NamedEnum<operationMode, 3> operationModeNames;
127 
128 
129 private:
130 
131  // Private data
132 
133  //- Operation mode
135 
136  //- Heat flux / [W/m2]
137  scalarField q_;
138 
139  //- Heat transfer coefficient / [W/m2K]
140  scalarField h_;
141 
142  //- Ambient temperature / [K]
144 
145  //- Chache Qr for relaxation
147 
148  //- Relaxation for Qr
149  scalar QrRelaxation_;
150 
151  //- Name of the radiative heat flux
152  const word QrName_;
153 
154  //- Thickness of layers
156 
157  //- Conductivity of layers
159 
160 
161 public:
162 
163  //- Runtime type information
164  TypeName("externalWallHeatFluxTemperature");
165 
166 
167  // Constructors
168 
169  //- Construct from patch and internal field
171  (
172  const fvPatch&,
174  );
175 
176  //- Construct from patch, internal field and dictionary
178  (
179  const fvPatch&,
181  const dictionary&
182  );
183 
184  //- Construct by mapping given
185  // externalWallHeatFluxTemperatureFvPatchScalarField
186  // onto a new patch
188  (
190  const fvPatch&,
192  const fvPatchFieldMapper&
193  );
194 
195  //- Construct as copy
197  (
199  );
200 
201  //- Construct and return a clone
202  virtual tmp<fvPatchScalarField> clone() const
203  {
205  (
207  );
208  }
209 
210  //- Construct as copy setting internal field reference
212  (
215  );
216 
217  //- Construct and return a clone setting internal field reference
219  (
221  ) const
222  {
224  (
226  );
227  }
228 
229 
230  // Member functions
231 
232  // Mapping functions
233 
234  //- Map (and resize as needed) from self given a mapping object
235  virtual void autoMap
236  (
237  const fvPatchFieldMapper&
238  );
239 
240  //- Reverse map the given fvPatchField onto this fvPatchField
241  virtual void rmap
242  (
243  const fvPatchScalarField&,
244  const labelList&
245  );
246 
247 
248  // Evaluation functions
249 
250  //- Update the coefficients associated with the patch field
251  virtual void updateCoeffs();
252 
253 
254  // I-O
255 
256  //- Write
257  void write(Ostream&) const;
258 };
259 
260 
261 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
262 
263 } // End namespace Foam
264 
265 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
266 
267 #endif
268 
269 // ************************************************************************* //
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::kappaLayers_
scalarList kappaLayers_
Conductivity of layers.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:219
Foam::fvPatchField
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::q_
scalarField q_
Heat flux / [W/m2].
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:198
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::mode_
operationMode mode_
Operation mode.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:195
Foam::scalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Definition: primitiveFieldsFwd.H:48
Foam::scalarList
List< scalar > scalarList
A List of scalars.
Definition: scalarList.H:50
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::fixedHeatFlux
@ fixedHeatFlux
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:182
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::TypeName
TypeName("externalWallHeatFluxTemperature")
Runtime type information.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.C:235
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::h_
scalarField h_
Heat transfer coefficient / [W/m2K].
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:201
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::rmap
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.C:247
Foam::temperatureCoupledBase
Common functions for use in temperature coupled boundaries.
Definition: temperatureCoupledBase.H:104
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:263
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::unknown
@ unknown
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:184
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::Ta_
scalarField Ta_
Ambient temperature / [K].
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:204
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::fixedHeatTransferCoeff
@ fixedHeatTransferCoeff
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:183
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::operationMode
operationMode
Operation mode enumeration.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:180
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
temperatureCoupledBase.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::thicknessLayers_
scalarList thicknessLayers_
Thickness of layers.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:216
mixedFvPatchFields.H
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::externalWallHeatFluxTemperatureFvPatchScalarField
externalWallHeatFluxTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.C:62
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write
void write(Ostream &) const
Write.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.C:344
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::QrPrevious_
scalarField QrPrevious_
Chache Qr for relaxation.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:207
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::externalWallHeatFluxTemperatureFvPatchScalarField
This boundary condition supplies a heat flux condition for temperature on an external wall....
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:170
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.C:263
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::operationModeNames
static const NamedEnum< operationMode, 3 > operationModeNames
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:187
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::QrRelaxation_
scalar QrRelaxation_
Relaxation for Qr.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:210
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::QrName_
const word QrName_
Name of the radiative heat flux.
Definition: externalWallHeatFluxTemperatureFvPatchScalarField.H:213
Foam::NamedEnum< operationMode, 3 >
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51