coupledTemperatureFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::coupledTemperatureFvPatchScalarField
26 
27 Description
28  Mixed boundary condition for temperature, to be used for heat-transfer
29  with another region in a CHT case. Optional thin wall material layer
30  resistances can be specified through thicknessLayers and kappaLayers
31  entries.
32 
33  Specifies gradient and temperature such that the equations are the same
34  on both sides:
35  - refGradient = qs_/kappa
36  - refValue = neighbour value
37  - valueFraction = kappaByDeltaNbr/(kappaByDeltaNbr + kappaByDelta)
38 
39  where kappaByDelta is heat-transfer coefficient kappa*deltaCoeffs
40  and qs is the optional source heat flux.
41 
42 Usage
43  \table
44  Property | Description | Required | Default value
45  Tnbr | name of the field | no | T
46  thicknessLayers | list of thicknesses per layer [m] | no |
47  kappaLayers | list of thermal conductivities per layer [W/m/K] | no |
48  qs | Optional source heat flux [W/m^2] | no | 0
49  Qs | Optional heat source [W] | no | 0
50  qrNbr | name of the radiative flux in the nbr region | no | none
51  qr | name of the radiative flux in this region | no | none
52  \endtable
53 
54  Example of the boundary condition specification:
55  \verbatim
56  <patchName>
57  {
58  type coupledTemperature;
59  thicknessLayers (0.1 0.2 0.3 0.4); // Optional wall layer thicknesses
60  kappaLayers (1 2 3 4); // Optional wall layer conductivities
61  qs uniform 100; // Optional source heat flux [W/m^2]
62  value uniform 300;
63  }
64  \endverbatim
65 
66  Needs to be on underlying mapped(Wall)FvPatch.
67 
68  The patch thermal conductivity \c kappa is obtained from the region
69  thermophysicalTransportModel so that this boundary condition can be applied
70  directly to either fluid or solid regions.
71 
72  Note that in order to provide an optional heat source either qs or Qs
73  should be specified, not both.
74 
75 SourceFiles
76  coupledTemperatureFvPatchScalarField.C
77 
78 \*---------------------------------------------------------------------------*/
79 
80 #ifndef coupledTemperatureFvPatchScalarField_H
81 #define coupledTemperatureFvPatchScalarField_H
82 
83 #include "mixedFvPatchFields.H"
84 #include "scalarField.H"
85 
86 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
87 
88 namespace Foam
89 {
90 
91 /*---------------------------------------------------------------------------*\
92  Class coupledTemperatureFvPatchScalarField Declaration
93 \*---------------------------------------------------------------------------*/
94 
95 class coupledTemperatureFvPatchScalarField
96 :
97  public mixedFvPatchScalarField
98 {
99  // Private Data
100 
101  //- Name of field on the neighbour region
102  const word TnbrName_;
103 
104  //- Name of the radiative heat flux in the neighbor region
105  const word qrNbrName_;
106 
107  //- Name of the radiative heat flux in local region
108  const word qrName_;
109 
110  //- Thickness of wall layers
111  scalarList thicknessLayers_;
112 
113  //- Conductivity of wall layers
114  scalarList kappaLayers_;
115 
116  //- Optional source heat flux [W/m^2]
117  autoPtr<scalarField> qs_;
118 
119  //- Optional heat source [W]
120  scalar Qs_;
121 
122  //- Optional wall material conductivity/thickness
123  scalar wallKappaByDelta_;
124 
125 
126 protected:
127 
128  //- Get the patch kappa, kappa*Tc/delta and kappa/delta and also the
129  // heat-flux obtained from the sum heat-flux provided
130  virtual void getThis
131  (
132  tmp<scalarField>& kappa,
133  tmp<scalarField>& sumKappaTByDelta,
134  tmp<scalarField>& sumKappaByDelta,
135  scalarField& qTot,
136  tmp<scalarField>& qByKappa
137  ) const;
138 
139  //- Get the neighbour patch kappa*Tc/delta and kappa/delta
140  // and the heat-flux correction
141  virtual void getNbr
142  (
143  tmp<scalarField>& sumKappaTByDeltaNbr,
144  tmp<scalarField>& sumKappaByDeltaNbr,
145  tmp<scalarField>& qNbr
146  ) const;
147 
148  //- Get the neighbour patch wall temperature and heat-flux
149  // when wall thermal resistance is specified
150  virtual void getNbr
151  (
152  tmp<scalarField>& TwNbr,
153  tmp<scalarField>& qNbr
154  ) const;
155 
156  //- Add field to result which may have not been previously set
157  void add
158  (
159  tmp<scalarField>& result,
160  const tmp<scalarField>& field
161  ) const;
162 
163 
164 public:
165 
166  //- Runtime type information
167  TypeName("coupledTemperature");
168 
169 
170  // Constructors
171 
172  //- Construct from patch, internal field and dictionary
174  (
175  const fvPatch&,
177  const dictionary&
178  );
179 
180  //- Construct by mapping given
181  // coupledTemperatureFvPatchScalarField onto a
182  // new patch
184  (
186  const fvPatch&,
188  const fvPatchFieldMapper&
189  );
190 
191  //- Construct as copy setting internal field reference
193  (
196  );
197 
198  //- Construct and return a clone setting internal field reference
200  (
202  ) const
203  {
205  (
207  (
208  *this,
209  iF
210  )
211  );
212  }
213 
214 
215  // Member Functions
216 
217  //- Update the coefficients associated with the patch field
218  virtual void updateCoeffs();
219 
220  //- Write
221  virtual void write(Ostream&) const;
222 };
223 
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 } // End namespace Foam
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 #endif
232 
233 // ************************************************************************* //
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:57
Mixed boundary condition for temperature, to be used for heat-transfer with another region in a CHT c...
virtual void getThis(tmp< scalarField > &kappa, tmp< scalarField > &sumKappaTByDelta, tmp< scalarField > &sumKappaByDelta, scalarField &qTot, tmp< scalarField > &qByKappa) const
Get the patch kappa, kappa*Tc/delta and kappa/delta and also the.
virtual void getNbr(tmp< scalarField > &sumKappaTByDeltaNbr, tmp< scalarField > &sumKappaByDeltaNbr, tmp< scalarField > &qNbr) const
Get the neighbour patch kappa*Tc/delta and kappa/delta.
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
TypeName("coupledTemperature")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
coupledTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
void add(tmp< scalarField > &result, const tmp< scalarField > &field) const
Add field to result which may have not been previously set.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Foam::fvPatchFieldMapper.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
A class for managing temporary objects.
Definition: tmp.H:55
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Namespace for OpenFOAM.
List< scalar > scalarList
A List of scalars.
Definition: scalarList.H:50