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-2020 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  qrNbr qr;//or none.Name of qr field on neighbourregion
53  qr none;// or none.Name of qr field on localregion
54  value uniform 300;
55 
56  // Baffle region name
57  regionName baffleRegion;
58 
59  // Solid thermo in solid region
60  thermoType
61  {
62  type heSolidThermo;
63  mixture pureMixture;
64  transport constIso;
65  thermo eConst;
66  equationOfState rhoConst;
67  specie specie;
68  energy sensibleInternalEnergy;
69  }
70 
71  mixture
72  {
73  specie
74  {
75  molWeight 20;
76  }
77  transport
78  {
79  kappa 0.01;
80  }
81  thermodynamics
82  {
83  Hf 0;
84  Cv 15;
85  }
86  density
87  {
88  rho 80;
89  }
90  }
91 
92  radiation
93  {
94  radiationModel opaqueSolid;
95  absorptionEmissionModel none;
96  scatterModel none;
97  }
98 
99  // Extrude model for new region
100 
101  extrudeModel linearNormal;
102  nLayers 50;
103  expansionRatio 1;
104  columnCells false; //3D or 1D
105  linearNormalCoeffs
106  {
107  thickness 0.02;
108  }
109 
110  }
111  \endverbatim
112 
113  Slave patch on primary region:
114  \verbatim
115  <slavePatchName>
116  {
117  type compressible::thermalBaffle;
118  value uniform 300;
119  \endverbatim
120 
121  Patches on baffle region:
122  \verbatim
123  bottom
124  {
125  type compressible::thermalBaffle;
126  value uniform 300;
127  }
128 
129  top
130  {
131  type compressible::thermalBaffle;
132  value uniform 300;
133  }
134  \endverbatim
135 
136 See also
137  Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
138  Foam::regionModels::thermalBaffleModels::thermalBaffleModel
139 
140 SourceFiles
141  thermalBaffleFvPatchScalarField.C
142 
143 \*---------------------------------------------------------------------------*/
144 
145 #ifndef thermalBaffleFvPatchScalarField_H
146 #define thermalBaffleFvPatchScalarField_H
147 
148 
149 #include "autoPtr.H"
150 #include "regionModel.H"
151 #include "thermalBaffleModel.H"
152 #include "extrudePatchMesh.H"
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 
158 namespace Foam
159 {
160 namespace compressible
161 {
162 
163 /*---------------------------------------------------------------------------*\
164  Class thermalBaffleFvPatchScalarField Declaration
165 \*---------------------------------------------------------------------------*/
168 :
170 {
171  // Private Data
172 
173  //- Enumeration of patch IDs
174  enum patchID
175  {
176  bottomPatchID,
177  topPatchID,
178  sidePatchID
179  };
180 
181  //- Is the baffle owner
182  bool owner_;
183 
184  //- Thermal baffle
186 
187  //- Dictionary
188  dictionary dict_;
189 
190  //- Auto pointer to extrapolated mesh from patch
191  autoPtr<extrudePatchMesh> extrudeMeshPtr_;
192 
193 
194  // Private Member Functions
195 
196  //- Extrude mesh
197  void createPatchMesh();
198 
199 public:
200 
201  //- Runtime type information
202  TypeName("compressible::thermalBaffle");
203 
204 
205  // Constructors
206 
207  //- Construct from patch and internal field
209  (
210  const fvPatch&,
212  );
213 
214  //- Construct from patch, internal field and dictionary
216  (
217  const fvPatch&,
219  const dictionary&
220  );
221 
222  //- Construct by mapping given
223  // thermalBaffleFvPatchScalarField onto a new patch
225  (
227  const fvPatch&,
229  const fvPatchFieldMapper&
230  );
231 
232  //- Construct as copy setting internal field reference
234  (
237  );
238 
239  //- Construct and return a clone setting internal field reference
241  (
243  ) const
244  {
246  (
247  new thermalBaffleFvPatchScalarField(*this, iF)
248  );
249  }
250 
251 
252  // Member Functions
253 
254 
255  // Mapping functions
256 
257  //- Map (and resize as needed) from self given a mapping object
258  // Used to update fields following mesh topology change
259  virtual void autoMap(const fvPatchFieldMapper&);
260 
261  //- Reverse map the given fvPatchField onto this fvPatchField
262  // Used to reconstruct fields
263  virtual void rmap(const fvPatchScalarField&, const labelList&);
264 
265 
266  //- Update the coefficients associated with the patch field
267  virtual void updateCoeffs();
268 
269  //- Write
270  virtual void write(Ostream&) const;
271 };
272 
273 
274 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
275 
276 } // End namespace compressible
277 } // End namespace Foam
278 
279 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
280 
281 
282 #endif
283 
284 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:62
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.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
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.