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