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 | Copyright (C) 2011-2014 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::thermalBaffleFvPatchScalarField
26 
27 Group
28  grpThermoBoundaryConditions
29 
30 Description
31  This boundary condition provides a coupled temperature condition between
32  multiple mesh regions. The regions are generally referred to as the:
33  - primary region, and
34  - baffle region
35 
36  The primary region creates the baffle region and evolves its energy
37  equation either:
38  - 1-D, normal to each patch face
39  - 2-D, normal and tangential components
40 
41  The thermodynamic properties of the baffle material are specified via
42  dictionary entries on the master patch
43 
44  \heading Patch usage
45  Example of the boundary condition specification:
46  \verbatim
47  myPatch_master
48  {
49  type compressible::thermalBaffle;
50 
51  // Underlaying coupled boundary condition
52  Tnbr T;
53  kappa fluidThermo; // or solidThermo
54  KappaName none;
55  QrNbr Qr;//or none.Name of Qr field on neighbourregion
56  Qr none;// or none.Name of Qr field on localregion
57  value uniform 300;
58 
59  // Baffle region name
60  regionName baffleRegion;
61  active yes;
62 
63  // Solid thermo in solid region
64  thermoType
65  {
66  type heSolidThermo;
67  mixture pureMixture;
68  transport constIso;
69  thermo hConst;
70  equationOfState rhoConst;
71  specie specie;
72  energy sensibleEnthalpy;
73  }
74 
75  mixture
76  {
77  specie
78  {
79  nMoles 1;
80  molWeight 20;
81  }
82  transport
83  {
84  kappa 0.01;
85  }
86  thermodynamics
87  {
88  Hf 0;
89  Cp 15;
90  }
91  density
92  {
93  rho 80;
94  }
95  }
96 
97  radiation
98  {
99  radiationModel opaqueSolid;
100  absorptionEmissionModel none;
101  scatterModel none;
102  }
103 
104 
105  // Extrude model for new region
106 
107  extrudeModel linearNormal;
108  nLayers 50;
109  expansionRatio 1;
110  columnCells false; //3D or 1D
111  linearNormalCoeffs
112  {
113  thickness 0.02;
114  }
115 
116  }
117  \endverbatim
118 
119  /- Slave patch on primary region
120  \verbatim
121  myPatch_slave
122  {
123  type compressible::thermalBaffle;
124  kappa fluidThermo;
125  kappaName none;
126  value uniform 300;
127  \endverbatim
128 
129 
130  /- Patches on baffle region
131  \verbatim
132  bottom
133  {
134  type compressible::thermalBaffle;
135  kappa solidThermo;
136  kappaName none;
137  value uniform 300;
138  }
139 
140  top
141  {
142  type compressible::thermalBaffle;
143  kappa solidThermo;
144  kappaName none;
145  value uniform 300;
146  }
147  \endverbatim
148 
149 
150 SeeAlso
151  Foam::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
152  Foam::regionModels::thermalBaffleModels::thermalBaffleModel
153 
154 SourceFiles
155  thermalBaffleFvPatchScalarField.C
156 
157 \*---------------------------------------------------------------------------*/
158 
159 #ifndef thermalBaffleFvPatchScalarField_H
160 #define thermalBaffleFvPatchScalarField_H
161 
162 
163 #include "autoPtr.H"
164 #include "regionModel.H"
165 #include "thermalBaffleModel.H"
166 #include "extrudePatchMesh.H"
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 
172 namespace Foam
173 {
174 namespace compressible
175 {
176 
177 /*---------------------------------------------------------------------------*\
178  Class thermalBaffleFvPatchScalarField Declaration
179 \*---------------------------------------------------------------------------*/
182 :
184 {
185  // Private data
186 
187  //- Enumeration of patch IDs
188  enum patchID
189  {
190  bottomPatchID,
191  topPatchID,
192  sidePatchID
193  };
194 
195  //- Is the baffle owner
196  bool owner_;
197 
198  //- Thermal baffle
200 
201  //- Dictionary
202  dictionary dict_;
203 
204  //- Auto pointer to extrapolated mesh from patch
205  autoPtr<extrudePatchMesh> extrudeMeshPtr_;
206 
207 
208  // Private member functions
209 
210  //- Extrude mesh
211  void createPatchMesh();
212 
213 public:
214 
215  //- Runtime type information
216  TypeName("compressible::thermalBaffle");
217 
218 
219  // Constructors
220 
221  //- Construct from patch and internal field
223  (
224  const fvPatch&,
226  );
227 
228  //- Construct from patch, internal field and dictionary
230  (
231  const fvPatch&,
233  const dictionary&
234  );
235 
236  //- Construct by mapping given
237  // thermalBaffleFvPatchScalarField onto a new patch
239  (
241  const fvPatch&,
243  const fvPatchFieldMapper&
244  );
245 
246 
247  //- Construct and return a clone
248  virtual tmp<fvPatchScalarField> clone() const
249  {
251  (
253  );
254  }
255 
256  //- Construct as copy setting internal field reference
258  (
261  );
262 
263  //- Construct and return a clone setting internal field reference
265  (
267  ) const
268  {
270  (
271  new thermalBaffleFvPatchScalarField(*this, iF)
272  );
273  }
274 
275 
276  // Member functions
277 
278 
279  // Mapping functions
280 
281  //- Map (and resize as needed) from self given a mapping object
282  virtual void autoMap
283  (
284  const fvPatchFieldMapper&
285  );
286 
287  //- Reverse map the given fvPatchField onto this fvPatchField
288  virtual void rmap
289  (
290  const fvPatchScalarField&,
291  const labelList&
292  );
293 
294 
295  //- Update the coefficients associated with the patch field
296  virtual void updateCoeffs();
297 
298  //- Write
299  virtual void write(Ostream&) const;
300 };
301 
302 
303 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
304 
305 } // End namespace compressible
306 } // End namespace Foam
307 
308 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
309 
310 
311 #endif
312 
313 // ************************************************************************* //
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
thermalBaffleFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Foam::fvPatchFieldMapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
TypeName("compressible::thermalBaffle")
Runtime type information.
Mixed boundary condition for temperature and radiation heat transfer to be used for in multiregion ca...
bool compressible
Definition: pEqn.H:40
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
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
A class for managing temporary objects.
Definition: PtrList.H:118
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.