LCOV - code coverage report
Current view: top level - src/materials - FunctionPathEllipsoidHeatSource.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #32971 (54bef8) with base c6cf66 Lines: 37 38 97.4 %
Date: 2026-05-29 20:37:03 Functions: 3 3 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 "FunctionPathEllipsoidHeatSource.h"
      11             : 
      12             : #include "Function.h"
      13             : 
      14             : registerMooseObject("HeatTransferApp", FunctionPathEllipsoidHeatSource);
      15             : 
      16             : InputParameters
      17          39 : FunctionPathEllipsoidHeatSource::validParams()
      18             : {
      19          39 :   InputParameters params = Material::validParams();
      20          78 :   params.addRequiredParam<Real>("power", "power");
      21          78 :   params.addParam<Real>("efficiency", 1, "process efficiency");
      22          78 :   params.addRequiredParam<Real>("rx", "effective transverse ellipsoid radius");
      23          78 :   params.addRequiredParam<Real>("ry", "effective longitudinal ellipsoid radius");
      24          78 :   params.addRequiredParam<Real>("rz", "effective depth ellipsoid radius");
      25          78 :   params.addParam<Real>(
      26          78 :       "factor", 1, "scaling factor that is multiplied to the heat source to adjust the intensity");
      27          78 :   params.addParam<FunctionName>(
      28             :       "function_x", "0", "The x component of the center of the heating spot as a function of time");
      29          78 :   params.addParam<FunctionName>(
      30             :       "function_y", "0", "The y component of the center of the heating spot as a function of time");
      31          78 :   params.addParam<FunctionName>(
      32             :       "function_z", "0", "The z component of the center of the heating spot as a function of time");
      33          39 :   params.addClassDescription("Double ellipsoid volumetric source heat with function path.");
      34             : 
      35          39 :   return params;
      36           0 : }
      37             : 
      38          30 : FunctionPathEllipsoidHeatSource::FunctionPathEllipsoidHeatSource(const InputParameters & parameters)
      39             :   : Material(parameters),
      40          30 :     _P(getParam<Real>("power")),
      41          60 :     _eta(getParam<Real>("efficiency")),
      42          60 :     _rx(getParam<Real>("rx")),
      43          60 :     _ry(getParam<Real>("ry")),
      44          60 :     _rz(getParam<Real>("rz")),
      45          60 :     _f(getParam<Real>("factor")),
      46          30 :     _function_x(getFunction("function_x")),
      47          30 :     _function_y(getFunction("function_y")),
      48          30 :     _function_z(getFunction("function_z")),
      49          60 :     _volumetric_heat(declareADProperty<Real>("volumetric_heat"))
      50             : {
      51          30 : }
      52             : 
      53             : void
      54      244000 : FunctionPathEllipsoidHeatSource::computeQpProperties()
      55             : {
      56      244000 :   const Real & x = _q_point[_qp](0);
      57             :   const Real & y = _q_point[_qp](1);
      58             :   const Real & z = _q_point[_qp](2);
      59             : 
      60             :   // center of the heat source
      61      244000 :   Real x_t = _function_x.value(_t);
      62      244000 :   Real y_t = _function_y.value(_t);
      63      244000 :   Real z_t = _function_z.value(_t);
      64             : 
      65      244000 :   _volumetric_heat[_qp] = 6.0 * std::sqrt(3.0) * _P * _eta * _f /
      66      488000 :                           (_rx * _ry * _rz * std::pow(libMesh::pi, 1.5)) *
      67      244000 :                           std::exp(-(3.0 * std::pow(x - x_t, 2.0) / std::pow(_rx, 2.0) +
      68      244000 :                                      3.0 * std::pow(y - y_t, 2.0) / std::pow(_ry, 2.0) +
      69      244000 :                                      3.0 * std::pow(z - z_t, 2.0) / std::pow(_rz, 2.0)));
      70      244000 : }

Generated by: LCOV version 1.14