thermalBaffleFvPatchScalarField.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-2019 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 Description
28  This boundary condition provides a coupled temperature condition between
29  multiple mesh regions.
30 
31  The regions are generally referred to as the:
32  - primary region,
33  - and baffle region.
34 
35  The primary region creates the baffle region and evolves its energy
36  equation either:
37  - 1-D, normal to each patch face
38  - 2-D, normal and tangential components
39 
40  The thermodynamic properties of the baffle material are specified via
41  dictionary entries on the master patch.
42 
43 Usage
44  Example of the boundary condition specification:
45  \verbatim
46  <masterPatchName>
47  {
48  type compressible::thermalBaffle;
49 
50  // Underlaying coupled boundary condition
51  Tnbr T;
52  kappa fluidThermo; // or solidThermo
53  KappaName none;
54  qrNbr qr;//or none.Name of qr field on neighbourregion
55  qr none;// or none.Name of qr field on localregion
56  value uniform 300;
57 
58  // Baffle region name
59  regionName baffleRegion;
60  active yes;
61 
62  // Solid thermo in solid region
63  thermoType
64  {
65  type heSolidThermo;
66  mixture pureMixture;
67  transport constIso;
68  thermo hConst;
69  equationOfState rhoConst;
70  specie specie;
71  energy sensibleEnthalpy;
72  }
73 
74  mixture
75  {
76  specie
77  {
78  molWeight 20;
79  }
80  transport
81  {
82  kappa 0.01;
83  }
84  thermodynamics
85  {
86  Hf 0;
87  Cp 15;
88  }
89  density
90  {
91  rho 80;
92  }
93  }
94 
95  radiation
96  {
97  radiationModel opaqueSolid;
98  absorptionEmissionModel none;
99  scatterModel none;
100  }
101 
102  // Extrude model for new region
103 
104  extrudeModel linearNormal;
105  nLayers 50;
106  expansionRatio 1;
107  columnCells false; //3D or 1D
108  linearNormalCoeffs
109  {
110  thickness 0.02;
111  }
112 
113  }
114  \endverbatim
115 
116  Slave patch on primary region:
117  \verbatim
118  <slavePatchName>
119  {
120  type compressible::thermalBaffle;
121  kappa fluidThermo;
122  kappaName none;
123  value uniform 300;
124  \endverbatim
125 
126  Patches on baffle region:
127  \verbatim
128  bottom
129  {
130  type compressible::thermalBaffle;
131  kappa solidThermo;
132  kappaName none;
133  value uniform 300;
134  }
135 
136  top
137  {
138  type compressible::thermalBaffle;
139  kappa solidThermo;
140  kappaName none;
141  value uniform 300;
142  }
143  \endverbatim
144 
145 See also
146  Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
147  Foam::regionModels::thermalBaffleModels::thermalBaffleModel
148 
149 SourceFiles
150  thermalBaffleFvPatchScalarField.C
151 
152 \*---------------------------------------------------------------------------*/
153 
154 #ifndef thermalBaffleFvPatchScalarField_H
155 #define thermalBaffleFvPatchScalarField_H
156 
157 
158 #include "autoPtr.H"
159 #include "regionModel.H"
160 #include "thermalBaffleModel.H"
161 #include "extrudePatchMesh.H"
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 
167 namespace Foam
168 {
169 namespace compressible
170 {
171 
172 /*---------------------------------------------------------------------------*\
173  Class thermalBaffleFvPatchScalarField Declaration
174 \*---------------------------------------------------------------------------*/
177 :
179 {
180  // Private Data
181 
182  //- Enumeration of patch IDs
183  enum patchID
184  {
185  bottomPatchID,
186  topPatchID,
187  sidePatchID
188  };
189 
190  //- Is the baffle owner
191  bool owner_;
192 
193  //- Thermal baffle
195 
196  //- Dictionary
197  dictionary dict_;
198 
199  //- Auto pointer to extrapolated mesh from patch
200  autoPtr<extrudePatchMesh> extrudeMeshPtr_;
201 
202 
203  // Private Member Functions
204 
205  //- Extrude mesh
206  void createPatchMesh();
207 
208 public:
209 
210  //- Runtime type information
211  TypeName("compressible::thermalBaffle");
212 
213 
214  // Constructors
215 
216  //- Construct from patch and internal field
218  (
219  const fvPatch&,
221  );
222 
223  //- Construct from patch, internal field and dictionary
225  (
226  const fvPatch&,
228  const dictionary&
229  );
230 
231  //- Construct by mapping given
232  // thermalBaffleFvPatchScalarField onto a new patch
234  (
236  const fvPatch&,
238  const fvPatchFieldMapper&
239  );
240 
241 
242  //- Construct and return a clone
243  virtual tmp<fvPatchScalarField> clone() const
244  {
246  (
248  );
249  }
250 
251  //- Construct as copy setting internal field reference
253  (
256  );
257 
258  //- Construct and return a clone setting internal field reference
260  (
262  ) const
263  {
265  (
266  new thermalBaffleFvPatchScalarField(*this, iF)
267  );
268  }
269 
270 
271  // Member Functions
272 
273 
274  // Mapping functions
275 
276  //- Map (and resize as needed) from self given a mapping object
277  // Used to update fields following mesh topology change
278  virtual void autoMap(const fvPatchFieldMapper&);
279 
280  //- Reverse map the given fvPatchField onto this fvPatchField
281  // Used to reconstruct fields
282  virtual void rmap(const fvPatchScalarField&, const labelList&);
283 
284 
285  //- Update the coefficients associated with the patch field
286  virtual void updateCoeffs();
287 
288  //- Write
289  virtual void write(Ostream&) const;
290 };
291 
292 
293 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
294 
295 } // End namespace compressible
296 } // End namespace Foam
297 
298 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
299 
300 
301 #endif
302 
303 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
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:66
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
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
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
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:52
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:53
This boundary condition provides a coupled temperature condition between multiple mesh regions...
Namespace for OpenFOAM.