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-2026 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  h | Heat transfer coefficient of insulation layer [W/m^2/K] | no |
47  qs | Optional source heat flux [W/m^2] | no | 0
48  Qs | Optional heat source [W] | no | 0
49  qrNbr | name of the radiative flux in the nbr region | no | none
50  qr | name of the radiative flux in this region | no | none
51  qrRelaxation | Relaxation factor for radiative field | no | 1
52  \endtable
53 
54  Example of the boundary condition specification:
55  \verbatim
56  <patchName>
57  {
58  type coupledTemperature;
59  value uniform 300;
60  }
61  \endverbatim
62 
63  Needs to be on underlying mapped(Wall)FvPatch.
64 
65  The patch thermal conductivity \c kappa is obtained from the region
66  thermophysicalTransportModel so that this boundary condition can be applied
67  directly to either fluid or solid regions.
68 
69  Note that in order to provide an optional heat source either qs or Qs
70  should be specified, not both.
71 
72 SourceFiles
73  coupledTemperatureFvPatchScalarField.C
74 
75 \*---------------------------------------------------------------------------*/
76 
77 #ifndef coupledTemperatureFvPatchScalarField_H
78 #define coupledTemperatureFvPatchScalarField_H
79 
80 #include "mixedFvPatchFields.H"
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class coupledTemperatureFvPatchScalarField Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class coupledTemperatureFvPatchScalarField
93 :
94  public mixedFvPatchScalarField
95 {
96  // Private Data
97 
98  //- Name of field on the neighbour region
99  const word TnbrName_;
100 
101  //- Name of the radiative heat flux in the neighbor region
102  const word qrNbrName_;
103 
104  //- Name of the radiative heat flux in local region
105  const word qrName_;
106 
107  //- Relaxation factor for qr
108  scalar qrRelax_;
109 
110  //- Cache qr for relaxation
111  mutable scalarField qrPrevious_;
112 
113  //- Optional heat transfer coefficient of insulation layer [W/m^2K]
114  autoPtr<FunctionalDimensionedField<scalar, fvPatch>> h_;
115 
116  //- Optional source heat flux [W/m^2]
117  autoPtr<scalarField> qs_;
118 
119  //- Optional heat source [W]
120  scalar Qs_;
121 
122 
123 protected:
124 
125  // Protected Member Functions
126 
127  //- Get the patch kappa, kappa*Tc/delta and kappa/delta and also the
128  // heat-flux obtained from the sum heat-flux provided
129  virtual void getThis
130  (
132  tmp<scalarField>& sumKappaTByDelta,
133  tmp<scalarField>& sumKappaByDelta,
134  scalarField& qTot,
135  tmp<scalarField>& qByKappa
136  ) const;
137 
138  //- Get the neighbour patch kappa*Tc/delta and kappa/delta
139  // and the heat-flux correction
140  virtual void getNbr
141  (
142  tmp<scalarField>& sumKappaTByDeltaNbr,
143  tmp<scalarField>& sumKappaByDeltaNbr,
144  tmp<scalarField>& qNbr
145  ) const;
146 
147  //- Add field to result which may have not been previously set
148  void add
149  (
150  tmp<scalarField>& result,
151  const tmp<scalarField>& field
152  ) const;
153 
154 
155 public:
156 
157  //- Runtime type information
158  TypeName("coupledTemperature");
159 
160 
161  // Constructors
162 
163  //- Construct from patch, internal field and dictionary
165  (
166  const fvPatch&,
168  const dictionary&
169  );
170 
171  //- Construct by mapping given
172  // coupledTemperatureFvPatchScalarField onto a
173  // new patch
175  (
177  const fvPatch&,
179  const fieldMapper&
180  );
181 
182  //- Construct as copy setting internal field reference
184  (
187  );
188 
189  //- Construct and return a clone setting internal field reference
191  (
193  ) const;
194 
195 
196  //- Destructor
198 
199 
200  // Member Functions
201 
202  // Mapping functions
203 
204  //- Map the given fvPatchField onto this fvPatchField
205  void map
206  (
208  const fieldMapper&
209  );
210 
211  //- Map the given fvPatchField onto this fvPatchField
212  virtual void map(const fvPatchScalarField&, const fieldMapper&);
213 
214  //- Reset the fvPatchField to the given fvPatchField
215  // Used for mesh to mesh mapping
216  virtual void reset(const fvPatchScalarField&);
217 
218 
219  // Evaluation functions
220 
221  //- Update the coefficients associated with the patch field
222  virtual void updateCoeffs();
223 
224 
225  // I-O
226 
227  //- Write
228  virtual void write(Ostream&) const;
229 
230 
231  // Member Operators
232 
233  //- Inherit assignment
234  using mixedFvPatchScalarField::operator=;
235 };
236 
237 
238 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
239 
240 } // End namespace Foam
241 
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 
244 #endif
245 
246 // ************************************************************************* //
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 tmp< fvPatchScalarField > clone(const DimensionedField< scalar, fvMesh > &iF) const
Construct and return a clone setting internal field reference.
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.
TypeName("coupledTemperature")
Runtime type information.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
void add(tmp< scalarField > &result, const tmp< scalarField > &field) const
Add field to result which may have not been previously set.
coupledTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, fvMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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:90
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:58
A class for managing temporary objects.
Definition: tmp.H:55
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.