KASKADE 7 development version
Loading...
Searching...
No Matches
radiativeTransfer.hh
Go to the documentation of this file.
1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2/* */
3/* This file is part of the library KASKADE 7 */
4/* https://www.zib.de/research/projects/kaskade7-finite-element-toolbox */
5/* */
6/* Copyright (C) 2025-2025 Zuse Institute Berlin */
7/* */
8/* KASKADE 7 is distributed under the terms of the ZIB Academic License. */
9/* see $KASKADE/academic.txt */
10/* */
11/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
12
13#ifndef RADIATIVETRANSFER_HH
14#define RADIATIVETRANSFER_HH
15
18#include "utilities/power.hh"
19
20#include "dune/common/fmatrix.hh"
21#include "dune/common/fvector.hh"
22#include "dune/istl/bvector.hh"
23
24#include <utility>
25
26
27namespace Kaskade
28{
48 {
49 // Only here for syntactic reasons.
50 using Real = double;
51
64 template <class Cell, class LocalPosition>
65 std::array<Real,3> operator()(Cell cell, LocalPosition xi, Cell oCell, LocalPosition oXi) const;
66
78 template <class Cell, class LocalPosition, class GlobalPosition>
79 std::array<Real,2> operator()(Cell cell, LocalPosition xi, GlobalPosition ray) const;
80 };
81
82 // -----------------------------------------------------------------------------------------------
83
104 template <class Emissivity>
106 {
107 public:
116 RadiativeFluxDensity(double Tamb_, double T0_, Emissivity const& emissivity)
117 : Tamb(Tamb_), T0(T0_), e(emissivity)
118 {
119 assert(Tamb >= 0);
120 assert(T0 >= 0);
121 }
122
166 template <class Cell, class LocalPosition>
167 std::array<double,3> operator()(Cell cell, LocalPosition xi, Cell oCell, LocalPosition oXi) const
168 {
169 double const sigma = stefanBoltzmannConstant;
170 double ex = e(cell,xi);
171 double ey = e(oCell,oXi);
172
173 assert(0<=ex && ex<=1);
174 assert(0<=ey && ey<=1);
175
176 // Constant influx density.
177 double fc = 4*ex*sigma*(1-ey)*power(T0,3)*Tamb;
178
179 // Linear influx density.
180 double fl = -4*ex*(1-ey)*sigma*power(T0,3);
181
182 // Linear exchange influx
183 double fs = 4*ex*ey*sigma*power(T0,3);
184
185 return {fc,fl,fs};
186 }
187
209 template <class Cell, class LocalPosition, class GlobalPosition>
210 std::array<double,2> operator()(Cell cell, LocalPosition xi, GlobalPosition /* ray */) const
211 {
212 double const sigma = stefanBoltzmannConstant;
213 double ex = e(cell,xi);
214 assert(0<=ex && ex<=1);
215
216 double fc = 4*ex*sigma*power(T0,3)*Tamb;
217
218 double fl = -4*ex*sigma*power(T0,3);
219
220 return {fc,fl};
221 }
222
223 private:
224 double Tamb; // ambient background temperature
225 double T0; // linearization point for Stefan-Boltzmann
226 Emissivity e; // emissivity
227 };
228
229
230
231 // -----------------------------------------------------------------------------------------------
232
252 {
253 public:
262 HomogeneousRadiativeFluxDensity(double Tamb_, double T0_, double emissivity)
263 : Tamb(Tamb_), T0(T0_), e(emissivity)
264 {
265 assert(Tamb >= 0);
266 assert(T0 >= 0);
267 assert(0<=e && e<=1);
268 }
269
303 template <class Cell, class LocalPosition>
304 std::array<double,3> operator()(Cell cell, LocalPosition xi, Cell oCell, LocalPosition oXi) const
305 {
306 double const sigma = stefanBoltzmannConstant;
307
308 // Constant influx density.
309 double fc = 3*e*sigma*(1-e)*power(T0,4);
310
311 // Linear influx density.
312 double fl = -4*e*(1-e)*sigma*power(T0,3);
313
314 // Linear exchange influx
315 double fs = 4*e*sigma*power(T0,3);
316
317 return {fc,fl,fs};
318 }
319
341 template <class Cell, class LocalPosition, class GlobalPosition>
342 std::array<double,2> operator()(Cell cell, LocalPosition xi, GlobalPosition /* ray */) const
343 {
344 double const sigma = stefanBoltzmannConstant;
345
346 double fc = 4*e*sigma*power(T0,3)*Tamb;
347
348 double fl = -4*e*sigma*power(T0,3);
349
350 return {fc,fl};
351 }
352
353 private:
354 double Tamb; // ambient background temperature
355 double T0; // linearization point for Stefan-Boltzmann
356 double e; // emissivity
357 };
358
359 // -----------------------------------------------------------------------------------------------
360
361
362
363 // -----------------------------------------------------------------------------------------------
364 // -----------------------------------------------------------------------------------------------
365
419 template <class Space, class FluxDensity>
420 std::pair<NumaBCRSMatrix<Dune::FieldMatrix<double,1,1>>,
422 radiativeTransfer(Space const& space, FluxDensity const& fluxDensity, int n);
423
424}
425
426#endif
std::array< double, 2 > operator()(Cell cell, LocalPosition xi, GlobalPosition) const
Computes the unidirectional radiative flux coefficients in a direction to the ambient background.
std::array< double, 3 > operator()(Cell cell, LocalPosition xi, Cell oCell, LocalPosition oXi) const
Computes the flux between given surface points and .
HomogeneousRadiativeFluxDensity(double Tamb_, double T0_, double emissivity)
Constructor.
std::array< double, 3 > operator()(Cell cell, LocalPosition xi, Cell oCell, LocalPosition oXi) const
Computes the flux between given surface points and .
RadiativeFluxDensity(double Tamb_, double T0_, Emissivity const &emissivity)
Constructor.
std::array< double, 2 > operator()(Cell cell, LocalPosition xi, GlobalPosition) const
Computes the unidirectional radiative flux coefficients in a direction to the ambient background.
std::pair< NumaBCRSMatrix< Dune::FieldMatrix< double, 1, 1 > >, Dune::BlockVector< Dune::FieldVector< double, 1 > > > radiativeTransfer(Space const &space, FluxDensity const &fluxDensity, int n)
Assembles a Galerkin matrix and a right hand side contribution for direction-dependent fluxes,...
typename GridView::template Codim< 0 >::Entity Cell
The type of cells (entities of codimension 0) in the grid view.
Definition gridBasics.hh:35
Dune::FieldVector< typename GridView::ctype, GridView::dimensionworld > GlobalPosition
The type of global positions within the grid view.
Definition gridBasics.hh:50
Dune::FieldVector< typename GridView::ctype, GridView::dimension > LocalPosition
The type of local positions within cells of the grid view.
Definition gridBasics.hh:59
double emissivity(std::string const &name)
Emissivity of several materials (dimensionless)
constexpr double stefanBoltzmannConstant
The Stefan-Boltzmann constant .
constexpr R power(R base, int exp)
Computes integral powers of values in a multiplicative half-group.
Definition power.hh:31
std::array< Real, 3 > operator()(Cell cell, LocalPosition xi, Cell oCell, LocalPosition oXi) const
computes the flux density coefficients along the line between two given points
std::array< Real, 2 > operator()(Cell cell, LocalPosition xi, GlobalPosition ray) const
computes the unilateral flux density coefficients along a background direction