https://mooseframework.inl.gov
RDGBoundaryFluxPostprocessor.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 
11 #include "BoundaryFluxBase.h"
12 
15  BoundaryFluxPostprocessor,
16  "04/01/2025 00:00",
18 
21 {
23 
24  params.addRequiredParam<UserObjectName>("boundary_flux_uo", "Boundary flux user object name");
25  params.addRequiredParam<unsigned int>("flux_index", "Index within flux vector to query");
26  params.addParam<Point>("normal", "Normal vector for boundary (if requesting override)");
27  params.addRequiredCoupledVar(
28  "variables", "Variables to pass to boundary flux user object, in the correct order");
29 
30  params.addClassDescription(
31  "Computes the side integral of a flux entry from a BoundaryFluxBase user object");
32 
33  return params;
34 }
35 
37  : SideIntegralPostprocessor(parameters),
38 
39  _boundary_flux_uo(getUserObject<BoundaryFluxBase>("boundary_flux_uo")),
40  _flux_index(getParam<unsigned int>("flux_index")),
41  _provided_normal(isParamValid("normal")),
42  _n_components(coupledComponents("variables")),
43  _U(coupledValues("variables"))
44 {
45 }
46 
47 Real
49 {
50  std::vector<Real> U(_n_components);
51  for (unsigned int i = 0; i < _n_components; i++)
52  U[i] = (*_U[i])[_qp];
53 
54  const Point & normal = _provided_normal ? getParam<Point>("normal") : _normals[_qp];
55 
56  const auto & flux = _boundary_flux_uo.getFlux(_current_side, _current_elem->id(), U, normal);
57  return flux[_flux_index];
58 }
Computes the side integral of a flux entry from a BoundaryFluxBase user object.
virtual const std::vector< Real > & getFlux(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave) const
Get the boundary flux vector.
const unsigned int & _current_side
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
RDGBoundaryFluxPostprocessor(const InputParameters &parameters)
static InputParameters validParams()
const bool _provided_normal
Did the user request to override the boundary normal?
void addRequiredParam(const std::string &name, const std::string &doc_string)
A base class for computing/caching fluxes at boundaries.
registerMooseObjectRenamed("RdgApp", BoundaryFluxPostprocessor, "04/01/2025 00:00", RDGBoundaryFluxPostprocessor)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
const unsigned int _n_components
Number of components in the solution vector used to compute the flux.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("RdgApp", RDGBoundaryFluxPostprocessor)
const MooseArray< Point > & _normals
void addClassDescription(const std::string &doc_string)
const Elem *const & _current_elem
const unsigned int & _flux_index
Index within flux vector to query.
const std::vector< const VariableValue * > _U
Variables to pass to boundary flux user object, in the correct order.
void ErrorVector unsigned int
const BoundaryFluxBase & _boundary_flux_uo
Boundary flux user object.