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 "GrayLambertNeumannBC.h" 11 : #include "MathUtils.h" 12 : 13 : registerMooseObject("HeatTransferApp", GrayLambertNeumannBC); 14 : 15 : Real GrayLambertNeumannBC::_sigma_stefan_boltzmann = 5.670367e-8; 16 : 17 : InputParameters 18 312 : GrayLambertNeumannBC::validParams() 19 : { 20 312 : InputParameters params = IntegratedBC::validParams(); 21 624 : params.addRequiredParam<UserObjectName>("surface_radiation_object_name", 22 : "Name of the GrayLambertSurfaceRadiationBase UO"); 23 624 : params.addParam<bool>( 24 : "reconstruct_emission", 25 624 : true, 26 : "Flag to apply constant heat flux on sideset or reconstruct emission by T^4 law."); 27 312 : params.addClassDescription("This BC imposes a heat flux density that is computed from the " 28 : "GrayLambertSurfaceRadiationBase userobject."); 29 312 : return params; 30 0 : } 31 : 32 164 : GrayLambertNeumannBC::GrayLambertNeumannBC(const InputParameters & parameters) 33 : : IntegratedBC(parameters), 34 164 : _glsr_uo(getUserObject<GrayLambertSurfaceRadiationBase>("surface_radiation_object_name")), 35 492 : _reconstruct_emission(getParam<bool>("reconstruct_emission")) 36 : { 37 164 : } 38 : 39 : Real 40 1136320 : GrayLambertNeumannBC::computeQpResidual() 41 : { 42 1136320 : if (!_reconstruct_emission) 43 367520 : return _test[_i][_qp] * _glsr_uo.getSurfaceHeatFluxDensity(_current_boundary_id); 44 : 45 768800 : Real eps = _glsr_uo.getSurfaceEmissivity(_current_boundary_id); 46 768800 : Real emission = _sigma_stefan_boltzmann * MathUtils::pow(_u[_qp], 4); 47 768800 : return _test[_i][_qp] * eps * (emission - _glsr_uo.getSurfaceIrradiation(_current_boundary_id)); 48 : } 49 : 50 : Real 51 451200 : GrayLambertNeumannBC::computeQpJacobian() 52 : { 53 : // this is not the exact Jacobian but it ensures correct scaling 54 451200 : return _test[_i][_qp] * _sigma_stefan_boltzmann * 55 451200 : _glsr_uo.getSurfaceEmissivity(_current_boundary_id) * 4 * MathUtils::pow(_u[_qp], 3) * 56 451200 : _phi[_j][_qp]; 57 : }