specularRadiationMixedFvPatchScalarField.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) 2023 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::radiation::specularRadiationMixedFvPatchScalarField
28 
29 Description
30  This boundary condition provides a specular radiation condition for
31  axisymmetric and symmetry-plane \c fvDOM computations.
32 
33  References:
34  \verbatim
35  Standard model (tag:KE):
36  Kumar, P., & Eswaran, V. (2013).
37  A methodology to solve 2D and axisymmetric radiative
38  transfer problems using a general 3D solver.
39  Journal of heat transfer, 135(12).
40  DOI:10.1115/1.4024674
41  \endverbatim
42 
43 Usage
44  Example of the boundary condition specification:
45  \verbatim
46  <patchName>
47  {
48  // Mandatory entries
49  type specularRadiation;
50 
51  // Optional entries
52  interpolate <bool>;
53 
54  // Inherited entries
55  patchType <word>;
56  ...
57  }
58  \endverbatim
59 
60  where the entries mean:
61  \table
62  Property | Description | Type | Reqd | Deflt
63  type | Type name: turbulentDigitalFilterInlet | word | yes | -
64  interpolate | Flag to enable ray-intensity interp | bool | no | false
65  \endtable
66 
67  The inherited entries are elaborated in:
68  - \link mixedFvPatchFields.H \endlink
69 
70 Note
71  - The condition is limited to the underlying \c wedge and \c symmetryPlane
72  conditions.
73 
74 SourceFiles
75  specularRadiationMixedFvPatchScalarField.C
76 
77 \*---------------------------------------------------------------------------*/
78 
79 #ifndef Foam_specularRadiationMixedFvPatchScalarField_H
80 #define Foam_specularRadiationMixedFvPatchScalarField_H
81 
82 #include "mixedFvPatchFields.H"
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 namespace Foam
87 {
88 namespace radiation
89 {
90 
91 /*---------------------------------------------------------------------------*\
92  Class specularRadiationMixedFvPatchScalarField Declaration
93 \*---------------------------------------------------------------------------*/
94 
95 class specularRadiationMixedFvPatchScalarField
96 :
97  public mixedFvPatchScalarField
98 {
99  // Private Data
100 
101  //- Patch normal vector
102  vector n_;
103 
104  //- Ray index of this ray
105  label rayID_;
106 
107  //- Band index of this ray
108  label lambdaID_;
109 
110  //- Flag to enable ray-intensity interpolation
111  const bool interpolate_;
112 
113 
114  // Private Member Functions
115 
116  //- Return the corresponding azimuth angle of a given Cartesian vector
117  scalar azimuthAngle(const vector& d) const;
118 
119  //- Return the corresponding polar angle of a given Cartesian vector
120  scalar polarAngle(const vector& d) const;
121 
122  //- Return interpolated ray intensity
123  tmp<scalarField> interpolateI
124  (
125  const fvDOM& dom,
126  const label closestRayID
127  ) const;
128 
129  //- Return the index of complementary ray
130  label calcComplementaryRayID(const fvDOM& dom) const;
131 
132 
133 public:
134 
135  //- Runtime type information
136  TypeName("specularRadiation");
137 
138 
139  // Constructors
140 
141  //- Construct from patch and internal field
143  (
144  const fvPatch&,
146  );
147 
148  //- Construct from patch, internal field and dictionary
150  (
151  const fvPatch&,
153  const dictionary&
154  );
155 
156  //- Construct by mapping given
157  //- specularRadiationMixedFvPatchScalarField onto a new patch
159  (
161  const fvPatch&,
163  const fvPatchFieldMapper&
164  );
165 
166  //- Construct as copy
168  (
170  );
171 
172  //- Construct and return a clone
173  virtual tmp<fvPatchField<scalar> > clone() const
174  {
175  return tmp<fvPatchField<scalar> >
176  (
178  );
179  }
180 
181  //- Construct as copy setting internal field reference
183  (
186  );
187 
188  //- Construct and return a clone setting internal field reference
190  (
192  ) const
193  {
194  return tmp<fvPatchField<scalar> >
195  (
197  );
198  }
199 
200 
201  // Member Functions
202 
203  //- Update the coefficients associated with the patch field
204  virtual void updateCoeffs();
205 
206  //- Write
207  virtual void write(Ostream&) const;
208 };
209 
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 } // End namespace radiation
214 } // End namespace Foam
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 
219 #endif
220 
221 // ************************************************************************* //
TypeName("specularRadiation")
Runtime type information.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual tmp< fvPatchField< scalar > > clone() const
Construct and return a clone.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
This boundary condition provides a specular radiation condition for axisymmetric and symmetry-plane f...
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
A FieldMapper for finite-volume patch fields.
Vector< scalar > vector
Definition: vector.H:57
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
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
specularRadiationMixedFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Finite Volume Discrete Ordinates Method. Solves the RTE equation for n directions in a participating ...
Definition: fvDOM.H:114
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
Namespace for OpenFOAM.