https://mooseframework.inl.gov
ExposedSideAverageValue.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 
12 
14 
17 {
19  params.addClassDescription("Computes the average value of a variable on the "
20  "exposed portion of a sideset. Note that this cannot be used on the "
21  "centerline of an axisymmetric model.");
22  params.addRequiredParam<UserObjectName>("self_shadow_uo",
23  "SelfShadowSideUserObject that calculates the "
24  "illumination state of element sides in a side set");
25  return params;
26 }
27 
29  : SideAverageValue(parameters),
30  _self_shadow(getUserObject<SelfShadowSideUserObject>("self_shadow_uo"))
31 {
32  if (_self_shadow.useDisplacedMesh() != getParam<bool>("use_displaced_mesh"))
33  paramError("use_displaced_mesh",
34  "The SelfShadowSideUserObject should operate on the same mesh (displaced or "
35  "undisplaced) as this PostProcessor.");
36 }
37 
38 Real
40 {
42  const unsigned int illumination = _self_shadow.illumination(id);
43  // tests if the bit at position _qp is set
44  if (illumination & (1 << _qp))
46  else
47  return 0.0;
48 }
49 
50 Real
52 {
53  Real curr_exposed_side_volume = 0.0;
55  const unsigned int illumination = _self_shadow.illumination(id);
56  for (const unsigned int qp : make_range(_qrule->n_points()))
57  {
58  // tests if the bit at position _qp is set
59  if (illumination & (1 << qp))
60  curr_exposed_side_volume += _JxW[qp] * _coord[qp];
61  }
62  return curr_exposed_side_volume;
63 }
const unsigned int & _current_side
unsigned int illumination(const SideIDType &id) const
bool useDisplacedMesh() const
API to chek if the UO runs on the displaced mesh.
const SelfShadowSideUserObject & _self_shadow
Reference to SelfShadowSideUserObject, which does the determination of which QPs are exposed...
Real computeQpIntegral() override
unsigned int _qp
Given a radiation direction vector this user object computes the illumination state of each side QP o...
void addRequiredParam(const std::string &name, const std::string &doc_string)
This postprocessor computes a volume integral of the specified variable on the exposed portion of a s...
const MooseArray< Real > & _JxW
void paramError(const std::string &param, Args... args) const
const MooseArray< Real > & _coord
std::pair< dof_id_type, unsigned int > SideIDType
static InputParameters validParams()
registerMooseObject("HeatTransferApp", ExposedSideAverageValue)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real volume() override
Instead of computing the total face volume (as the base class does), compute the volume of the expose...
const QBase *const & _qrule
IntRange< T > make_range(T beg, T end)
void addClassDescription(const std::string &doc_string)
const Elem *const & _current_elem
static InputParameters validParams()
ExposedSideAverageValue(const InputParameters &parameters)