thermalBaffle1DFvPatchScalarField.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::thermalBaffle1DFvPatchScalarField
26 
27 Group
28  grpThermoBoundaryConditions
29 
30 Description
31  This BC solves a steady 1D thermal baffle.
32 
33  The solid properties are specify as dictionary. Optionaly radiative heat
34  flux (Qr) can be incorporated into the balance. Some under-relaxation might
35  be needed on Qr. Baffle and solid properties need to be specified on the
36  master side of the baffle.
37 
38 Usage
39  Example of the boundary condition specification using constant
40  solid thermo :
41 
42  \verbatim
43  <masterPatchName>
44  {
45  type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
46  samplePatch <slavePatchName>;
47 
48  thickness uniform 0.005; // thickness [m]
49  Qs uniform 100; // heat flux [W/m2]
50 
51  Qr none;
52  relaxation 1;
53 
54  // Solid thermo
55  specie
56  {
57  nMoles 1;
58  molWeight 20;
59  }
60  transport
61  {
62  kappa 1;
63  }
64  thermodynamics
65  {
66  Hf 0;
67  Cp 10;
68  }
69  equationOfState
70  {
71  rho 10;
72  }
73 
74  value uniform 300;
75  }
76 
77  <slavePatchName>
78  {
79  type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
80  samplePatch <masterPatchName>;
81 
82  Qr none;
83  relaxation 1;
84  }
85  \endverbatim
86 
87 SourceFiles
88  thermalBaffle1DFvPatchScalarField.C
89 
90 \*---------------------------------------------------------------------------*/
91 
92 #ifndef thermalBaffle1DFvPatchScalarField_H
93 #define thermalBaffle1DFvPatchScalarField_H
94 
95 #include "mixedFvPatchFields.H"
96 #include "autoPtr.H"
97 #include "mappedPatchBase.H"
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 namespace Foam
102 {
103 namespace compressible
104 {
105 
106 /*---------------------------------------------------------------------------*\
107  Class thermalBaffle1DFvPatchScalarField Declaration
108 \*---------------------------------------------------------------------------*/
109 
110 template<class solidType>
112 :
113  public mappedPatchBase,
114  public mixedFvPatchScalarField
115 {
116  // Private data
117 
118  //- Name of the temperature field
119  word TName_;
120 
121  //- Baffle is activated
122  bool baffleActivated_;
123 
124  //- Baffle thickness [m]
125  mutable scalarField thickness_;
126 
127  //- Superficial heat source [W/m2]
128  mutable scalarField Qs_;
129 
130  //- Solid dictionary
131  dictionary solidDict_;
132 
133  //- Solid thermo
134  mutable autoPtr<solidType> solidPtr_;
135 
136  //- Cache Qr for relaxation
137  scalarField QrPrevious_;
138 
139  //- Relaxation for Qr
140  scalar QrRelaxation_;
141 
142  //- Name of the radiative heat flux in local region
143  const word QrName_;
144 
145 
146  // Private members
147 
148  //- Return const solid thermo
149  const solidType& solid() const;
150 
151  //- Return Qs from master
152  tmp<scalarField> Qs() const;
153 
154  //- Return thickness from master
155  tmp<scalarField> baffleThickness() const;
156 
157  //- Is Owner
158  bool owner() const;
159 
160 
161 public:
162 
163  //- Runtime type information
164  TypeName("compressible::thermalBaffle1D");
165 
166 
167  // Constructors
168 
169  //- Construct from patch and internal field
171  (
172  const fvPatch&,
174  );
175 
176  //- Construct from patch, internal field and dictionary
178  (
179  const fvPatch&,
181  const dictionary&
182  );
183 
184  //- Construct by mapping given
185  // thermalBaffle1DFvPatchScalarField onto a new patch
187  (
189  const fvPatch&,
191  const fvPatchFieldMapper&
192  );
193 
194  //- Construct as copy
196  (
198  );
199 
200  //- Construct and return a clone
201  virtual tmp<fvPatchScalarField> clone() const
202  {
204  (
206  );
207  }
208 
209  //- Construct as copy setting internal field reference
211  (
214  );
215 
216  //- Construct and return a clone setting internal field reference
218  (
220  ) const
221  {
223  (
224  new thermalBaffle1DFvPatchScalarField(*this, iF)
225  );
226  }
227 
228 
229  // Member functions
230 
231  // Mapping functions
232 
233  //- Map (and resize as needed) from self given a mapping object
234  virtual void autoMap
235  (
236  const fvPatchFieldMapper&
237  );
238 
239  //- Reverse map the given fvPatchField onto this fvPatchField
240  virtual void rmap
241  (
242  const fvPatchScalarField&,
243  const labelList&
244  );
245 
246 
247  //- Update the coefficients associated with the patch field
248  virtual void updateCoeffs();
249 
250  //- Write
251  virtual void write(Ostream&) const;
252 };
253 
254 
255 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 
257 } // End namespace compressible
258 } // End namespace Foam
259 
260 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
261 
262 #ifdef NoRepository
264 #endif
265 
266 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
267 
268 #endif
269 
270 // ************************************************************************* //
thermalBaffle1DFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
TypeName("compressible::thermalBaffle1D")
Runtime type information.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A class for handling words, derived from string.
Definition: word.H:59
Foam::fvPatchFieldMapper.
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
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.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:54
Namespace for OpenFOAM.
bool compressible
Definition: pEqn.H:30