https://mooseframework.inl.gov
FunctionPathEllipsoidHeatSource.C
Go to the documentation of this file.
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 
11 
12 #include "Function.h"
13 
15 
18 {
20  params.addRequiredParam<Real>("power", "power");
21  params.addParam<Real>("efficiency", 1, "process efficiency");
22  params.addRequiredParam<Real>("rx", "effective transverse ellipsoid radius");
23  params.addRequiredParam<Real>("ry", "effective longitudinal ellipsoid radius");
24  params.addRequiredParam<Real>("rz", "effective depth ellipsoid radius");
25  params.addParam<Real>(
26  "factor", 1, "scaling factor that is multiplied to the heat source to adjust the intensity");
27  params.addParam<FunctionName>(
28  "function_x", "0", "The x component of the center of the heating spot as a function of time");
29  params.addParam<FunctionName>(
30  "function_y", "0", "The y component of the center of the heating spot as a function of time");
31  params.addParam<FunctionName>(
32  "function_z", "0", "The z component of the center of the heating spot as a function of time");
33  params.addClassDescription("Double ellipsoid volumetric source heat with function path.");
34 
35  return params;
36 }
37 
39  : Material(parameters),
40  _P(getParam<Real>("power")),
41  _eta(getParam<Real>("efficiency")),
42  _rx(getParam<Real>("rx")),
43  _ry(getParam<Real>("ry")),
44  _rz(getParam<Real>("rz")),
45  _f(getParam<Real>("factor")),
46  _function_x(getFunction("function_x")),
47  _function_y(getFunction("function_y")),
48  _function_z(getFunction("function_z")),
49  _volumetric_heat(declareADProperty<Real>("volumetric_heat"))
50 {
51 }
52 
53 void
55 {
56  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  Real x_t = _function_x.value(_t);
62  Real y_t = _function_y.value(_t);
63  Real z_t = _function_z.value(_t);
64 
65  _volumetric_heat[_qp] = 6.0 * std::sqrt(3.0) * _P * _eta * _f /
66  (_rx * _ry * _rz * std::pow(libMesh::pi, 1.5)) *
67  std::exp(-(3.0 * std::pow(x - x_t, 2.0) / std::pow(_rx, 2.0) +
68  3.0 * std::pow(y - y_t, 2.0) / std::pow(_ry, 2.0) +
69  3.0 * std::pow(z - z_t, 2.0) / std::pow(_rz, 2.0)));
70 }
const MooseArray< Point > & _q_point
const Real _rx
transverse ellipsoid axe
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const Real _rz
longitudinal ellipsoid axe
const std::vector< double > y
void addRequiredParam(const std::string &name, const std::string &doc_string)
unsigned int _qp
static InputParameters validParams()
const std::vector< double > x
registerMooseObject("HeatTransferApp", FunctionPathEllipsoidHeatSource)
Real & _t
const Function & _function_x
path of the heat source, x, y, z components
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
ADMaterialProperty< Real > & _volumetric_heat
virtual Real value(Real t, const Point &p) const
FunctionPathEllipsoidHeatSource(const InputParameters &parameters)
Double ellipsoid heat source distribution.
MooseUnits pow(const MooseUnits &, int)
const Real pi