https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
20public:
23
25
32 template <typename T, typename PointType>
33 static ADReal beamFlux(const T & flux_obj, const PointType & flux_obj_location);
34
35protected:
36 virtual ADReal computeQpResidual() override;
37
39 const Real _P0;
42 const Real _R;
49};
50
51template <typename T, typename PointType>
53GaussianEnergyFluxBC::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
62 using std::exp;
63 return -2 * flux_obj._P0 / (libMesh::pi * R2) * exp(-2 * r * r / R2);
64}
DualNumber< Real, DNDerivativeType, true > ADReal
const double T
Describes an incoming heat flux beam with a Gaussian profile.
static InputParameters validParams()
const Function & _z_beam_coord
the z-coordiinate of the beam center
const Real _P0
the total power of the beam
static InputParameters beamParams()
virtual ADReal computeQpResidual() override
const Real _R
beam radius, specifically the radius at which the beam intensity falls to $1/e^2$ of its axial value
const Function & _y_beam_coord
the y-coordinate of the beam center
const Function & _x_beam_coord
the x-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,...
const Real pi