opaqueReflective.C
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) 2018-2019 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 \*---------------------------------------------------------------------------*/
27 
28 #include "opaqueReflective.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  namespace radiation
36  {
37  defineTypeNameAndDebug(opaqueReflective, 0);
39  (
41  opaqueReflective,
42  dictionary
43  );
44  }
45 }
46 
47 
48 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
49 
51 (
52  const dictionary& dict,
53  const polyPatch& pp
54 )
55 :
57  pp_(pp),
58  fd_(dict.getOrDefault<scalar>("fd", 1))
59 {
60  const dictionary& absorptionDict =
61  dict.subDict("wallAbsorptionEmissionModel");
62 
63  absorptionEmission_.reset
64  (
65  wallAbsorptionEmissionModel::New(absorptionDict, pp).ptr()
66  );
67 }
68 
69 
70 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
71 
73 (
74  const label bandI,
75  vectorField* dir,
76  scalarField* T
77 ) const
78 {
79  return(absorptionEmission_->e(bandI, dir, T));
80 }
81 
82 
84 (
85  const label faceI,
86  const label bandI,
87  const vector& dir,
88  const scalar T
89 ) const
90 {
91  return(absorptionEmission_->e(faceI, bandI, dir, T));
92 }
93 
94 
97 (
98  const label bandI,
99  vectorField* dir,
100  scalarField* T
101 ) const
102 {
103  return(absorptionEmission_->a(bandI, dir, T));
104 }
105 
106 
108 (
109  const label faceI,
110  const label bandI,
111  const vector& dir,
112  const scalar T
113 ) const
114 {
115  return(absorptionEmission_->a(faceI, bandI, dir, T));
116 }
117 
118 
120 (
121  const label bandI,
122  vectorField* dir,
123  scalarField* T
124 ) const
125 {
126  return tmp<scalarField>::New(pp_.size(), Zero);
127 }
128 
129 
131 (
132  const label faceI,
133  const label bandI,
134  const vector& dir,
135  const scalar T
136 ) const
137 {
138  return Zero;
139 }
140 
141 
144 (
145  const label bandI,
146  vectorField* dir,
147  scalarField* T
148 ) const
149 {
150  return (1.0 - fd_)*(1.0 - a(bandI, dir, T));
151 }
152 
153 
155 (
156  const label faceI,
157  const label bandI,
158  const vector& dir,
159  const scalar T
160 ) const
161 {
162  return (1.0 - fd_)*(1.0 - a(faceI, bandI, dir, T));
163 }
164 
165 
168 (
169  const label bandI,
170  vectorField* dir,
171  scalarField* T
172 ) const
173 {
174  return fd_*(1.0 - a(bandI, dir, T));
175 }
176 
177 
179 (
180  const label faceI,
181  const label bandI,
182  const vector& dir,
183  const scalar T
184 ) const
185 {
186  return fd_*(1.0 - a(faceI, bandI, dir, T));
187 }
188 
189 
191 {
192  return absorptionEmission_->isGrey();
193 }
194 
195 
197 {
198  return absorptionEmission_->nBands();
199 }
200 
201 
202 // ************************************************************************* //
Foam::radiation::boundaryRadiationPropertiesPatch
Definition: boundaryRadiationPropertiesPatch.H:56
Foam::radiation::opaqueReflective::t
virtual tmp< scalarField > t(const label bandI, vectorField *incomingDirection, scalarField *T) const
Return transmissivity on patch.
Definition: opaqueReflective.C:120
Foam::radiation::opaqueReflective::opaqueReflective
opaqueReflective(const dictionary &dict, const polyPatch &pp)
Construct from components.
Definition: opaqueReflective.C:51
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::radiation::opaqueReflective::rDiff
virtual tmp< scalarField > rDiff(const label bandI, vectorField *incomingDirection, scalarField *T) const
Return diffusive reflectivity on patch.
Definition: opaqueReflective.C:168
Foam::radiation::opaqueReflective::nBands
virtual label nBands() const
Number of bands.
Definition: opaqueReflective.C:196
opaqueReflective.H
Foam::Field< vector >
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
radiation
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
T
const volScalarField & T
Definition: createFieldRefs.H:2
Foam::radiation::defineTypeNameAndDebug
defineTypeNameAndDebug(cloudAbsorptionEmission, 0)
Foam::New
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Definition: DimensionedFieldReuseFunctions.H:105
Foam::radiation::opaqueReflective::rSpec
virtual tmp< scalarField > rSpec(const label bandI, vectorField *incomingDirection, scalarField *T) const
Return specular reflectivity on patch.
Definition: opaqueReflective.C:144
Foam::radiation::opaqueReflective::isGrey
virtual bool isGrey() const
Is Grey.
Definition: opaqueReflective.C:190
Foam::Vector< scalar >
boundaryRadiationPropertiesPatch
Foam::radiation::opaqueReflective::e
virtual tmp< scalarField > e(const label bandI, vectorField *incomingDirection, scalarField *T) const
Return emissivity.
Definition: opaqueReflective.C:73
Foam::radiation::boundaryRadiationPropertiesPatch::absorptionEmission_
autoPtr< wallAbsorptionEmissionModel > absorptionEmission_
Absorption/emission model.
Definition: boundaryRadiationPropertiesPatch.H:83
Foam::radiation::opaqueReflective::a
virtual tmp< scalarField > a(const label bandI, vectorField *incomingDirection, scalarField *T) const
Return absorptivity on patch.
Definition: opaqueReflective.C:97
Foam::radiation::addToRunTimeSelectionTable
addToRunTimeSelectionTable(absorptionEmissionModel, cloudAbsorptionEmission, dictionary)