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 "GaussianEnergyFluxBC.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("HeatTransferApp", GaussianEnergyFluxBC); 14 : 15 : InputParameters 16 19 : GaussianEnergyFluxBC::beamParams() 17 : { 18 19 : auto params = emptyInputParameters(); 19 38 : params.addRequiredParam<Real>("P0", "The total power of the beam."); 20 38 : params.addRequiredParam<Real>( 21 : "R", "The radius at which the beam intensity falls to $1/e^2$ of its axis value."); 22 57 : auto beam_coord_doc = [](const std::string & coord) 23 : { 24 57 : return "The " + coord + 25 : " coordinate of the center of the beam as a function of time. Note that we will pass " 26 : "the origin as the spatial argument to the function; any spatial dependence in the " 27 57 : "passed-in function will be ignored"; 28 : }; 29 38 : params.addParam<FunctionName>("x_beam_coord", 0, beam_coord_doc("x")); 30 38 : params.addParam<FunctionName>("y_beam_coord", 0, beam_coord_doc("y")); 31 38 : params.addParam<FunctionName>("z_beam_coord", 0, beam_coord_doc("z")); 32 19 : return params; 33 0 : } 34 : 35 : InputParameters 36 19 : GaussianEnergyFluxBC::validParams() 37 : { 38 19 : InputParameters params = ADIntegratedBC::validParams(); 39 19 : params += GaussianEnergyFluxBC::beamParams(); 40 19 : params.addClassDescription("Describes an incoming heat flux beam with a Gaussian profile"); 41 19 : return params; 42 0 : } 43 : 44 10 : GaussianEnergyFluxBC::GaussianEnergyFluxBC(const InputParameters & params) 45 : : ADIntegratedBC(params), 46 10 : _P0(getParam<Real>("P0")), 47 20 : _R(getParam<Real>("R")), 48 10 : _x_beam_coord(getFunction("x_beam_coord")), 49 10 : _y_beam_coord(getFunction("y_beam_coord")), 50 20 : _z_beam_coord(getFunction("z_beam_coord")) 51 : { 52 10 : } 53 : 54 : ADReal 55 10560 : GaussianEnergyFluxBC::computeQpResidual() 56 : { 57 10560 : return _test[_i][_qp] * beamFlux(*this, _ad_q_points[_qp]); 58 : }