-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ded_mass' into 'devel'
Add powder addition kernel Closes #35 See merge request idaholab/malamute!12
- Loading branch information
Showing
7 changed files
with
251 additions
and
0 deletions.
There are no files selected for viewing
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
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,22 @@ | ||
# LevelSetPowderAddition | ||
|
||
!syntax description /Kernels/LevelSetPowderAddition | ||
|
||
## Description | ||
|
||
In the level set evolution equation, the free surface growth velocity due to the powder addition is given as [!citep](Morville2012), | ||
|
||
\begin{equation} | ||
V_p = N_p \frac{{\eta}_p D_m}{{\rho}_0 \pi r_p^2}\exp\left(-N_p\frac{r^2}{r_p^2}\right), | ||
\end{equation} | ||
where $N_p$ and $r_P$ are the constriction coefficient and the standard deviation of the gaussian distribution. The $r$ is the radial distance. The $\eta_p$ is the powder catchment efficiency. The $\rho_0$ is the powder density. The $D_m$ is the mass powder rate. | ||
|
||
## Example Input Syntax | ||
|
||
!listing test/tests/melt_pool_mass/mass.i block=Kernels/level_set_mass | ||
|
||
!syntax parameters /Kernels/LevelSetPowderAddition | ||
|
||
!syntax inputs /Kernels/LevelSetPowderAddition | ||
|
||
!syntax children /Kernels/LevelSetPowderAddition |
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,53 @@ | ||
/****************************************************************************/ | ||
/* DO NOT MODIFY THIS HEADER */ | ||
/* */ | ||
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */ | ||
/* */ | ||
/* Copyright 2021 - 2022, Battelle Energy Alliance, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/****************************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include "ADKernelValue.h" | ||
|
||
/** | ||
* This class computes the powder addition to the melt pool. | ||
*/ | ||
class LevelSetPowderAddition : public ADKernelValue | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
LevelSetPowderAddition(const InputParameters & parameters); | ||
|
||
protected: | ||
ADReal precomputeQpResidual() override; | ||
|
||
/// Delta function | ||
const ADMaterialProperty<Real> & _delta_function; | ||
|
||
/// Function of laser location in x coordinate | ||
const Function & _laser_location_x; | ||
|
||
/// Function of laser location in x coordinate | ||
const Function & _laser_location_y; | ||
|
||
/// Function of laser location in x coordinate | ||
const Function & _laser_location_z; | ||
|
||
/// Mass addition rate | ||
const Real _mass_rate; | ||
|
||
/// Mass addition gaussian radius | ||
const Real _mass_radius; | ||
|
||
/// Mass addition gaussian scale | ||
const Real _mass_scale; | ||
|
||
/// Powder density | ||
const Real _rho_p; | ||
|
||
/// powder catchment efficiency | ||
const Real _eta_p; | ||
}; |
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,66 @@ | ||
/****************************************************************************/ | ||
/* DO NOT MODIFY THIS HEADER */ | ||
/* */ | ||
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */ | ||
/* */ | ||
/* Copyright 2021 - 2022, Battelle Energy Alliance, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/****************************************************************************/ | ||
|
||
#include "LevelSetPowderAddition.h" | ||
#include "Function.h" | ||
|
||
registerMooseObject("MalamuteApp", LevelSetPowderAddition); | ||
|
||
InputParameters | ||
LevelSetPowderAddition::validParams() | ||
{ | ||
InputParameters params = ADKernelValue::validParams(); | ||
params.addClassDescription("Computes the powder addition to the melt pool"); | ||
params.addParam<FunctionName>( | ||
"laser_location_x", 0, "The laser center function of x coordinate."); | ||
params.addParam<FunctionName>( | ||
"laser_location_y", 0, "The laser center function of y coordinate."); | ||
params.addParam<FunctionName>( | ||
"laser_location_z", 0, "The laser center function of z coordinate."); | ||
params.addRequiredParam<Real>("mass_rate", "Mass rate."); | ||
params.addRequiredParam<Real>("mass_radius", "Mass gaussian radius."); | ||
params.addParam<Real>("mass_scale", 1, "Mass gaussian scale."); | ||
params.addRequiredParam<Real>("powder_density", "Powder density."); | ||
params.addParam<Real>("eta_p", 1.0, "Powder catchment efficiency."); | ||
return params; | ||
} | ||
|
||
LevelSetPowderAddition::LevelSetPowderAddition(const InputParameters & parameters) | ||
: ADKernelValue(parameters), | ||
_delta_function(getADMaterialProperty<Real>("delta_function")), | ||
_laser_location_x(getFunction("laser_location_x")), | ||
_laser_location_y(getFunction("laser_location_y")), | ||
_laser_location_z(getFunction("laser_location_z")), | ||
_mass_rate(getParam<Real>("mass_rate")), | ||
_mass_radius(getParam<Real>("mass_radius")), | ||
_mass_scale(getParam<Real>("mass_scale")), | ||
_rho_p(getParam<Real>("powder_density")), | ||
_eta_p(getParam<Real>("eta_p")) | ||
{ | ||
} | ||
|
||
ADReal | ||
LevelSetPowderAddition::precomputeQpResidual() | ||
{ | ||
Point p(0, 0, 0); | ||
RealVectorValue laser_location(_laser_location_x.value(_t, p), | ||
_laser_location_y.value(_t, p), | ||
_laser_location_z.value(_t, p)); | ||
|
||
ADReal r = (_ad_q_point[_qp] - laser_location).norm(); | ||
|
||
ADReal power_feed = 0; | ||
|
||
if (r <= _mass_radius) | ||
power_feed = _mass_scale * _eta_p * _mass_rate * | ||
std::exp(-_mass_scale * Utility::pow<2>(r / _mass_radius)) / _rho_p / libMesh::pi / | ||
Utility::pow<2>(_mass_radius); | ||
|
||
return _delta_function[_qp] * power_feed; | ||
} |
Binary file not shown.
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,86 @@ | ||
[Mesh/gen] | ||
type = GeneratedMeshGenerator | ||
dim = 2 | ||
xmin = 0 | ||
xmax = 1 | ||
ymin = 0 | ||
ymax = 1 | ||
nx = 40 | ||
ny = 40 | ||
elem_type = QUAD4 | ||
[] | ||
|
||
[ICs] | ||
[ls_ic] | ||
type = FunctionIC | ||
function = ls_exact | ||
variable = ls | ||
[] | ||
[] | ||
|
||
[Variables] | ||
[ls] | ||
[] | ||
[grad_ls] | ||
family = LAGRANGE_VEC | ||
[] | ||
[] | ||
|
||
[Functions/ls_exact] | ||
type = LevelSetOlssonPlane | ||
epsilon = 0.04 | ||
point = '0.5 0.5 0' | ||
normal = '0 1 0' | ||
[] | ||
|
||
[Kernels] | ||
[level_set_time] | ||
type = ADTimeDerivative | ||
variable = ls | ||
[] | ||
|
||
[level_set_mass] | ||
type = LevelSetPowderAddition | ||
laser_location_x = '0.5 + t' | ||
laser_location_y = '0.5' | ||
powder_density = 6000 | ||
eta_p = 1 | ||
mass_scale = 1 | ||
mass_radius = 0.2 | ||
mass_rate = 1000 | ||
variable = ls | ||
[] | ||
|
||
[grad_ls] | ||
type = VariableGradientRegularization | ||
regularized_var = ls | ||
variable = grad_ls | ||
[] | ||
[] | ||
|
||
[Materials] | ||
[delta] | ||
type = LevelSetDeltaFunction | ||
level_set_gradient = grad_ls | ||
[] | ||
[] | ||
|
||
[Preconditioning] | ||
[SMP] | ||
type = SMP | ||
full = true | ||
solve_type = 'NEWTON' | ||
[] | ||
[] | ||
|
||
[Executioner] | ||
type = Transient | ||
solve_type = NEWTON | ||
dt = 1e-2 | ||
nl_abs_tol = 1e-12 | ||
num_steps = 2 | ||
[] | ||
|
||
[Outputs] | ||
exodus = true | ||
[] |
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,10 @@ | ||
[Tests] | ||
issues = '#35' | ||
[mass] | ||
type = 'Exodiff' | ||
input = 'mass.i' | ||
exodiff = 'mass_out.e' | ||
design = 'LevelSetPowderAddition.md' | ||
requirement = 'The system shall evolve the level set variable field with the velocity due to the powder addition.' | ||
[] | ||
[] |