Skip to content

Commit

Permalink
Move laser welding heat bcs from malamute into heat conduction
Browse files Browse the repository at this point in the history
  • Loading branch information
lindsayad authored and tanoret committed Jul 10, 2023
1 parent 3896545 commit e4c41c4
Show file tree
Hide file tree
Showing 4 changed files with 151 additions and 0 deletions.
30 changes: 30 additions & 0 deletions modules/heat_conduction/include/bcs/GaussianWeldEnergyFluxBC.h
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 modules/heat_conduction/include/bcs/RadiationEnergyFluxBC.h
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 modules/heat_conduction/src/bcs/GaussianWeldEnergyFluxBC.C
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));
}
42 changes: 42 additions & 0 deletions modules/heat_conduction/src/bcs/RadiationEnergyFluxBC.C
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);
}

0 comments on commit e4c41c4

Please sign in to comment.