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