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 "LinearFVP1TemperatureSourceSink.h" 11 : #include "HeatConductionNames.h" 12 : #include "MathUtils.h" 13 : 14 : registerMooseObject("HeatTransferApp", LinearFVP1TemperatureSourceSink); 15 : 16 : InputParameters 17 48 : LinearFVP1TemperatureSourceSink::validParams() 18 : { 19 48 : InputParameters params = LinearFVElementalKernel::validParams(); 20 48 : params.addClassDescription( 21 : "Implements the source and sink term for the temperature in the P1 radiation formulation."); 22 96 : params.addRequiredParam<MooseFunctorName>("G", "The incident radiation in the P1 model."); 23 96 : params.addParam<MooseFunctorName>( 24 96 : "absorption_coeff", 1.0, "The absorption coefficient of the material."); 25 48 : return params; 26 0 : } 27 : 28 24 : LinearFVP1TemperatureSourceSink::LinearFVP1TemperatureSourceSink(const InputParameters & params) 29 : : LinearFVElementalKernel(params), 30 24 : _G(getFunctor<Real>("G")), 31 72 : _sigma_a(getFunctor<Real>("absorption_coeff")) 32 : { 33 24 : } 34 : 35 : Real 36 56100 : LinearFVP1TemperatureSourceSink::computeMatrixContribution() 37 : { 38 56100 : const auto elem_arg = makeElemArg(_current_elem_info->elem()); 39 56100 : const auto state_arg = determineState(); 40 : 41 56100 : return 4.0 * HeatConduction::Constants::sigma * 42 56100 : MathUtils::pow(_var.getElemValue(*_current_elem_info, state_arg), 3) * 43 56100 : _sigma_a(elem_arg, state_arg) * _current_elem_volume; 44 : } 45 : 46 : Real 47 56100 : LinearFVP1TemperatureSourceSink::computeRightHandSideContribution() 48 : { 49 56100 : const auto elem_arg = makeElemArg(_current_elem_info->elem()); 50 56100 : const auto state_arg = determineState(); 51 : 52 56100 : return _sigma_a(elem_arg, state_arg) * _G(elem_arg, state_arg) * _current_elem_volume; 53 : }