greyDiffusiveRadiationMixedFvPatchScalarField.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) 2016-2022 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::radiation::greyDiffusiveRadiationMixedFvPatchScalarField
29 
30 Group
31  grpThermoBoundaryConditions
32 
33 Description
34  This boundary condition provides a grey-diffuse condition for radiation
35  intensity, \c I, for use with the finite-volume discrete-ordinates model
36  (fvDOM), in which the radiation temperature is retrieved from the
37  temperature field boundary condition.
38 
39  An external radiative heat flux can be added using \c qRadExt. If
40  \c qRadExtDir is specified, this ray closest to this direction is used.
41  Otherwise, the face normal is used as direction to set \c qRadExt.
42 
43 Usage
44  Example of the boundary condition specification:
45  \verbatim
46  <patchName>
47  {
48  // Mandatory entries
49  type greyDiffusiveRadiation;
50 
51  // Optional entries
52  T T;
53  qRadExt <scalar>;
54  qRadExtDir <vector>;
55 
56  // Inherited entries
57  ...
58  }
59  \endverbatim
60 
61  where the entries mean:
62  \table
63  Property | Description | Type | Reqd | Deflt
64  type | Type name: greyDiffusiveRadiation | word | yes | -
65  T | Name of temperature field | word | no | T
66  qRadExt | Radiative external flux | scalar | no | Zero
67  qRadExtDir | Radiative external flux direction | vector | no | Zero
68  \endtable
69 
70  The inherited entries are elaborated in:
71  - \link mixedFvPatchFields.H \endlink
72 
73 See also
74  - Foam::radiation::radiationModel
75  - Foam::radiation::fvDOM
76  - Foam::radiationCoupledBase
77  - Foam::mixedFvPatchField
78 
79 SourceFiles
80  greyDiffusiveRadiationMixedFvPatchScalarField.C
81 
82 \*---------------------------------------------------------------------------*/
83 
84 #ifndef radiation_greyDiffusiveRadiationMixedFvPatchScalarField_H
85 #define radiation_greyDiffusiveRadiationMixedFvPatchScalarField_H
86 
87 #include "mixedFvPatchFields.H"
88 
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90 
91 namespace Foam
92 {
93 namespace radiation
94 {
95 /*---------------------------------------------------------------------------*\
96  Class greyDiffusiveRadiationMixedFvPatchScalarField Declaration
97 \*---------------------------------------------------------------------------*/
98 
99 class greyDiffusiveRadiationMixedFvPatchScalarField
100 :
101  public mixedFvPatchScalarField
102 {
103  // Private Data
104 
105  //- Name of temperature field
106  word TName_;
107 
108  //- External radiative flux
109  scalar qRadExt_;
110 
111  //- External radiative flux direction
112  vector qRadExtDir_;
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("greyDiffusiveRadiation");
119 
120 
121  // Constructors
122 
123  //- Construct from patch and internal field
125  (
126  const fvPatch&,
128  );
129 
130  //- Construct from patch, internal field and dictionary
132  (
133  const fvPatch&,
135  const dictionary&
136  );
137 
138  //- Construct by mapping given a
139  //- greyDiffusiveRadiationMixedFvPatchScalarField onto a new patch
141  (
143  const fvPatch&,
145  const fvPatchFieldMapper&
146  );
147 
148  //- Construct as copy
150  (
152  );
153 
154  //- Construct and return a clone
155  virtual tmp<fvPatchScalarField> clone() const
156  {
158  (
160  );
161  }
162 
163  //- Construct as copy setting internal field reference
165  (
168  );
169 
170  //- Construct and return a clone setting internal field reference
172  (
174  ) const
175  {
177  (
179  );
180  }
181 
182 
183  // Member Functions
184 
185  // Access
186 
187  //- Return the temperature field name
188  const word& TName() const noexcept
189  {
190  return TName_;
191  }
192 
193  //- Return reference to the temperature field name to allow
194  //- adjustment
195  word& TName() noexcept
196  {
197  return TName_;
198  }
199 
200 
201  // Evaluation
202 
203  //- Update the coefficients associated with the patch field
204  virtual void updateCoeffs();
205 
206 
207  // I-O
208 
209  //- Write
210  virtual void write(Ostream&) const;
211 };
212 
213 
214 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 
216 } // End namespace Foam
217 }
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #endif
222 
223 // ************************************************************************* //
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
const word & TName() const noexcept
Return the temperature field name.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
This boundary condition provides a grey-diffuse condition for radiation intensity, I, for use with the finite-volume discrete-ordinates model (fvDOM), in which the radiation temperature is retrieved from the temperature field boundary condition.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
A class for handling words, derived from Foam::string.
Definition: word.H:63
A FieldMapper for finite-volume patch fields.
Vector< scalar > vector
Definition: vector.H:57
greyDiffusiveRadiationMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
const direction noexcept
Definition: Scalar.H:258
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
A class for managing temporary objects.
Definition: HashPtrTable.H:50
TypeName("greyDiffusiveRadiation")
Runtime type information.
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
Namespace for OpenFOAM.