turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.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-2016 OpenFOAM Foundation
9 Copyright (C) 2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::compressible::
29 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
30
31Description
32 Mixed boundary condition for temperature, to be used for heat-transfer
33 on back-to-back baffles. Optional thin thermal layer resistances can be
34 specified through thicknessLayers and kappaLayers entries.
35
36 Specifies gradient and temperature such that the equations are the same
37 on both sides:
38 - refGradient = zero gradient
39 - refValue = neighbour value
40 - mixFraction = nbrKDelta / (nbrKDelta + myKDelta())
41
42 where KDelta is heat-transfer coefficient K * deltaCoeffs
43
44 The thermal conductivity \c kappa can either be retrieved from various
45 possible sources, as detailed in the class temperatureCoupledBase.
46
47Usage
48 \table
49 Property | Description | Required | Default value
50 Tnbr | name of the field | no | T
51 thicknessLayers | list of thicknesses per layer [m] | no |
52 kappaLayers | list of thermal conductivities per layer [W/m/K] | no |
53 thicknessLayer | single thickness of layer [m] | no |
54 kappaLayer | corresponding thermal conductivity [W/m/K] | no |
55 kappaMethod | inherited from temperatureCoupledBase | inherited |
56 kappa | inherited from temperatureCoupledBase | inherited |
57 \endtable
58
59 Example of the boundary condition specification:
60 \verbatim
61 <patchName>
62 {
63 type compressible::turbulentTemperatureCoupledBaffleMixed;
64 Tnbr T;
65 thicknessLayers (0.1 0.2 0.3 0.4);
66 kappaLayers (1 2 3 4);
67 kappaMethod lookup;
68 kappa kappa;
69 value uniform 300;
70 }
71 \endverbatim
72
73 Needs to be on underlying mapped(Wall)FvPatch.
74
75See also
76 Foam::temperatureCoupledBase
77
78SourceFiles
79 turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C
80
81\*---------------------------------------------------------------------------*/
82
83#ifndef turbulentTemperatureCoupledBaffleMixedFvPatchScalarField_H
84#define turbulentTemperatureCoupledBaffleMixedFvPatchScalarField_H
85
86#include "mixedFvPatchFields.H"
89#include "scalarField.H"
90
91// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92
93namespace Foam
94{
95namespace compressible
96{
97
98/*---------------------------------------------------------------------------*\
99 Class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField Declaration
100\*---------------------------------------------------------------------------*/
101
102class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
103:
104 public mixedFvPatchScalarField,
105 public temperatureCoupledBase,
106 public mappedPatchFieldBase<scalar>
107{
108 // Private data
109
110 //- Name of field on the neighbour region
111 const word TnbrName_;
112
113 //- Thickness of layers
114 scalarList thicknessLayers_;
115 autoPtr<PatchFunction1<scalar>> thicknessLayer_;
116
117 //- Conductivity of layers
118 scalarList kappaLayers_;
119 autoPtr<PatchFunction1<scalar>> kappaLayer_;
120
121
122 // Private member functions
123
124 //- Calculate coefficients for assembly matrix
125 tmp<Field<scalar>> coeffs
126 (
127 fvMatrix<scalar>& matrix,
128 const Field<scalar>&,
129 const label
130 ) const;
131
132
133public:
134
135 //- Runtime type information
136 TypeName("compressible::turbulentTemperatureCoupledBaffleMixed");
137
138
139 // Constructors
141 //- Construct from patch and internal field
143 (
144 const fvPatch&,
146 );
147
148 //- Construct from patch, internal field and dictionary
150 (
151 const fvPatch&,
153 const dictionary&
154 );
155
156 //- Construct by mapping given
157 // turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a
158 // new patch
160 (
162 const fvPatch&,
164 const fvPatchFieldMapper&
165 );
166
167 //- Construct as copy setting internal field reference
169 (
171 );
172
173 //- Construct and return a clone
175 {
177 (
179 (
180 *this
181 )
182 );
183 }
184
185 //- Construct as copy setting internal field reference
187 (
190 );
191
192 //- Construct and return a clone setting internal field reference
194 (
196 ) const
197 {
199 (
201 (
202 *this,
203 iF
204 )
205 );
206 }
207
208
209 // Member Functions
210
211 // Mapping functions
213 //- Map (and resize as needed) from self given a mapping object
214 virtual void autoMap
215 (
216 const fvPatchFieldMapper&
217 );
218
219 //- Reverse map the given fvPatchField onto this fvPatchField
220 virtual void rmap
221 (
223 const labelList&
224 );
225
226
227 //- Given patch temperature calculate corresponding K field. Override
228 //- temperatureCoupledBase::kappa to includes effect of any
229 //- explicit kappaThickness
230 virtual tmp<scalarField> kappa(const scalarField& Tp) const;
232 //- Update the coefficients associated with the patch field
233 virtual void updateCoeffs();
234
235 //- Manipulate matrix
236 virtual void manipulateMatrix
237 (
239 const label iMatrix,
240 const direction cmpt
241 );
242
243
244 //- Write
245 virtual void write(Ostream& os) const;
246};
247
248
249// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250
251} // End namespace compressible
252} // End namespace Foam
253
254// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
255
256#endif
257
258// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic templated field type.
Definition: Field.H:82
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Mixed boundary condition for temperature, to be used for heat-transfer on back-to-back baffles....
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
virtual void rmap(const fvPatchField< scalar > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
TypeName("compressible::turbulentTemperatureCoupledBaffleMixed")
Runtime type information.
virtual void manipulateMatrix(fvMatrix< scalar > &m, const label iMatrix, const direction cmpt)
Manipulate matrix.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:121
A FieldMapper for finite-volume patch fields.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:82
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
Common functions used in temperature coupled boundaries.
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
bool compressible
Definition: pEqn.H:2
Namespace for OpenFOAM.
List< scalar > scalarList
A List of scalars.
Definition: scalarList.H:64
uint8_t direction
Definition: direction.H:56
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73