Line data Source code
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 "RDGBoundaryFluxPostprocessor.h" 11 : #include "BoundaryFluxBase.h" 12 : 13 : registerMooseObject("RdgApp", RDGBoundaryFluxPostprocessor); 14 : registerMooseObjectRenamed("RdgApp", 15 : BoundaryFluxPostprocessor, 16 : "04/01/2025 00:00", 17 : RDGBoundaryFluxPostprocessor); 18 : 19 : InputParameters 20 84 : RDGBoundaryFluxPostprocessor::validParams() 21 : { 22 84 : InputParameters params = SideIntegralPostprocessor::validParams(); 23 : 24 168 : params.addRequiredParam<UserObjectName>("boundary_flux_uo", "Boundary flux user object name"); 25 168 : params.addRequiredParam<unsigned int>("flux_index", "Index within flux vector to query"); 26 168 : params.addParam<Point>("normal", "Normal vector for boundary (if requesting override)"); 27 168 : params.addRequiredCoupledVar( 28 : "variables", "Variables to pass to boundary flux user object, in the correct order"); 29 : 30 84 : params.addClassDescription( 31 : "Computes the side integral of a flux entry from a BoundaryFluxBase user object"); 32 : 33 84 : return params; 34 0 : } 35 : 36 48 : RDGBoundaryFluxPostprocessor::RDGBoundaryFluxPostprocessor(const InputParameters & parameters) 37 : : SideIntegralPostprocessor(parameters), 38 : 39 48 : _boundary_flux_uo(getUserObject<BoundaryFluxBase>("boundary_flux_uo")), 40 96 : _flux_index(getParam<unsigned int>("flux_index")), 41 96 : _provided_normal(isParamValid("normal")), 42 48 : _n_components(coupledComponents("variables")), 43 96 : _U(coupledValues("variables")) 44 : { 45 48 : } 46 : 47 : Real 48 48 : RDGBoundaryFluxPostprocessor::computeQpIntegral() 49 : { 50 48 : std::vector<Real> U(_n_components); 51 192 : for (unsigned int i = 0; i < _n_components; i++) 52 144 : U[i] = (*_U[i])[_qp]; 53 : 54 60 : const Point & normal = _provided_normal ? getParam<Point>("normal") : _normals[_qp]; 55 : 56 48 : const auto & flux = _boundary_flux_uo.getFlux(_current_side, _current_elem->id(), U, normal); 57 48 : return flux[_flux_index]; 58 48 : }