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