LCOV - code coverage report
Current view: top level - src/functions - GeneralizedCircumference.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #32971 (54bef8) with base c6cf66 Lines: 12 15 80.0 %
Date: 2026-05-29 20:41:18 Functions: 3 4 75.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 "GeneralizedCircumference.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", GeneralizedCircumference);
      13             : 
      14             : InputParameters
      15         331 : GeneralizedCircumference::validParams()
      16             : {
      17         331 :   InputParameters params = Function::validParams();
      18         662 :   params.addRequiredParam<FunctionName>("area_function", "function to compute the cross section");
      19         331 :   params.addClassDescription("Computes a generalized circumference from a function "
      20             :                              "providing the area.");
      21         331 :   return params;
      22           0 : }
      23             : 
      24         176 : GeneralizedCircumference::GeneralizedCircumference(const InputParameters & parameters)
      25         176 :   : Function(parameters), FunctionInterface(this), _area_func(getFunction("area_function"))
      26             : {
      27         176 : }
      28             : 
      29             : Real
      30       17924 : GeneralizedCircumference::value(Real t, const Point & p) const
      31             : {
      32       17924 :   RealVectorValue gradA = _area_func.gradient(t, p);
      33       17924 :   Real dAdx2 = gradA(0) * gradA(0);
      34             : 
      35             :   // Here, we assume a flow channel with circular cross section.
      36       17924 :   return std::sqrt(4. * libMesh::pi * _area_func.value(t, p) + dAdx2);
      37             : }
      38             : 
      39             : RealVectorValue
      40           0 : GeneralizedCircumference::gradient(Real /*t*/, const Point & /*p*/) const
      41             : {
      42           0 :   mooseError(name(), ": ", __PRETTY_FUNCTION__, " is not implemented.");
      43             : }

Generated by: LCOV version 1.14