12 #include "MathUtils.h"
14 #include "libmesh/quadrature.h"
15 #include "libmesh/fe_base.h"
16 #include "libmesh/mesh_generation.h"
17 #include "libmesh/mesh.h"
18 #include "libmesh/string_to_enum.h"
19 #include "libmesh/quadrature_gauss.h"
20 #include "libmesh/point_locator_base.h"
21 #include "libmesh/elem.h"
31 params.addClassDescription(
32 "Computes the view factors for planar faces in unubstructed radiative heat transfer.");
38 _boundary_info(nullptr),
39 _current_remote_side(nullptr),
40 _current_remote_fe(nullptr),
41 _current_remote_JxW(nullptr),
42 _current_remote_xyz(nullptr),
43 _current_remote_normals(nullptr)
45 _mesh.errorIfDistributedMesh(
"UnobstructedPlanarViewFactor");
47 if (_mesh.dimension() == 1)
48 mooseError(
"View factor calculations for 1D geometry makes no sense");
49 else if (_mesh.dimension() == 2)
64 auto current_boundary_name = _mesh.getBoundaryName(_current_boundary_id);
66 mooseError(
"Current boundary name: ",
67 current_boundary_name,
70 " not in boundary parameter.");
73 _areas[index] += _current_side_volume;
77 auto remote_boundary_name = _mesh.getBoundaryName(std::get<2>(side));
79 std::get<2>(side) != _current_boundary_id)
82 unsigned int remote_index =
_side_name_index.find(remote_boundary_name)->second;
86 reinitFace(std::get<0>(side), std::get<1>(side));
89 for (
unsigned int qp = 0; qp < _qrule->n_points(); ++qp)
94 Point r2r = (_q_point[qp] - (*_current_remote_xyz)[r_qp]);
95 Real distance = r2r.norm();
96 Real cos1 = r2r * _normals[qp] / distance;
97 Real cos2 = r2r * (*_current_remote_normals)[r_qp] / distance;
117 for (
unsigned int j = 0; j <
_n_sides; ++j)
131 for (
unsigned int i = 0; i <
_n_sides; ++i)
140 for (
unsigned int i = 0; i <
_n_sides; ++i)
147 const Elem * current_remote_elem = _mesh.getMesh().elem_ptr(elem_id);
151 Order order = current_remote_elem->default_order();
152 unsigned int dim = _mesh.getMesh().mesh_dimension();
154 QGauss qface(dim - 1, FEType(order).default_quadrature_order());
165 unsigned int rz_radial_coord = _subproblem.getAxisymmetricRadialCoord();
167 switch (_assembly.coordSystem())
169 case Moose::COORD_XYZ:
170 for (
unsigned int qp = 0; qp < n_points; qp++)
174 case Moose::COORD_RZ:
175 for (
unsigned int qp = 0; qp < n_points; qp++)
179 case Moose::COORD_RSPHERICAL:
180 for (
unsigned int qp = 0; qp < n_points; qp++)
186 mooseError(
"Unknown coordinate system");