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 "GapFluxModelSimple.h" 11 : 12 : registerMooseObject("HeatTransferApp", GapFluxModelSimple); 13 : 14 : InputParameters 15 123 : GapFluxModelSimple::validParams() 16 : { 17 123 : InputParameters params = GapFluxModelBase::validParams(); 18 123 : params.addClassDescription("Gap flux model with a constant conductance"); 19 246 : params.addRequiredCoupledVar("temperature", "The name of the temperature variable"); 20 246 : params.addRequiredParam<Real>("k", "Gap conductance"); 21 246 : params.addParam<Real>("min_gap", 22 246 : 1e-6, 23 : "The minimum gap distance allowed. This helps with preventing the heat " 24 : "flux from going to infinity as the gap approaches zero."); 25 123 : return params; 26 0 : } 27 : 28 66 : GapFluxModelSimple::GapFluxModelSimple(const InputParameters & parameters) 29 : : GapFluxModelBase(parameters), 30 66 : _k(getParam<Real>("k")), 31 132 : _min_gap(getParam<Real>("min_gap")), 32 66 : _primary_T(adCoupledNeighborValue("temperature")), 33 132 : _secondary_T(adCoupledValue("temperature")) 34 : { 35 66 : } 36 : 37 : ADReal 38 22452 : GapFluxModelSimple::computeFlux() const 39 : { 40 22452 : const auto l = std::max(_gap_width, _min_gap); 41 : 42 67356 : return _k * (_primary_T[_qp] - _secondary_T[_qp]) / l; 43 : }