https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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)");
28 "variables", "Variables to pass to boundary flux user object, in the correct order");
29
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
47Real
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}
registerMooseObject("RdgApp", RDGBoundaryFluxPostprocessor)
registerMooseObjectRenamed("RdgApp", BoundaryFluxPostprocessor, "04/01/2025 00:00", RDGBoundaryFluxPostprocessor)
void ErrorVector unsigned int
A base class for computing/caching fluxes at boundaries.
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.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Computes the side integral of a flux entry from a BoundaryFluxBase user object.
const BoundaryFluxBase & _boundary_flux_uo
Boundary flux user object.
const bool _provided_normal
Did the user request to override the boundary normal?
const std::vector< const VariableValue * > _U
Variables to pass to boundary flux user object, in the correct order.
const unsigned int & _flux_index
Index within flux vector to query.
RDGBoundaryFluxPostprocessor(const InputParameters &parameters)
const unsigned int _n_components
Number of components in the solution vector used to compute the flux.
static InputParameters validParams()
const unsigned int & _current_side
const MooseArray< Point > & _normals
const Elem *const & _current_elem