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 "FunctionPathEllipsoidHeatSource.h" 11 : 12 : #include "Function.h" 13 : 14 : registerMooseObject("HeatTransferApp", FunctionPathEllipsoidHeatSource); 15 : 16 : InputParameters 17 85 : FunctionPathEllipsoidHeatSource::validParams() 18 : { 19 85 : InputParameters params = Material::validParams(); 20 170 : params.addRequiredParam<Real>("power", "power"); 21 170 : params.addParam<Real>("efficiency", 1, "process efficiency"); 22 170 : params.addRequiredParam<Real>("rx", "effective transverse ellipsoid radius"); 23 170 : params.addRequiredParam<Real>("ry", "effective longitudinal ellipsoid radius"); 24 170 : params.addRequiredParam<Real>("rz", "effective depth ellipsoid radius"); 25 170 : params.addParam<Real>( 26 170 : "factor", 1, "scaling factor that is multiplied to the heat source to adjust the intensity"); 27 170 : params.addParam<FunctionName>( 28 : "function_x", "0", "The x component of the center of the heating spot as a function of time"); 29 170 : params.addParam<FunctionName>( 30 : "function_y", "0", "The y component of the center of the heating spot as a function of time"); 31 170 : params.addParam<FunctionName>( 32 : "function_z", "0", "The z component of the center of the heating spot as a function of time"); 33 85 : params.addClassDescription("Double ellipsoid volumetric source heat with function path."); 34 : 35 85 : return params; 36 0 : } 37 : 38 66 : FunctionPathEllipsoidHeatSource::FunctionPathEllipsoidHeatSource(const InputParameters & parameters) 39 : : Material(parameters), 40 66 : _P(getParam<Real>("power")), 41 132 : _eta(getParam<Real>("efficiency")), 42 132 : _rx(getParam<Real>("rx")), 43 132 : _ry(getParam<Real>("ry")), 44 132 : _rz(getParam<Real>("rz")), 45 132 : _f(getParam<Real>("factor")), 46 66 : _function_x(getFunction("function_x")), 47 66 : _function_y(getFunction("function_y")), 48 66 : _function_z(getFunction("function_z")), 49 132 : _volumetric_heat(declareADProperty<Real>("volumetric_heat")) 50 : { 51 66 : } 52 : 53 : void 54 364000 : FunctionPathEllipsoidHeatSource::computeQpProperties() 55 : { 56 364000 : const Real & x = _q_point[_qp](0); 57 : const Real & y = _q_point[_qp](1); 58 : const Real & z = _q_point[_qp](2); 59 : 60 : // center of the heat source 61 364000 : Real x_t = _function_x.value(_t); 62 364000 : Real y_t = _function_y.value(_t); 63 364000 : Real z_t = _function_z.value(_t); 64 : 65 364000 : _volumetric_heat[_qp] = 6.0 * std::sqrt(3.0) * _P * _eta * _f / 66 728000 : (_rx * _ry * _rz * std::pow(libMesh::pi, 1.5)) * 67 364000 : std::exp(-(3.0 * std::pow(x - x_t, 2.0) / std::pow(_rx, 2.0) + 68 364000 : 3.0 * std::pow(y - y_t, 2.0) / std::pow(_ry, 2.0) + 69 364000 : 3.0 * std::pow(z - z_t, 2.0) / std::pow(_rz, 2.0))); 70 364000 : }