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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::compressible::
29  turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
30 
31 Description
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 
47 Usage
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 
75 See also
76  Foam::temperatureCoupledBase
77 
78 SourceFiles
79  turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C
80 
81 \*---------------------------------------------------------------------------*/
82 
83 #ifndef turbulentTemperatureCoupledBaffleMixedFvPatchScalarField_H
84 #define turbulentTemperatureCoupledBaffleMixedFvPatchScalarField_H
85 
86 #include "mixedFvPatchFields.H"
87 #include "temperatureCoupledBase.H"
88 #include "mappedPatchFieldBase.H"
89 #include "scalarField.H"
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 namespace Foam
94 {
95 namespace compressible
96 {
97 
98 /*---------------------------------------------------------------------------*\
99  Class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField Declaration
100 \*---------------------------------------------------------------------------*/
101 
102 class 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 
133 public:
134 
135  //- Runtime type information
136  TypeName("compressible::turbulentTemperatureCoupledBaffleMixed");
137 
138 
139  // Constructors
140 
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 as copy setting internal field reference
175  (
178  );
179 
180  //- Return a clone
181  virtual tmp<fvPatchField<scalar>> clone() const
182  {
183  return fvPatchField<scalar>::Clone(*this);
184  }
185 
186  //- Clone with an internal field reference
188  (
190  ) const
191  {
192  return fvPatchField<scalar>::Clone(*this, iF);
193  }
194 
195 
196  // Member Functions
197 
198  // Mapping functions
199 
200  //- Map (and resize as needed) from self given a mapping object
201  virtual void autoMap
202  (
203  const fvPatchFieldMapper&
204  );
205 
206  //- Reverse map the given fvPatchField onto this fvPatchField
207  virtual void rmap
208  (
209  const fvPatchField<scalar>&,
210  const labelList&
211  );
212 
213 
214  //- Given patch temperature calculate corresponding K field. Override
215  //- temperatureCoupledBase::kappa to includes effect of any
216  //- explicit kappaThickness
217  virtual tmp<scalarField> kappa(const scalarField& Tp) const;
218 
219  //- Update the coefficients associated with the patch field
220  virtual void updateCoeffs();
221 
222  //- Manipulate matrix
223  virtual void manipulateMatrix
224  (
225  fvMatrix<scalar>& m,
226  const label iMatrix,
227  const direction cmpt
228  );
229 
230 
231  //- Write
232  virtual void write(Ostream& os) const;
233 };
234 
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 } // End namespace compressible
239 } // End namespace Foam
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 #endif
244 
245 // ************************************************************************* //
List< scalar > scalarList
List of scalar.
Definition: scalarList.H:32
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Mixed boundary condition for temperature, to be used for heat-transfer on back-to-back baffles...
uint8_t direction
Definition: direction.H:46
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
static tmp< fvPatchField< Type > > Clone(const DerivedPatchField &pf, Args &&... args)
Clone a patch field, optionally with internal field reference etc.
Definition: fvPatchField.H:597
A FieldMapper for finite-volume patch fields.
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
bool compressible
Definition: pEqn.H:2
OBJstream os(runTime.globalPath()/outputName)
TypeName("compressible::turbulentTemperatureCoupledBaffleMixed")
Runtime type information.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void rmap(const fvPatchField< scalar > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Given patch temperature calculate corresponding K field. Override temperatureCoupledBase::kappa to in...
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.
virtual void manipulateMatrix(fvMatrix< scalar > &m, const label iMatrix, const direction cmpt)
Manipulate matrix.