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