https://mooseframework.inl.gov
GaussianEnergyFluxBC.h
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 
10 #pragma once
11 
12 #include "ADIntegratedBC.h"
13 
19 {
20 public:
22  static InputParameters beamParams();
23 
24  GaussianEnergyFluxBC(const InputParameters & params);
25 
32  template <typename T, typename PointType>
33  static ADReal beamFlux(const T & flux_obj, const PointType & flux_obj_location);
34 
35 protected:
36  virtual ADReal computeQpResidual() override;
37 
39  const Real _P0;
42  const Real _R;
49 };
50 
51 template <typename T, typename PointType>
52 ADReal
53 GaussianEnergyFluxBC::beamFlux(const T & flux_obj, const PointType & flux_obj_location)
54 {
55  const Point origin(0, 0, 0);
56  const RealVectorValue beam_coords{flux_obj._x_beam_coord.value(flux_obj._t, origin),
57  flux_obj._y_beam_coord.value(flux_obj._t, origin),
58  flux_obj._z_beam_coord.value(flux_obj._t, origin)};
59  const auto r = (flux_obj_location - beam_coords).norm();
60  const auto R2 = flux_obj._R * flux_obj._R;
61  return -2 * flux_obj._P0 / (libMesh::pi * R2) * std::exp(-2 * r * r / R2);
62 }
const Function & _z_beam_coord
the z-coordiinate of the beam center
const Function & _x_beam_coord
the x-coordinate of the beam center
DualNumber< Real, DNDerivativeType, true > ADReal
static InputParameters validParams()
const Real _R
beam radius, specifically the radius at which the beam intensity falls to $1/e^2$ of its axial value ...
static InputParameters beamParams()
const Function & _y_beam_coord
the y-coordinate of the beam center
static ADReal beamFlux(const T &flux_obj, const PointType &flux_obj_location)
Computes the beam flux given data from a flux object and the current integration point in the domain...
Describes an incoming heat flux beam with a Gaussian profile.
auto norm(const T &a) -> decltype(std::abs(a))
GaussianEnergyFluxBC(const InputParameters &params)
virtual ADReal computeQpResidual() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _P0
the total power of the beam
const Real pi