LCOV - code coverage report
Current view: top level - src/userobjects - GapFluxModelConductionBase.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #31405 (292dce) with base fef103 Lines: 20 28 71.4 %
Date: 2025-09-04 07:53:51 Functions: 5 5 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 "GapFluxModelConductionBase.h"
      11             : #include "libmesh/utility.h"
      12             : 
      13             : InputParameters
      14        1067 : GapFluxModelConductionBase::validParams()
      15             : {
      16        1067 :   InputParameters params = GapFluxModelBase::validParams();
      17        2134 :   params.addParam<Real>("gap_conductivity", 1.0, "Gap conductivity value");
      18        3201 :   params.addRangeCheckedParam<Real>(
      19        2134 :       "min_gap", 1e-6, "min_gap>0", "A minimum gap (denominator) size");
      20        3201 :   params.addRangeCheckedParam<unsigned int>(
      21             :       "min_gap_order",
      22        2134 :       0,
      23             :       "min_gap_order<=1",
      24             :       "Order of the Taylor expansion below min_gap for GapFluxModelConductionBase");
      25        2134 :   params.addParamNamesToGroup("gap_conductivity min_gap min_gap_order", "Gap conductive flux");
      26        1067 :   return params;
      27           0 : }
      28             : 
      29         407 : GapFluxModelConductionBase::GapFluxModelConductionBase(const InputParameters & parameters)
      30             :   : GapFluxModelBase(parameters),
      31         407 :     _gap_conductivity(getParam<Real>("gap_conductivity")),
      32         814 :     _min_gap(getParam<Real>("min_gap")),
      33        1221 :     _min_gap_order(getParam<unsigned int>("min_gap_order"))
      34             : {
      35         407 : }
      36             : 
      37             : ADReal
      38    26514774 : GapFluxModelConductionBase::computeConductionFlux(const ADReal & secondary_T,
      39             :                                                   const ADReal & primary_T,
      40             :                                                   const ADReal & gap_conductivity_multiplier) const
      41             : {
      42    26514774 :   const auto gap_conductivity = _gap_conductivity * gap_conductivity_multiplier;
      43             : 
      44    26514774 :   return (primary_T - secondary_T) * gap_conductivity * gapAttenuation();
      45             : }
      46             : 
      47             : ADReal
      48    26514774 : GapFluxModelConductionBase::gapAttenuation() const
      49             : {
      50             : 
      51             :   mooseAssert(_min_gap > 0, "min_gap must be larger than zero.");
      52             : 
      53    26514774 :   if (_adjusted_length > _min_gap)
      54             :   {
      55    53029548 :     return 1.0 / _adjusted_length;
      56             :   }
      57             :   else
      58           0 :     switch (_min_gap_order)
      59             :     {
      60           0 :       case 0:
      61           0 :         return 1.0 / _min_gap;
      62             : 
      63           0 :       case 1:
      64           0 :         return 1.0 / _min_gap - (_adjusted_length - _min_gap) / (_min_gap * _min_gap);
      65             : 
      66           0 :       default:
      67           0 :         mooseError(
      68             :             "Invalid Taylor expansion order for gap attenuation in GapFluxModelConductionBase");
      69             :     }
      70             : }

Generated by: LCOV version 1.14