LCOV - code coverage report
Current view: top level - src/kernels - OneDEnergyWallHeating.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 0 32 0.0 %
Date: 2025-07-30 13:02:48 Functions: 0 5 0.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 "OneDEnergyWallHeating.h"
      11             : 
      12             : registerMooseObject("ThermalHydraulicsApp", OneDEnergyWallHeating);
      13             : 
      14             : InputParameters
      15           0 : OneDEnergyWallHeating::validParams()
      16             : {
      17           0 :   InputParameters params = Kernel::validParams();
      18           0 :   params.addClassDescription("Adds a convective heat flux term from a wall temperature");
      19           0 :   params.addRequiredCoupledVar("rhoA", "");
      20           0 :   params.addRequiredCoupledVar("rhouA", "");
      21           0 :   params.addRequiredCoupledVar("rhoEA", "Energy equation variable");
      22           0 :   params.addRequiredCoupledVar("P_hf", "heat flux perimeter");
      23           0 :   params.addCoupledVar("T_wall", "Wall temperature as a field variable");
      24           0 :   params.addRequiredParam<MaterialPropertyName>("Hw",
      25             :                                                 "Convective heat transfer coefficient, W/m^2-K");
      26           0 :   params.addRequiredParam<MaterialPropertyName>("T", "Temperature material property");
      27             : 
      28           0 :   return params;
      29           0 : }
      30             : 
      31           0 : OneDEnergyWallHeating::OneDEnergyWallHeating(const InputParameters & parameters)
      32             :   : DerivativeMaterialInterfaceTHM<Kernel>(parameters),
      33           0 :     _temperature(getMaterialProperty<Real>("T")),
      34           0 :     _dT_drhoA(getMaterialPropertyDerivativeTHM<Real>("T", "rhoA")),
      35           0 :     _dT_drhouA(getMaterialPropertyDerivativeTHM<Real>("T", "rhouA")),
      36           0 :     _dT_drhoEA(getMaterialPropertyDerivativeTHM<Real>("T", "rhoEA")),
      37           0 :     _Hw(getMaterialProperty<Real>("Hw")),
      38           0 :     _T_wall(coupledValue("T_wall")),
      39           0 :     _P_hf(coupledValue("P_hf")),
      40           0 :     _rhoA_var_number(coupled("rhoA")),
      41           0 :     _rhouA_var_number(coupled("rhouA"))
      42             : {
      43           0 : }
      44             : 
      45             : Real
      46           0 : OneDEnergyWallHeating::computeQpResidual()
      47             : {
      48           0 :   return _Hw[_qp] * _P_hf[_qp] * (_temperature[_qp] - _T_wall[_qp]) * _test[_i][_qp];
      49             : }
      50             : 
      51             : Real
      52           0 : OneDEnergyWallHeating::computeQpJacobian()
      53             : {
      54           0 :   return _Hw[_qp] * _P_hf[_qp] * _dT_drhoEA[_qp] * _phi[_j][_qp] * _test[_i][_qp];
      55             : }
      56             : 
      57             : Real
      58           0 : OneDEnergyWallHeating::computeQpOffDiagJacobian(unsigned int jvar)
      59             : {
      60           0 :   if (jvar == _rhoA_var_number)
      61           0 :     return _Hw[_qp] * _P_hf[_qp] * _dT_drhoA[_qp] * _phi[_j][_qp] * _test[_i][_qp];
      62             : 
      63           0 :   else if (jvar == _rhouA_var_number)
      64           0 :     return _Hw[_qp] * _P_hf[_qp] * _dT_drhouA[_qp] * _phi[_j][_qp] * _test[_i][_qp];
      65             : 
      66             :   else
      67             :     return 0.;
      68             : }

Generated by: LCOV version 1.14