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 57 : GapFluxModelSimple::validParams() 16 : { 17 57 : InputParameters params = GapFluxModelBase::validParams(); 18 57 : params.addClassDescription("Gap flux model with a constant conductance"); 19 114 : params.addRequiredCoupledVar("temperature", "The name of the temperature variable"); 20 114 : params.addRequiredParam<Real>("k", "Gap conductance"); 21 114 : params.addParam<Real>("min_gap", 22 114 : 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 57 : return params; 26 0 : } 27 : 28 30 : GapFluxModelSimple::GapFluxModelSimple(const InputParameters & parameters) 29 : : GapFluxModelBase(parameters), 30 30 : _k(getParam<Real>("k")), 31 60 : _min_gap(getParam<Real>("min_gap")), 32 30 : _primary_T(adCoupledNeighborValue("temperature")), 33 60 : _secondary_T(adCoupledValue("temperature")) 34 : { 35 30 : } 36 : 37 : ADReal 38 13428 : GapFluxModelSimple::computeFlux() const 39 : { 40 : using std::max; 41 13428 : const auto l = max(_gap_width, _min_gap); 42 : 43 40284 : return _k * (_primary_T[_qp] - _secondary_T[_qp]) / l; 44 : }