turbulentTemperatureRadCoupledMixedFvPatchScalarField.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  Copyright (C) 2017-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  turbulentTemperatureRadCoupledMixedFvPatchScalarField
30 
31 Description
32  Mixed boundary condition for temperature and radiation heat transfer
33  to be used for in multiregion cases. Optional thin thermal layer
34  resistances can be specified through thicknessLayers and kappaLayers
35  entries.
36 
37  The thermal conductivity \c kappa can either be retrieved from various
38  possible sources, as detailed in the class temperatureCoupledBase.
39 
40 Usage
41  \table
42  Property | Description | Required | Default value
43  Tnbr | name of the field | no | T
44  qrNbr | name of the radiative flux in the nbr region | no | none
45  qr | name of the radiative flux in this region | no | none
46  thicknessLayers | list of thicknesses per layer [m] | no |
47  kappaLayers | list of thermal conductivites per layer [W/m/K] | no |
48  thicknessLayer | single thickness of layer [m] | no |
49  kappaLayer | corresponding thermal conductivity [W/m/K] | no |
50  kappaMethod | inherited from temperatureCoupledBase | inherited |
51  kappa | inherited from temperatureCoupledBase | inherited |
52  thermalInertia | Add thermal inertia to wall node | no | false
53  \endtable
54 
55  Example of the boundary condition specification:
56  \verbatim
57  <patchName>
58  {
59  type compressible::turbulentTemperatureRadCoupledMixed;
60  Tnbr T;
61  qrNbr qr; // or none. Name of qr field on neighbour region
62  qr qr; // or none. Name of qr field on local region
63  thicknessLayers (0.1 0.2 0.3 0.4);
64  kappaLayers (1 2 3 4);
65  thermalInertia false/true;
66  kappaMethod lookup;
67  kappa kappa;
68  value uniform 300;
69  }
70  \endverbatim
71 
72  Needs to be on underlying mapped(Wall)FvPatch.
73 
74 See also
75  Foam::temperatureCoupledBase
76 
77 SourceFiles
78  turbulentTemperatureRadCoupledMixedFvPatchScalarField.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef turbulentTemperatureRadCoupledMixedFvPatchScalarField_H
83 #define turbulentTemperatureRadCoupledMixedFvPatchScalarField_H
84 
85 #include "mixedFvPatchFields.H"
86 #include "temperatureCoupledBase.H"
87 #include "scalarList.H"
88 #include "mappedPatchFieldBase.H"
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 namespace Foam
93 {
94 namespace compressible
95 {
96 
97 /*---------------------------------------------------------------------------*\
98  Class turbulentTemperatureRadCoupledMixedFvPatchScalarField Declaration
99 \*---------------------------------------------------------------------------*/
100 
101 class turbulentTemperatureRadCoupledMixedFvPatchScalarField
102 :
103  public mixedFvPatchScalarField,
104  public temperatureCoupledBase,
105  public mappedPatchFieldBase<scalar>
106 {
107 
108  // Private Data
109 
110  //- Name of field on the neighbour region
111  const word TnbrName_;
112 
113  //- Name of the radiative heat flux in the neighbour region
114  const word qrNbrName_;
115 
116  //- Name of the radiative heat flux in local region
117  const word qrName_;
118 
119  //- Thickness of layers (either scalarList or a single PatchFunction1)
120  scalarList thicknessLayers_;
121  autoPtr<PatchFunction1<scalar>> thicknessLayer_;
122 
123  //- Conductivity of layers
124  scalarList kappaLayers_;
125  autoPtr<PatchFunction1<scalar>> kappaLayer_;
126 
127  //- Thermal inertia term
128  Switch thermalInertia_;
129 
130 
131  // Private Functions
132 
133  //- Return local alphaSfDelta
134  tmp<scalarField> alphaSfDelta() const;
135 
136  //- Return delta enthalpy between regions
137  tmp<scalarField> deltaH() const;
138 
139  //- Return the sum of deltaCoeff*alpha from nbr and local
140  tmp<scalarField> beta() const;
141 
142 
143  //- Calculate coefficients for assembly matrix
144  tmp<Field<scalar>> coeffs
145  (
146  fvMatrix<scalar>& matrix,
147  const Field<scalar>&,
148  const label
149  ) const;
150 
151 
152 public:
153 
154  //- Runtime type information
155  TypeName("compressible::turbulentTemperatureRadCoupledMixed");
156 
157 
158  // Constructors
159 
160  //- Construct from patch and internal field
162  (
163  const fvPatch&,
165  );
166 
167  //- Construct from patch, internal field and dictionary
169  (
170  const fvPatch&,
172  const dictionary&
173  );
174 
175  //- Construct by mapping given
176  // turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a
177  // new patch
179  (
180  const
182  const fvPatch&,
184  const fvPatchFieldMapper&
185  );
186 
187  //- Construct as copy
189  (
191  );
192 
193  //- Construct and return a clone
194  virtual tmp<fvPatchScalarField> clone() const
195  {
197  (
199  (
200  *this
201  )
202  );
203  }
204 
205  //- Construct as copy setting internal field reference
207  (
210  );
211 
212  //- Construct and return a clone setting internal field reference
214  (
216  ) const
217  {
219  (
221  (
222  *this,
223  iF
224  )
225  );
226  }
227 
228 
229  // Member Functions
230 
231  // Mapping functions
232 
233  //- Map (and resize as needed) from self given a mapping object
234  virtual void autoMap
235  (
236  const fvPatchFieldMapper&
237  );
238 
239  //- Reverse map the given fvPatchField onto this fvPatchField
240  virtual void rmap
241  (
242  const fvPatchField<scalar>&,
243  const labelList&
244  );
245 
246 
247  //- Given patch temperature calculate corresponding K field. Override
248  //- temperatureCoupledBase::kappa to includes effect of any
249  //- explicit kappaThickness
250  virtual tmp<scalarField> kappa(const scalarField& Tp) const;
251 
252  //- Update the coefficients associated with the patch field
253  virtual void updateCoeffs();
254 
255  //- Manipulate matrix
256  virtual void manipulateMatrix
257  (
258  fvMatrix<scalar>& m,
259  const label iMatrix,
260  const direction cmpt
261  );
262 
263 
264  //- Write
265  virtual void write(Ostream& os) const;
266 };
267 
268 
269 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
270 
271 } // End namespace compressible
272 } // End namespace Foam
273 
274 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
275 
276 #endif
277 
278 // ************************************************************************* //
Foam::fvPatchField< scalar >
Foam::compressible::turbulentTemperatureRadCoupledMixedFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: turbulentTemperatureRadCoupledMixedFvPatchScalarField.H:247
Foam::scalarList
List< scalar > scalarList
A List of scalars.
Definition: scalarList.H:64
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:77
Foam::compressible::turbulentTemperatureRadCoupledMixedFvPatchScalarField::rmap
virtual void rmap(const fvPatchField< scalar > &, const labelList &)
Reverse map the given fvPatchField onto this fvPatchField.
Definition: turbulentTemperatureRadCoupledMixedFvPatchScalarField.C:301
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
Foam::compressible::turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: turbulentTemperatureRadCoupledMixedFvPatchScalarField.C:366
Foam::temperatureCoupledBase
Common functions used in temperature coupled boundaries.
Definition: temperatureCoupledBase.H:135
mappedPatchFieldBase.H
Foam::compressible::turbulentTemperatureRadCoupledMixedFvPatchScalarField::TypeName
TypeName("compressible::turbulentTemperatureRadCoupledMixed")
Runtime type information.
scalarList.H
Foam::compressible::turbulentTemperatureRadCoupledMixedFvPatchScalarField::manipulateMatrix
virtual void manipulateMatrix(fvMatrix< scalar > &m, const label iMatrix, const direction cmpt)
Manipulate matrix.
Definition: turbulentTemperatureRadCoupledMixedFvPatchScalarField.C:581
Foam::Field< scalar >
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::compressible::turbulentTemperatureRadCoupledMixedFvPatchScalarField::autoMap
virtual void autoMap(const fvPatchFieldMapper &)
Map (and resize as needed) from self given a mapping object.
Definition: turbulentTemperatureRadCoupledMixedFvPatchScalarField.C:285
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::compressible::turbulentTemperatureRadCoupledMixedFvPatchScalarField::write
virtual void write(Ostream &os) const
Write.
Definition: turbulentTemperatureRadCoupledMixedFvPatchScalarField.C:726
Foam::compressible::turbulentTemperatureRadCoupledMixedFvPatchScalarField::turbulentTemperatureRadCoupledMixedFvPatchScalarField
turbulentTemperatureRadCoupledMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: turbulentTemperatureRadCoupledMixedFvPatchScalarField.C:48
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
temperatureCoupledBase.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
mixedFvPatchFields.H
Foam::compressible::turbulentTemperatureRadCoupledMixedFvPatchScalarField::kappa
virtual tmp< scalarField > kappa(const scalarField &Tp) const
Definition: turbulentTemperatureRadCoupledMixedFvPatchScalarField.C:326
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::compressible::turbulentTemperatureRadCoupledMixedFvPatchScalarField
Mixed boundary condition for temperature and radiation heat transfer to be used for in multiregion ca...
Definition: turbulentTemperatureRadCoupledMixedFvPatchScalarField.H:154
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::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54