thermalBaffleFvPatchScalarField.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::compressible::thermalBaffleFvPatchScalarField
29 
30 Group
31  grpThermoBoundaryConditions
32 
33 Description
34  This boundary condition provides a coupled temperature condition between
35  multiple mesh regions.
36 
37  The regions are generally referred to as the:
38  - primary region,
39  - and baffle region.
40 
41  The primary region creates the baffle region and evolves its energy
42  equation either:
43  - 1-D, normal to each patch face
44  - 3-D, normal and tangential components
45 
46  The thermodynamic properties of the baffle material are specified via
47  dictionary entries on the master patch.
48 
49  The underlying polyPatch on the primary region needs to be defined
50  as a complete mappedWall. i.e:
51 
52  \verbatim
53  type mappedWall;
54  sampleMode nearestPatchFace;
55  samplePatch <patchName>;
56  sampleRegion <regionName>;
57 
58  coupleGroup <coupleGroupName>;
59 
60  \endverbatim
61 
62  The /keyword{internal} is true when the thermal baffle is used on internal
63  faces and the baffle is coupled on both sides (bottom and top).
64 
65  If this baffle is used on a patch set internal = false. By default is
66  true.
67 
68  \table
69  Property | Description | Required | Default value
70  Tnbr | name of the field | no | T
71  qrNbr | name of the radiative flux in the nbr region | no | none
72  qr | name of the radiative flux in this region | no | none
73  thicknessLayers | inherited from temperatureCoupledBase | inherited
74  kappaLayers | inherited from temperatureCoupledBase | inherited
75  kappaMethod | inherited from temperatureCoupledBase | inherited
76  kappa | inherited from temperatureCoupledBase | inherited
77  thermalInertia | Add thermal inertia to wall node | no | false
78  region | Name of the solid region | yes
79  active | Active | yes
80  internal | Is the baffle an internal regiion | no | true
81  thermoType | Solid thermo type | yes
82  mixture | Mixture solid | yes
83  radiation | Radiation model in the solid | yes
84  extrudeModel | Extrude model | yes
85  nLayers | Number of cell across the ragion | yes
86  expansionRatio | Expansion ratio for the solid region | yes
87  columnCells | true for 1D or false for 3D region | yes
88 
89  \endtable
90 
91 Usage
92  Example of the boundary condition specification:
93  \verbatim
94  <masterPatchName>
95  {
96  type compressible::thermalBaffle;
97 
98  // Underlying coupled boundary condition
99  Tnbr T;
100  kappaMethod fluidThermo; // or solidThermo
101  kappa none;
102  qrNbr qr;//or none.Name of qr field on neighbourregion
103  qr none;// or none.Name of qr field on localregion
104  value uniform 300;
105 
106  // Baffle region name
107  region baffleRegion;
108  active yes;
109  internal yes;
110 
111  // Solid thermo in solid region
112  thermoType
113  {
114  type heSolidThermo;
115  mixture pureMixture;
116  transport constIso;
117  thermo hConst;
118  equationOfState rhoConst;
119  specie specie;
120  energy sensibleEnthalpy;
121  }
122 
123  mixture
124  {
125  specie
126  {
127  molWeight 20;
128  }
129  transport
130  {
131  kappa 0.01;
132  }
133  thermodynamics
134  {
135  Hf 0;
136  Cp 15;
137  }
138  density
139  {
140  rho 80;
141  }
142  }
143 
144  radiation
145  {
146  radiationModel opaqueSolid;
147  absorptionEmissionModel none;
148  scatterModel none;
149  }
150 
151  // Extrude model for new region
152 
153  extrudeModel linearNormal;
154  nLayers 50;
155  expansionRatio 1;
156  columnCells false; //3D or 1D
157  linearNormalCoeffs
158  {
159  thickness 0.02;
160  }
161 
162  }
163  \endverbatim
164 
165  If the thermal baffle is used on internal faces of the primary region,
166  then the slave in this region is defined as :
167 
168  Slave patch on primary region:
169  \verbatim
170  <slavePatchName>
171  {
172  type compressible::thermalBaffle;
173  kappaMethod fluidThermo;
174  kappa none;
175  value uniform 300;
176  \endverbatim
177 
178  Patches on baffle region:
179  \verbatim
180  bottom
181  {
182  type compressible::thermalBaffle;
183  kappaMethod solidThermo;
184  kappa none;
185  value uniform 300;
186  }
187 
188  top
189  {
190  type compressible::thermalBaffle;
191  kappaMethod solidThermo;
192  kappa none;
193  value uniform 300;
194  }
195  \endverbatim
196 
197 See also
198  Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
199  Foam::regionModels::thermalBaffleModels::thermalBaffleModel
200 
201 SourceFiles
202  thermalBaffleFvPatchScalarField.C
203 
204 \*---------------------------------------------------------------------------*/
205 
206 #ifndef thermalBaffleFvPatchScalarField_H
207 #define thermalBaffleFvPatchScalarField_H
208 
209 
210 #include "autoPtr.H"
211 #include "regionModel.H"
212 #include "thermalBaffleModel.H"
213 #include "extrudePatchMesh.H"
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 
219 namespace Foam
220 {
221 namespace compressible
222 {
223 
224 /*---------------------------------------------------------------------------*\
225  Class thermalBaffleFvPatchScalarField Declaration
226 \*---------------------------------------------------------------------------*/
227 
228 class thermalBaffleFvPatchScalarField
229 :
230  public turbulentTemperatureRadCoupledMixedFvPatchScalarField
231 {
232  // Private data
233 
234  //- Enumeration of patch IDs
235  enum patchID
236  {
237  bottomPatchID,
238  topPatchID,
239  sidePatchID
240  };
241 
242  //- Is the baffle owner
243  bool owner_;
244 
245  //- Is the baffle internal
246  bool internal_;
247 
248  //- Thermal baffle
249  autoPtr<regionModels::thermalBaffleModels::thermalBaffleModel> baffle_;
250 
251  //- Dictionary
252  dictionary dict_;
253 
254  //- Auto pointer to extrapolated mesh from patch
255  autoPtr<extrudePatchMesh> extrudeMeshPtr_;
256 
257 
258  // Private member functions
259 
260  //- Extrude mesh
261  void createPatchMesh();
262 
263 public:
264 
265  //- Runtime type information
266  TypeName("compressible::thermalBaffle");
267 
268 
269  // Constructors
270 
271  //- Construct from patch and internal field
273  (
274  const fvPatch&,
275  const DimensionedField<scalar, volMesh>&
276  );
277 
278  //- Construct from patch, internal field and dictionary
280  (
281  const fvPatch&,
282  const DimensionedField<scalar, volMesh>&,
283  const dictionary&
284  );
285 
286  //- Construct by mapping given
287  // thermalBaffleFvPatchScalarField onto a new patch
289  (
291  const fvPatch&,
292  const DimensionedField<scalar, volMesh>&,
293  const fvPatchFieldMapper&
294  );
295 
296 
297  //- Construct and return a clone
298  virtual tmp<fvPatchScalarField> clone() const
299  {
300  return tmp<fvPatchScalarField>
301  (
303  );
304  }
305 
306  //- Construct as copy setting internal field reference
308  (
311  );
312 
313  //- Construct and return a clone setting internal field reference
315  (
317  ) const
318  {
320  (
321  new thermalBaffleFvPatchScalarField(*this, iF)
322  );
323  }
324 
325 
326  // Member functions
327 
328  //- Update the coefficients associated with the patch field
329  virtual void updateCoeffs();
330 
331  //- Write
332  virtual void write(Ostream&) const;
333 };
334 
335 
336 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
337 
338 } // End namespace compressible
339 } // End namespace Foam
340 
341 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
342 
343 
344 #endif
345 
346 // ************************************************************************* //
Foam::compressible::thermalBaffleFvPatchScalarField::TypeName
TypeName("compressible::thermalBaffle")
Runtime type information.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
thermalBaffleModel.H
regionModel.H
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
compressible
bool compressible
Definition: pEqn.H:2
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::compressible::thermalBaffleFvPatchScalarField
This boundary condition provides a coupled temperature condition between multiple mesh regions.
Definition: thermalBaffleFvPatchScalarField.H:310
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
turbulentTemperatureRadCoupledMixedFvPatchScalarField.H
Foam::compressible::thermalBaffleFvPatchScalarField::thermalBaffleFvPatchScalarField
thermalBaffleFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: thermalBaffleFvPatchScalarField.C:44
Foam::compressible::turbulentTemperatureRadCoupledMixedFvPatchScalarField
Mixed boundary condition for temperature and radiation heat transfer to be used for in multiregion ca...
Definition: turbulentTemperatureRadCoupledMixedFvPatchScalarField.H:154
Foam::compressible::thermalBaffleFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: thermalBaffleFvPatchScalarField.H:380
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::compressible::thermalBaffleFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: thermalBaffleFvPatchScalarField.C:235
extrudePatchMesh.H
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54
Foam::compressible::thermalBaffleFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: thermalBaffleFvPatchScalarField.C:251
autoPtr.H