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 "AxisymmetricCenterlineAverageValue.h" 11 : #include "libmesh/quadrature.h" 12 : 13 : registerMooseObject("MooseApp", AxisymmetricCenterlineAverageValue); 14 : 15 : InputParameters 16 14290 : AxisymmetricCenterlineAverageValue::validParams() 17 : { 18 14290 : InputParameters params = SideAverageValue::validParams(); 19 14290 : params.addClassDescription("Computes the average value of a variable on a " 20 : "sideset located along the centerline of an " 21 : "axisymmetric model."); 22 : 23 14290 : return params; 24 0 : } 25 : 26 13 : AxisymmetricCenterlineAverageValue::AxisymmetricCenterlineAverageValue( 27 13 : const InputParameters & parameters) 28 13 : : SideAverageValue(parameters) 29 : { 30 13 : } 31 : 32 : // NOTE: We do not account for the coordinate system transformation here 33 : // (using _coord) because we want to average a variable over the centerline 34 : // of a cylinder. If we weight by _coord, we get 0 / 0. 35 : Real 36 80 : AxisymmetricCenterlineAverageValue::volume() 37 : { 38 80 : return _current_side_elem->volume(); 39 : } 40 : 41 : Real 42 80 : AxisymmetricCenterlineAverageValue::computeIntegral() 43 : { 44 80 : Real sum = 0; 45 240 : for (_qp = 0; _qp < _qrule->n_points(); _qp++) 46 160 : sum += _JxW[_qp] * computeQpIntegral(); 47 80 : return sum; 48 : }