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