LCOV - code coverage report
Current view: top level - src/userobjects - LayeredAverageRZ.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 24 25 96.0 %
Date: 2025-07-30 13:02:48 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          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 "LayeredAverageRZ.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", LayeredAverageRZ);
      13             : 
      14             : InputParameters
      15          39 : LayeredAverageRZ::validParams()
      16             : {
      17          39 :   InputParameters params = LayeredAverage::validParams();
      18          39 :   params += RZSymmetry::validParams();
      19          78 :   params.addRequiredParam<Real>("length",
      20             :                                 "The length of the block in the direction given by 'axis_dir'.");
      21          39 :   params.addClassDescription(
      22             :       "Computes layered averages of variable for RZ components in a XY coordinate system");
      23          39 :   return params;
      24           0 : }
      25             : 
      26          21 : LayeredAverageRZ::LayeredAverageRZ(const InputParameters & parameters)
      27          21 :   : LayeredAverage(parameters), RZSymmetry(this, parameters)
      28             : {
      29          42 :   _direction_min = getParam<Point>("axis_point")(_direction);
      30          42 :   _direction_max = _direction_min + getParam<Real>("length");
      31          21 : }
      32             : 
      33             : void
      34        3200 : LayeredAverageRZ::execute()
      35             : {
      36        3200 :   LayeredIntegralBase<ElementIntegralVariableUserObject>::execute();
      37             : 
      38             :   Real current_elem_volume = 0.;
      39       16000 :   for (unsigned int qp = 0; qp < _qrule->n_points(); qp++)
      40             :   {
      41       12800 :     const Real circumference = computeCircumference(_q_point[qp]);
      42       12800 :     current_elem_volume += _JxW[qp] * circumference;
      43             :   }
      44             : 
      45        3200 :   unsigned int layer = getLayer(_current_elem->vertex_average());
      46        3200 :   _layer_volumes[layer] += current_elem_volume;
      47        3200 : }
      48             : 
      49             : Real
      50        3200 : LayeredAverageRZ::computeIntegral()
      51             : {
      52             :   Real sum = 0;
      53             : 
      54       16000 :   for (_qp = 0; _qp < _qrule->n_points(); _qp++)
      55             :   {
      56       12800 :     const Real circumference = computeCircumference(_q_point[_qp]);
      57       12800 :     sum += _JxW[_qp] * circumference * computeQpIntegral();
      58             :   }
      59        3200 :   return sum;
      60             : }

Generated by: LCOV version 1.14