lookup.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 "lookup.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  namespace radiation
36  {
37  defineTypeNameAndDebug(lookup, 0);
39  (
41  lookup,
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  dict_(dict)
59 {}
60 
61 
62 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
63 
65 (
66  const label bandI,
67  vectorField* dir,
68  scalarField* T
69 ) const
70 {
72  (
73  pp_.size(),
74  dict_.get<scalar>("emissivity")
75  );
76 }
77 
78 
79 Foam::scalar Foam::radiation::lookup::e
80 (
81  const label faceI,
82  const label bandI,
83  const vector& dir,
84  const scalar T
85 ) const
86 {
87  return dict_.get<scalar>("emissivity");
88 }
89 
90 
93 (
94  const label bandI,
95  vectorField* dir,
96  scalarField* T
97 ) const
98 {
100  (
101  pp_.size(),
102  dict_.get<scalar>("absorptivity")
103  );
104 }
105 
106 
107 Foam::scalar Foam::radiation::lookup::a
108 (
109  const label faceI,
110  const label bandI,
111  const vector& dir,
112  const scalar T
113 ) const
114 {
115  return dict_.get<scalar>("absorptivity");
116 }
117 
118 
120 (
121  const label bandI,
122  vectorField* dir,
123  scalarField* T
124 ) const
125 {
126  return tmp<scalarField>::New
127  (
128  pp_.size(),
129  dict_.getOrDefault<scalar>("transmissivity", 0)
130  );
131 }
132 
133 
134 Foam::scalar Foam::radiation::lookup::t
135 (
136  const label faceI,
137  const label bandI,
138  const vector& dir,
139  const scalar T
140 ) const
141 {
142  return dict_.getOrDefault<scalar>("transmissivity", 0);
143 }
144 
145 
148 (
149  const label bandI,
150  vectorField* dir,
151  scalarField* T
152 ) const
153 {
154  return tmp<scalarField>::New(pp_.size(), Zero);
155 }
156 
157 
159 (
160  const label faceI,
161  const label bandI,
162  const vector& dir,
163  const scalar T
164 ) const
165 {
166  return Zero;
167 }
168 
169 
172 (
173  const label bandI,
174  vectorField* dir,
175  scalarField* T
176 ) const
177 {
178  return tmp<scalarField>::New(pp_.size(), Zero);
179 }
180 
181 
183 (
184  const label faceI,
185  const label bandI,
186  const vector& dir,
187  const scalar T
188 ) const
189 {
190  return Zero;
191 }
192 
193 
195 {
196  return true;
197 }
198 
199 
201 {
202  return 1;
203 }
204 
205 
206 // ************************************************************************* //
Foam::radiation::boundaryRadiationPropertiesPatch
Definition: boundaryRadiationPropertiesPatch.H:56
Foam::radiation::lookup::nBands
virtual label nBands() const
Number of bands.
Definition: lookup.C:200
Foam::radiation::lookup::rDiff
virtual tmp< scalarField > rDiff(const label bandI, vectorField *incomingDirection, scalarField *T) const
Return diffusive reflectivity on patch.
Definition: lookup.C:172
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::Field< vector >
Foam::radiation::lookup::e
virtual tmp< scalarField > e(const label bandI, vectorField *incomingDirection, scalarField *T) const
Return emissivity.
Definition: lookup.C:65
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::radiation::lookup::rSpec
virtual tmp< scalarField > rSpec(const label bandI, vectorField *incomingDirection, scalarField *T) const
Return specular reflectivity on patch.
Definition: lookup.C:148
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::radiation::lookup::isGrey
virtual bool isGrey() const
Is Grey.
Definition: lookup.C:194
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::lookup::a
virtual tmp< scalarField > a(const label bandI, vectorField *incomingDirection, scalarField *T) const
Return absorptivity on patch.
Definition: lookup.C:93
Foam::Vector< scalar >
boundaryRadiationPropertiesPatch
lookup.H
Foam::radiation::lookup::lookup
lookup(const dictionary &dict, const polyPatch &pp)
Construct from components.
Definition: lookup.C:51
Foam::radiation::lookup::t
virtual tmp< scalarField > t(const label bandI, vectorField *incomingDirection, scalarField *T) const
Return transmissivity on patch (default: 0)
Definition: lookup.C:120
Foam::radiation::addToRunTimeSelectionTable
addToRunTimeSelectionTable(absorptionEmissionModel, cloudAbsorptionEmission, dictionary)