Loading...
Searching...
No Matches
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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::compressible::thermalBaffle1DFvPatchScalarField
28
29Group
30 grpThermoBoundaryConditions
31
32Description
33 This BC solves a steady 1D thermal baffle.
34
35 The solid properties are specify as dictionary. Optionally radiative heat
36 flux (qr) can be incorporated into the balance. Some under-relaxation might
37 be needed on qr. Baffle and solid properties need to be specified on the
38 master side of the baffle.
39
40Usage
41 Example of the boundary condition specification using constant
42 solid thermo :
43
44 \verbatim
45 <masterPatchName>
46 {
47 type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
48 samplePatch <slavePatchName>;
49
50 thickness uniform 0.005; // thickness [m]
51 qs uniform 100; // heat flux [W/m2]
52
53 qr none;
54 relaxation 1;
55
56 // Solid thermo
57 specie
58 {
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 <slavePatchName>
79 {
80 type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
81 samplePatch <masterPatchName>;
82
83 qr none;
84 relaxation 1;
85 }
86 \endverbatim
87
88SourceFiles
89 thermalBaffle1DFvPatchScalarField.C
90
91\*---------------------------------------------------------------------------*/
92
93#ifndef thermalBaffle1DFvPatchScalarField_H
94#define thermalBaffle1DFvPatchScalarField_H
95
96#include "mixedFvPatchFields.H"
97#include "autoPtr.H"
98#include "mappedPatchBase.H"
99
100// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101
102namespace Foam
103{
104namespace compressible
105{
106
107/*---------------------------------------------------------------------------*\
108 Class thermalBaffle1DFvPatchScalarField Declaration
109\*---------------------------------------------------------------------------*/
110
111template<class solidType>
113:
114 public mappedPatchBase,
115 public mixedFvPatchScalarField
116{
117 // Private data
118
119 //- Name of the temperature field
120 word TName_;
121
122 //- Baffle is activated
123 bool baffleActivated_;
124
125 //- Baffle thickness [m]
126 mutable scalarField thickness_;
127
128 //- Superficial heat source [W/m2]
129 mutable scalarField qs_;
130
131 //- Solid dictionary
132 dictionary solidDict_;
133
134 //- Solid thermo
135 mutable autoPtr<solidType> solidPtr_;
136
137 //- Cache qr for relaxation
138 scalarField qrPrevious_;
139
140 //- Relaxation for qr
141 scalar qrRelaxation_;
142
143 //- Name of the radiative heat flux in local region
144 const word qrName_;
145
146
147 // Private members
148
149 //- Return const solid thermo
150 const solidType& solid() const;
151
152 //- Return qs from master
153 tmp<scalarField> qs() const;
154
155 //- Return thickness from master
156 tmp<scalarField> baffleThickness() const;
157
158 //- Is Owner
159 bool owner() const;
160
161
162public:
163
164 //- Runtime type information
165 TypeName("compressible::thermalBaffle1D");
166
167
168 // Constructors
169
170 //- Construct from patch and internal field
172 (
173 const fvPatch&,
175 );
176
177 //- Construct from patch, internal field and dictionary
179 (
180 const fvPatch&,
182 const dictionary&
183 );
184
185 //- Construct by mapping given
186 // thermalBaffle1DFvPatchScalarField onto a new patch
190 const fvPatch&,
192 const fvPatchFieldMapper&
193 );
194
195 //- Construct as copy
197 (
199 );
200
201 //- Construct as copy setting internal field reference
203 (
206 );
207
208 //- Return a clone
209 virtual tmp<fvPatchField<scalar>> clone() const
210 {
211 return fvPatchField<scalar>::Clone(*this);
212 }
213
214 //- Clone with an internal field reference
216 (
218 ) const
219 {
220 return fvPatchField<scalar>::Clone(*this, iF);
221 }
222
223
224 // Member functions
225
226 // Mapping functions
227
228 //- Map (and resize as needed) from self given a mapping object
229 virtual void autoMap
230 (
231 const fvPatchFieldMapper&
232 );
233
234 //- Reverse map the given fvPatchField onto this fvPatchField
235 virtual void rmap
237 const fvPatchScalarField&,
238 const labelList&
239 );
240
241
242 //- Update the coefficients associated with the patch field
243 virtual void updateCoeffs();
244
245 //- Write
246 virtual void write(Ostream&) const;
247};
248
249
250// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
251
252} // End namespace compressible
253} // End namespace Foam
254
255// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256
257#ifdef NoRepository
259#endif
260
261// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
262
263#endif
264
265// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
TypeName("compressible::thermalBaffle1D")
Runtime type information.
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< fvPatchField< scalar > > clone(const DimensionedField< scalar, volMesh > &iF) const
Clone with an internal field reference.
virtual tmp< fvPatchField< scalar > > clone() const
Return a clone.
thermalBaffle1DFvPatchScalarField(const thermalBaffle1DFvPatchScalarField &, const DimensionedField< scalar, volMesh > &)
Construct as copy setting internal field reference.
virtual void rmap(const fvPatchScalarField &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
thermalBaffle1DFvPatchScalarField(const thermalBaffle1DFvPatchScalarField &)
Construct as copy.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
thermalBaffle1DFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
thermalBaffle1DFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
thermalBaffle1DFvPatchScalarField(const thermalBaffle1DFvPatchScalarField &, const fvPatch &, const DimensionedField< scalar, volMesh > &, const fvPatchFieldMapper &)
Construct by mapping given.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A FieldMapper for finite-volume patch fields.
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
bool owner() const
Is it owner.
mappedPatchBase(const polyPatch &)
Construct from patch.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition List.H:62
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
fvPatchField< scalar > fvPatchScalarField
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68