forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move laser welding heat bcs from malamute into heat conduction
Refs idaholab#24462
- Loading branch information
Showing
4 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
modules/heat_conduction/include/bcs/GaussianWeldEnergyFluxBC.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "ADIntegratedBC.h" | ||
|
||
class GaussianWeldEnergyFluxBC : public ADIntegratedBC | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
GaussianWeldEnergyFluxBC(const InputParameters & params); | ||
|
||
protected: | ||
virtual ADReal computeQpResidual() override; | ||
|
||
const Real _reff; | ||
const Real _F0; | ||
const Real _R; | ||
const Function & _x_beam_coord; | ||
const Function & _y_beam_coord; | ||
const Function & _z_beam_coord; | ||
}; |
30 changes: 30 additions & 0 deletions
30
modules/heat_conduction/include/bcs/RadiationEnergyFluxBC.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "ADIntegratedBC.h" | ||
|
||
class RadiationEnergyFluxBC : public ADIntegratedBC | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
RadiationEnergyFluxBC(const InputParameters & parameters); | ||
|
||
protected: | ||
virtual ADReal computeQpResidual() override; | ||
|
||
/// The Stefan-Boltzmann constant | ||
const MaterialProperty<Real> & _sb_constant; | ||
/// The absorptivity | ||
const MaterialProperty<Real> & _absorptivity; | ||
/// The far-field temperature | ||
const Real _ff_temp; | ||
}; |
49 changes: 49 additions & 0 deletions
49
modules/heat_conduction/src/bcs/GaussianWeldEnergyFluxBC.C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#include "GaussianWeldEnergyFluxBC.h" | ||
#include "Function.h" | ||
|
||
registerMooseObject("HeatConductionApp", GaussianWeldEnergyFluxBC); | ||
|
||
InputParameters | ||
GaussianWeldEnergyFluxBC::validParams() | ||
{ | ||
InputParameters params = ADIntegratedBC::validParams(); | ||
params.addRequiredParam<Real>("reff", | ||
"The effective radius describing the radial distribution of the " | ||
"beam energy. This should be non-dimensional."); | ||
params.addRequiredParam<Real>("F0", "The average heat flux of the laser"); | ||
params.addRequiredParam<Real>("R", "The beam radius"); | ||
params.addParam<FunctionName>("x_beam_coord", 0, "The x coordinate of the center of the beam"); | ||
params.addParam<FunctionName>("y_beam_coord", 0, "The y coordinate of the center of the beam"); | ||
params.addParam<FunctionName>("z_beam_coord", 0, "The z coordinate of the center of the beam"); | ||
return params; | ||
} | ||
|
||
GaussianWeldEnergyFluxBC::GaussianWeldEnergyFluxBC(const InputParameters & params) | ||
: ADIntegratedBC(params), | ||
_reff(getParam<Real>("reff")), | ||
_F0(getParam<Real>("F0")), | ||
_R(getParam<Real>("R")), | ||
_x_beam_coord(getFunction("x_beam_coord")), | ||
_y_beam_coord(getFunction("y_beam_coord")), | ||
_z_beam_coord(getFunction("z_beam_coord")) | ||
{ | ||
} | ||
|
||
ADReal | ||
GaussianWeldEnergyFluxBC::computeQpResidual() | ||
{ | ||
RealVectorValue beam_coords{_x_beam_coord.value(_t, _q_point[_qp]), | ||
_y_beam_coord.value(_t, _q_point[_qp]), | ||
_z_beam_coord.value(_t, _q_point[_qp])}; | ||
auto r = (_ad_q_points[_qp] - beam_coords).norm(); | ||
return -_test[_i][_qp] * 2. * _reff * _F0 * std::exp(-_reff * r * r / (_R * _R)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#include "RadiationEnergyFluxBC.h" | ||
|
||
registerMooseObject("HeatConductionApp", RadiationEnergyFluxBC); | ||
|
||
InputParameters | ||
RadiationEnergyFluxBC::validParams() | ||
{ | ||
InputParameters params = ADIntegratedBC::validParams(); | ||
params.addClassDescription("Computes heat flux due to radiation"); | ||
params.addParam<MaterialPropertyName>( | ||
"sb_constant", "sb_constant", "The stefan-boltzmann constant"); | ||
params.addParam<MaterialPropertyName>("absorptivity", "abs", "The absorptivity of the material"); | ||
params.addRequiredParam<Real>("ff_temp", "The far field temperature"); | ||
return params; | ||
} | ||
|
||
RadiationEnergyFluxBC::RadiationEnergyFluxBC(const InputParameters & parameters) | ||
: ADIntegratedBC(parameters), | ||
_sb_constant(getMaterialProperty<Real>("sb_constant")), | ||
_absorptivity(getMaterialProperty<Real>("absorptivity")), | ||
_ff_temp(getParam<Real>("ff_temp")) | ||
{ | ||
} | ||
|
||
ADReal | ||
RadiationEnergyFluxBC::computeQpResidual() | ||
{ | ||
auto u2 = _u[_qp] * _u[_qp]; | ||
auto u4 = u2 * u2; | ||
auto ff2 = _ff_temp * _ff_temp; | ||
auto ff4 = ff2 * ff2; | ||
return _test[_i][_qp] * _absorptivity[_qp] * _sb_constant[_qp] * (u4 - ff4); | ||
} |