LCOV - code coverage report
Current view: top level - src/kernels - EMJouleHeatingSource.C (source / functions) Hit Total Coverage
Test: idaholab/moose electromagnetics: #31405 (292dce) with base fef103 Lines: 18 19 94.7 %
Date: 2025-09-04 07:52:56 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 "EMJouleHeatingSource.h"
      11             : #include "Assembly.h"
      12             : #include "ElectromagneticEnums.h"
      13             : #include "ElectromagneticConstants.h"
      14             : #include "Function.h"
      15             : #include <complex>
      16             : 
      17             : registerMooseObject("ElectromagneticsApp", EMJouleHeatingSource);
      18             : 
      19             : InputParameters
      20          82 : EMJouleHeatingSource::validParams()
      21             : {
      22          82 :   InputParameters params = ADKernel::validParams();
      23          82 :   params.addClassDescription("Supplies the heating due to the electic field in the "
      24             :                              "form of $(0.5Re(\\sigma E \\cdot E^{*} ))$");
      25         164 :   params.addRequiredCoupledVar("E_real", "The real component of the electric field.");
      26         164 :   params.addRequiredCoupledVar("E_imag", "The imaginary component of the electric field.");
      27         164 :   params.addRequiredParam<std::string>("conductivity",
      28             :                                        "The real component of the material conductivity.");
      29         164 :   params.addParam<Real>("value", 1.0, "Coefficient to multiply by heating term.");
      30          82 :   return params;
      31           0 : }
      32             : 
      33          44 : EMJouleHeatingSource::EMJouleHeatingSource(const InputParameters & parameters)
      34             :   : ADKernel(parameters),
      35          44 :     _E_real(adCoupledVectorValue("E_real")),
      36          44 :     _E_imag(adCoupledVectorValue("E_imag")),
      37          88 :     _cond(getADMaterialProperty<Real>(getParam<std::string>("conductivity"))),
      38         132 :     _scale(getParam<Real>("value"))
      39             : {
      40          44 :   mooseDeprecated("This kernel will be deprecated in the near future (10/01/2025) in favor of "
      41             :                   "exclusively using the Heat Transfer module's 'ADJouleHeatingSource' for "
      42             :                   "coupling electromagnetics to heat transfer problems.");
      43          44 : }
      44             : 
      45             : ADReal
      46       36000 : EMJouleHeatingSource::computeQpResidual()
      47             : {
      48       36000 :   return -_test[_i][_qp] * _scale * 0.5 * _cond[_qp] *
      49       72000 :          (_E_real[_qp] * _E_real[_qp] + _E_imag[_qp] * _E_imag[_qp]);
      50             : }

Generated by: LCOV version 1.14