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  (
40  boundaryRadiationPropertiesPatch,
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  const vectorField* dir,
68  const 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 
92 (
93  const label bandI,
94  const vectorField* dir,
95  const scalarField* T
96 ) const
97 {
99  (
100  pp_.size(),
101  dict_.get<scalar>("absorptivity")
102  );
103 }
104 
105 
106 Foam::scalar Foam::radiation::lookup::a
107 (
108  const label faceI,
109  const label bandI,
110  const vector& dir,
111  const scalar T
112 ) const
113 {
114  return dict_.get<scalar>("absorptivity");
115 }
116 
117 
119 (
120  const label bandI,
121  const vectorField* dir,
122  const scalarField* T
123 ) const
124 {
125  return tmp<scalarField>::New
126  (
127  pp_.size(),
128  dict_.getOrDefault<scalar>("transmissivity", 0)
129  );
130 }
131 
132 
133 Foam::scalar Foam::radiation::lookup::t
134 (
135  const label faceI,
136  const label bandI,
137  const vector& dir,
138  const scalar T
139 ) const
140 {
141  return dict_.getOrDefault<scalar>("transmissivity", 0);
142 }
143 
144 
146 (
147  const label bandI,
148  const vectorField* dir,
149  const scalarField* T
150 ) const
151 {
152  return tmp<scalarField>::New(pp_.size(), Zero);
153 }
154 
155 
157 (
158  const label faceI,
159  const label bandI,
160  const vector& dir,
161  const scalar T
162 ) const
163 {
164  return Zero;
165 }
166 
167 
169 (
170  const label bandI,
171  const vectorField* dir,
172  const scalarField* T
173 ) const
174 {
175  return tmp<scalarField>::New(pp_.size(), Zero);
176 }
177 
178 
180 (
181  const label faceI,
182  const label bandI,
183  const vector& dir,
184  const scalar T
185 ) const
186 {
187  return Zero;
188 }
189 
192 {
193  return true;
194 }
195 
196 
197 Foam::label Foam::radiation::lookup::nBands() const
198 {
199  return 1;
200 }
201 
202 
203 // ************************************************************************* //
const dictionary dict_
Dictionary.
Definition: lookup.H:73
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual bool isGrey() const
Is Grey.
Definition: lookup.C:184
lookup(const dictionary &dict, const polyPatch &pp)
Construct from components.
Definition: lookup.C:44
defineTypeNameAndDebug(cloudAbsorptionEmission, 0)
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
Macros for easy insertion into run-time selection tables.
virtual tmp< scalarField > rDiff(const label bandI, const vectorField *incomingDirection, const scalarField *T) const
Return diffusive reflectivity on patch.
Definition: lookup.C:162
const polyPatch & pp_
Reference to the polyPatch.
Definition: lookup.H:68
virtual tmp< scalarField > a(const label bandI, const vectorField *incomingDirection, const scalarField *T) const
Return absorptivity on patch.
Definition: lookup.C:85
virtual tmp< scalarField > t(const label bandI, const vectorField *incomingDirection, const scalarField *T) const
Return transmissivity on patch (default: 0)
Definition: lookup.C:112
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition: tmp.H:206
virtual tmp< scalarField > rSpec(const label bandI, const vectorField *incomingDirection, const scalarField *T) const
Return specular reflectivity on patch.
Definition: lookup.C:139
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const volScalarField & T
virtual label nBands() const
Number of bands.
Definition: lookup.C:190
addToRunTimeSelectionTable(absorptionEmissionModel, cloudAbsorptionEmission, dictionary)
virtual tmp< scalarField > e(const label bandI, const vectorField *incomingDirection, const scalarField *T) const
Return emissivity.
Definition: lookup.C:58
A class for managing temporary objects.
Definition: HashPtrTable.H:50
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:69
autoPtr< radiation::radiationModel > radiation(radiation::radiationModel::New(T))
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127