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  // Protected Member Functions
129 
130  //- Get the patch kappa, kappa*Tc/delta and kappa/delta and also the
131  // heat-flux obtained from the sum heat-flux provided
132  virtual void getThis
133  (
135  tmp<scalarField>& sumKappaTByDelta,
136  tmp<scalarField>& sumKappaByDelta,
137  scalarField& qTot,
138  tmp<scalarField>& qByKappa
139  ) const;
140 
141  //- Get the neighbour patch kappa*Tc/delta and kappa/delta
142  // and the heat-flux correction
143  virtual void getNbr
144  (
145  tmp<scalarField>& sumKappaTByDeltaNbr,
146  tmp<scalarField>& sumKappaByDeltaNbr,
147  tmp<scalarField>& qNbr
148  ) const;
149 
150  //- Get the neighbour patch wall temperature and heat-flux
151  // when wall thermal resistance is specified
152  virtual void getNbr
153  (
154  tmp<scalarField>& TwNbr,
155  tmp<scalarField>& qNbr
156  ) const;
157 
158  //- Add field to result which may have not been previously set
159  void add
160  (
161  tmp<scalarField>& result,
162  const tmp<scalarField>& field
163  ) const;
164 
165 
166 public:
167 
168  //- Runtime type information
169  TypeName("coupledTemperature");
170 
171 
172  // Constructors
173 
174  //- Construct from patch, internal field and dictionary
176  (
177  const fvPatch&,
179  const dictionary&
180  );
181 
182  //- Construct by mapping given
183  // coupledTemperatureFvPatchScalarField onto a
184  // new patch
186  (
188  const fvPatch&,
190  const fieldMapper&
191  );
192 
193  //- Construct as copy setting internal field reference
195  (
198  );
199 
200  //- Construct and return a clone setting internal field reference
202  (
204  ) const
205  {
207  (
209  (
210  *this,
211  iF
212  )
213  );
214  }
215 
216 
217  // Member Functions
218 
219  // Mapping functions
220 
221  //- Map the given fvPatchField onto this fvPatchField
222  void map
223  (
225  const fieldMapper&
226  );
227 
228  //- Map the given fvPatchField onto this fvPatchField
229  virtual void map(const fvPatchScalarField&, const fieldMapper&);
230 
231  //- Reset the fvPatchField to the given fvPatchField
232  // Used for mesh to mesh mapping
233  virtual void reset(const fvPatchScalarField&);
234 
235 
236  // Evaluation functions
237 
238  //- Update the coefficients associated with the patch field
239  virtual void updateCoeffs();
240 
241 
242  // I-O
243 
244  //- Write
245  virtual void write(Ostream&) const;
246 };
247 
248 
249 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250 
251 } // End namespace Foam
252 
253 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254 
255 #endif
256 
257 // ************************************************************************* //
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 reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
void map(const coupledTemperatureFvPatchScalarField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
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:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:88
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