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 and return a clone
174  virtual tmp<fvPatchScalarField> clone() const
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
212 
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  (
222  const fvPatchField<scalar>&,
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;
231 
232  //- Update the coefficients associated with the patch field
233  virtual void updateCoeffs();
234 
235  //- Manipulate matrix
236  virtual void manipulateMatrix
237  (
238  fvMatrix<scalar>& m,
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 // ************************************************************************* //
Foam::fvPatchField< scalar >
Foam::scalarList
List< scalar > scalarList
A List of scalars.
Definition: scalarList.H:64
Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::manipulateMatrix
virtual void manipulateMatrix(fvMatrix< scalar > &m, const label iMatrix, const direction cmpt)
Manipulate matrix.
Definition: turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C:422
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
scalarField.H
Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
turbulentTemperatureCoupledBaffleMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C:46
Foam::temperatureCoupledBase
Common functions used in temperature coupled boundaries.
Definition: temperatureCoupledBase.H:135
mappedPatchFieldBase.H
Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C:315
Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::kappa
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Definition: turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C:275
Foam::Field< scalar >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
Mixed boundary condition for temperature, to be used for heat-transfer on back-to-back baffles....
Definition: turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H:140
Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write
virtual void write(Ostream &os) const
Write.
Definition: turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C:469
Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::rmap
virtual void rmap(const fvPatchField< scalar > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C:250
compressible
bool compressible
Definition: pEqn.H:2
Foam::mappedPatchFieldBase
Functionality for sampling fields using mappedPatchBase. Every call to mappedField() returns a sample...
Definition: mappedPatchFieldBase.H:105
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H:212
os
OBJstream os(runTime.globalPath()/outputName)
temperatureCoupledBase.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mixedFvPatchFields.H
Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C:234
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::List< scalar >
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::fvMatrix
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvPatchField.H:68
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::compressible::turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::TypeName
TypeName("compressible::turbulentTemperatureCoupledBaffleMixed")
Runtime type information.
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54