LCOV - code coverage report
Current view: top level - src/userobjects - GapFluxModelConduction.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #31405 (292dce) with base fef103 Lines: 24 26 92.3 %
Date: 2025-09-04 07:53:51 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 "GapFluxModelConduction.h"
      11             : #include "libmesh/utility.h"
      12             : #include "Function.h"
      13             : 
      14             : registerMooseObject("HeatTransferApp", GapFluxModelConduction);
      15             : 
      16             : InputParameters
      17         985 : GapFluxModelConduction::validParams()
      18             : {
      19         985 :   InputParameters params = GapFluxModelConductionBase::validParams();
      20         985 :   params.addClassDescription(
      21             :       "Gap flux model for varying gap conductance using a coupled variable for temperature");
      22        1970 :   params.addRequiredCoupledVar("temperature", "The name of the temperature variable");
      23        1970 :   params.addParam<FunctionName>(
      24             :       "gap_conductivity_function",
      25             :       "Thermal conductivity of the gap material as a function.  Multiplied "
      26             :       "by gap_conductivity.");
      27        1970 :   params.addCoupledVar("gap_conductivity_function_variable",
      28             :                        "Variable to be used in the gap_conductivity_function in place of time");
      29        1970 :   params.addParamNamesToGroup("gap_conductivity_function gap_conductivity_function_variable",
      30             :                               "Gap conductive flux");
      31         985 :   return params;
      32           0 : }
      33             : 
      34         363 : GapFluxModelConduction::GapFluxModelConduction(const InputParameters & parameters)
      35             :   : GapFluxModelConductionBase(parameters),
      36         363 :     _primary_T(adCoupledNeighborValue("temperature")),
      37         363 :     _secondary_T(adCoupledValue("temperature")),
      38         363 :     _gap_conductivity_function(isParamValid("gap_conductivity_function")
      39         407 :                                    ? &getFunction("gap_conductivity_function")
      40             :                                    : nullptr),
      41         363 :     _gap_conductivity_function_variable(isCoupled("gap_conductivity_function_variable")
      42         407 :                                             ? &coupledValue("gap_conductivity_function_variable")
      43         363 :                                             : nullptr)
      44             : {
      45         363 : }
      46             : 
      47             : ADReal
      48    26512992 : GapFluxModelConduction::computeFlux() const
      49             : {
      50    26512992 :   Real gap_conductivity_multiplier = 1;
      51    26512992 :   if (_gap_conductivity_function)
      52             :   {
      53        6336 :     if (_gap_conductivity_function_variable)
      54        6336 :       gap_conductivity_multiplier = _gap_conductivity_function->value(
      55        6336 :           (*_gap_conductivity_function_variable)[_qp], _q_point[_qp]);
      56             :     else
      57           0 :       gap_conductivity_multiplier = _gap_conductivity_function->value(_t, _q_point[_qp]);
      58             :   }
      59             : 
      60    26512992 :   return computeConductionFlux(_secondary_T[_qp], _primary_T[_qp], gap_conductivity_multiplier);
      61             : }

Generated by: LCOV version 1.14