Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
10License
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"
31// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32
33namespace Foam
34{
35 namespace radiation
36 {
39 (
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
64 (
65 wallAbsorptionEmissionModel::New(absorptionDict, pp).ptr()
66 );
67}
68
69
70// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
71
73(
74 const label bandI,
75 const vectorField* dir,
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
96(
97 const label bandI,
98 const vectorField* dir,
100) const
101{
102 return(absorptionEmission_->a(bandI, dir, T));
103}
104
105
107(
108 const label faceI,
109 const label bandI,
110 const vector& dir,
111 const scalar T
112) const
113{
114 return(absorptionEmission_->a(faceI, bandI, dir, T));
115}
116
117
119(
120 const label bandI,
121 const vectorField* dir,
123) const
124{
125 return tmp<scalarField>::New(pp_.size(), Zero);
126}
127
128
130(
131 const label faceI,
132 const label bandI,
133 const vector& dir,
134 const scalar T
135) const
136{
137 return Zero;
138}
139
140
142(
143 const label bandI,
144 const vectorField* dir,
146) const
147{
148 return (1.0 - fd_)*(1.0 - a(bandI, dir, T));
149}
150
151
153(
154 const label faceI,
155 const label bandI,
156 const vector& dir,
157 const scalar T
158) const
159{
160 return (1.0 - fd_)*(1.0 - a(faceI, bandI, dir, T));
161}
162
163
165(
166 const label bandI,
167 const vectorField* dir,
169) const
170{
171 return fd_*(1.0 - a(bandI, dir, T));
172}
173
174
176(
177 const label faceI,
178 const label bandI,
179 const vector& dir,
180 const scalar T
181) const
182{
183 return fd_*(1.0 - a(faceI, bandI, dir, T));
184}
185
188{
189 return absorptionEmission_->isGrey();
190}
191
192
194{
195 return absorptionEmission_->nBands();
196}
197
198
199// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A patch is a list of labels that address the faces in the global face list.
Definition polyPatch.H:73
autoPtr< wallAbsorptionEmissionModel > absorptionEmission_
Absorption/emission model.
boundaryRadiationPropertiesPatch(const dictionary &, const polyPatch &)
Construct from patch, internal field and dictionary.
Radiation boundary model for opaque reflective walls. It requires to specify a wallAbsorptionEmission...
const scalar fd_
Diffuse fraction.
virtual tmp< scalarField > a(const label bandI, const vectorField *incomingDirection, const scalarField *T) const
Return absorptivity on patch.
virtual bool isGrey() const
Is Grey.
const polyPatch & pp_
Reference to the polyPatch.
virtual tmp< scalarField > rDiff(const label bandI, const vectorField *incomingDirection, const scalarField *T) const
Return diffusive reflectivity on patch.
virtual label nBands() const
Number of bands.
virtual tmp< scalarField > t(const label bandI, const vectorField *incomingDirection, const scalarField *T) const
Return transmissivity on patch.
opaqueReflective(const dictionary &dict, const polyPatch &pp)
Construct from components.
virtual tmp< scalarField > e(const label bandI, const vectorField *incomingDirection, const scalarField *T) const
Return emissivity.
virtual tmp< scalarField > rSpec(const label bandI, const vectorField *incomingDirection, const scalarField *T) const
Return specular reflectivity on patch.
static autoPtr< wallAbsorptionEmissionModel > New(const dictionary &dict, const polyPatch &pp)
A class for managing temporary objects.
Definition tmp.H:75
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition tmp.H:215
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
Namespace for radiation modelling.
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
Vector< scalar > vector
Definition vector.H:57
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dictionary dict