https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
38Real
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
50Real
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}
registerMooseObject("HeatTransferApp", ExposedSideAverageValue)
This postprocessor computes a volume integral of the specified variable on the exposed portion of a s...
const SelfShadowSideUserObject & _self_shadow
Reference to SelfShadowSideUserObject, which does the determination of which QPs are exposed.
ExposedSideAverageValue(const InputParameters &parameters)
static InputParameters validParams()
virtual Real volume() override
Instead of computing the total face volume (as the base class does), compute the volume of the expose...
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void paramError(const std::string &param, Args... args) const
Given a radiation direction vector this user object computes the illumination state of each side QP o...
unsigned int illumination(const SideIDType &id) const
std::pair< dof_id_type, unsigned int > SideIDType
bool useDisplacedMesh() const
API to chek if the UO runs on the displaced mesh.
static InputParameters validParams()
unsigned int _qp
Real computeQpIntegral() override
const unsigned int & _current_side
const MooseArray< Real > & _coord
const QBase *const & _qrule
const MooseArray< Real > & _JxW
const Elem *const & _current_elem