https://mooseframework.inl.gov
ViewFactorRayBC.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "ViewFactorRayBC.h"
11 #include "ViewFactorRayStudy.h"
12 
13 registerMooseObject("HeatTransferApp", ViewFactorRayBC);
14 
17 {
19  params.addClassDescription("This ray boundary condition is applied on all sidesets bounding a "
20  "radiation cavity except symmetry sidesets. It kills rays that hit "
21  "the sideset and scores the ray for computation of view factors.");
22  return params;
23 }
24 
26  : GeneralRayBC(params),
27  _vf_study(getStudy<ViewFactorRayStudy>()),
28  _ray_index_start_bnd_id(_vf_study.rayIndexStartBndID()),
29  _ray_index_start_total_weight(_vf_study.rayIndexStartTotalWeight())
30 {
31 }
32 
33 void
34 ViewFactorRayBC::onBoundary(const unsigned int num_applying)
35 {
36  // The boundary ID this Ray started on
37  const BoundaryID start_bnd_id = currentRay()->auxData(_ray_index_start_bnd_id);
38  // Starting total weight
39  const Real start_total_weight = currentRay()->auxData(_ray_index_start_total_weight);
40  // Value to append (divide by num_applying if we hit an edge or node)
41  const Real value = start_total_weight / (Real)num_applying;
42  mooseAssert(!std::isnan(value), "Encountered NaN");
43 
44  // Accumulate into the view factor info
46 
47  // Either hit an obstacle here or hit its end and contributed: done with this Ray
48  currentRay()->setShouldContinue(false);
49 }
const RayDataIndex _ray_index_start_bnd_id
Index in the Ray aux data for the starting boundary ID.
ViewFactorRayStudy & _vf_study
The ViewFactorRayStudy.
const RayDataIndex _ray_index_start_total_weight
Index in the Ray aux data for the starting total weight (dot * qp weight)
void addToViewFactorInfo(Real value, const BoundaryID from_id, const BoundaryID to_id, const THREAD_ID tid)
Adds into the view factor info; to be used in ViewFactorRayBC.
const std::shared_ptr< Ray > & currentRay() const
Gets the current Ray that this is working on.
RayTracingStudy used to generate Rays for view factor computation using the angular quadrature method...
RayBC used in the computation of view factors using the angular quadrature ray tracing method...
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
registerMooseObject("HeatTransferApp", ViewFactorRayBC)
boundary_id_type BoundaryID
const THREAD_ID _tid
The thread id.
ViewFactorRayBC(const InputParameters &params)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void onBoundary(const unsigned int num_applying) override
Called on a Ray on the boundary to apply the Ray boundary condition.
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
Definition: GeneralRayBC.C:13
const BoundaryID & _current_bnd_id
The ID of the current intersected boundary.