Skip to content

Commit

Permalink
Modernize laser welding 3d input
Browse files Browse the repository at this point in the history
  • Loading branch information
lindsayad committed May 24, 2023
1 parent eb8ecae commit 2cb04ed
Show file tree
Hide file tree
Showing 14 changed files with 316 additions and 414 deletions.
16 changes: 8 additions & 8 deletions modules/heat_conduction/include/bcs/GaussianWeldEnergyFluxBC.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/
//* 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

Expand Down
23 changes: 13 additions & 10 deletions modules/heat_conduction/include/bcs/RadiationEnergyFluxBC.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/
//* 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

Expand All @@ -21,7 +21,10 @@ class RadiationEnergyFluxBC : public ADIntegratedBC
protected:
virtual ADReal computeQpResidual() override;

const ADMaterialProperty<Real> & _sb_constant;
const ADMaterialProperty<Real> & _absorptivity;
/// The Stefan-Boltzmann constant
const MaterialProperty<Real> & _sb_constant;
/// The absorptivity
const MaterialProperty<Real> & _absorptivity;
/// The far-field temperature
const Real _ff_temp;
};
18 changes: 9 additions & 9 deletions modules/heat_conduction/src/bcs/GaussianWeldEnergyFluxBC.C
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/
//* 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("MalamuteApp", GaussianWeldEnergyFluxBC);
registerMooseObject("HeatConductionApp", GaussianWeldEnergyFluxBC);

InputParameters
GaussianWeldEnergyFluxBC::validParams()
Expand Down
22 changes: 11 additions & 11 deletions modules/heat_conduction/src/bcs/RadiationEnergyFluxBC.C
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/
//* 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("MalamuteApp", RadiationEnergyFluxBC);
registerMooseObject("HeatConductionApp", RadiationEnergyFluxBC);

InputParameters
RadiationEnergyFluxBC::validParams()
Expand All @@ -25,8 +25,8 @@ RadiationEnergyFluxBC::validParams()

RadiationEnergyFluxBC::RadiationEnergyFluxBC(const InputParameters & parameters)
: ADIntegratedBC(parameters),
_sb_constant(getADMaterialProperty<Real>("sb_constant")),
_absorptivity(getADMaterialProperty<Real>("absorptivity")),
_sb_constant(getMaterialProperty<Real>("sb_constant")),
_absorptivity(getMaterialProperty<Real>("absorptivity")),
_ff_temp(getParam<Real>("ff_temp"))
{
}
Expand Down
24 changes: 15 additions & 9 deletions modules/navier_stokes/include/bcs/DisplaceBoundaryBC.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/
//* 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

Expand All @@ -21,6 +21,12 @@ class DisplaceBoundaryBC : public ADNodalBC
protected:
virtual ADReal computeQpResidual() override;

const ADReal & _velocity;
/// The velocity vector at the node
const ADRealVectorValue & _velocity;

/// The previous timestep value of the displacement
const Real & _u_old;

/// What component of velocity/displacement this object is acting on
const unsigned short _component;
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/
//* 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

Expand All @@ -21,5 +21,6 @@ class VaporRecoilPressureMomentumFluxBC : public ADVectorIntegratedBC
protected:
virtual ADReal computeQpResidual() override;

/// The recoil pressure
const ADMaterialProperty<Real> & _rc_pressure;
};
27 changes: 15 additions & 12 deletions modules/navier_stokes/src/bcs/DisplaceBoundaryBC.C
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/
//* 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 "DisplaceBoundaryBC.h"

registerMooseObject("MalamuteApp", DisplaceBoundaryBC);
registerMooseObject("NavierStokesApp", DisplaceBoundaryBC);

InputParameters
DisplaceBoundaryBC::validParams()
{
InputParameters params = ADNodalBC::validParams();
params.addClassDescription("For displacing a boundary");
params.addRequiredCoupledVar("velocity", "The velocity at which to displace");
params.addRequiredParam<unsigned short>(
"component", "What component of velocity/displacement this object is acting on.");
return params;
}

DisplaceBoundaryBC::DisplaceBoundaryBC(const InputParameters & parameters)
: ADNodalBC(parameters),
_velocity(adCoupledNodalValue<Real>("velocity")),
_u_old(_var.nodalValueOld())
_velocity(adCoupledNodalValue<RealVectorValue>("velocity")),
_u_old(_var.nodalValueOld()),
_component(getParam<unsigned short>("component"))
{
}

ADReal
DisplaceBoundaryBC::computeQpResidual()
{
return _u - (_u_old + this->_dt * _velocity);
return _u - (_u_old + this->_dt * _velocity(_component));
}
23 changes: 10 additions & 13 deletions modules/navier_stokes/src/bcs/VaporRecoilPressureMomentumFluxBC.C
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/
//* 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 "VaporRecoilPressureMomentumFluxBC.h"

registerMooseObject("MalamuteApp", VaporRecoilPressureMomentumFluxBC);
registerMooseObject("NavierStokesApp", VaporRecoilPressureMomentumFluxBC);

InputParameters
VaporRecoilPressureMomentumFluxBC::validParams()
Expand All @@ -30,8 +30,5 @@ VaporRecoilPressureMomentumFluxBC::VaporRecoilPressureMomentumFluxBC(
ADReal
VaporRecoilPressureMomentumFluxBC::computeQpResidual()
{
return _test[_i][_qp] *
ADRealVectorValue(
std::abs(_normals[_qp](0)), std::abs(_normals[_qp](1)), std::abs(_normals[_qp](2))) *
_rc_pressure[_qp];
return _test[_i][_qp] * _normals[_qp] * _rc_pressure[_qp];
}
12 changes: 7 additions & 5 deletions modules/navier_stokes/src/materials/INSADMaterial.C
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,10 @@ INSADMaterial::subdomainSetup()
// safe for dependencies
_boussinesq_alpha = &_material_data->getADProperty<Real>(
_object_tracker->get<MaterialPropertyName>("alpha", _current_subdomain_id));
_temperature =
&_subproblem
.getStandardVariable(
_tid, _object_tracker->get<std::string>("temperature", _current_subdomain_id))
.adSln();
auto & temp_var = _subproblem.getStandardVariable(
_tid, _object_tracker->get<std::string>("temperature", _current_subdomain_id));
addMooseVariableDependency(&temp_var);
_temperature = &temp_var.adSln();
_ref_temp = &_material_data->getProperty<Real>(
_object_tracker->get<MaterialPropertyName>("ref_temp", _current_subdomain_id));
}
Expand All @@ -114,6 +113,7 @@ INSADMaterial::subdomainSetup()
{
auto & disp_x = _subproblem.getStandardVariable(
_tid, _object_tracker->get<VariableName>("disp_x", _current_subdomain_id));
addMooseVariableDependency(&disp_x);
_disp_x_dot = &disp_x.adUDot();
_disp_x_sys_num = disp_x.sys().number();
_disp_x_num =
Expand All @@ -125,6 +125,7 @@ INSADMaterial::subdomainSetup()
{
auto & disp_y = _subproblem.getStandardVariable(
_tid, _object_tracker->get<VariableName>("disp_y", _current_subdomain_id));
addMooseVariableDependency(&disp_y);
_disp_y_dot = &disp_y.adUDot();
_disp_y_sys_num = disp_y.sys().number();
_disp_y_num =
Expand All @@ -143,6 +144,7 @@ INSADMaterial::subdomainSetup()
{
auto & disp_z = _subproblem.getStandardVariable(
_tid, _object_tracker->get<VariableName>("disp_z", _current_subdomain_id));
addMooseVariableDependency(&disp_z);
_disp_z_dot = &disp_z.adUDot();
_disp_z_sys_num = disp_z.sys().number();
_disp_z_num =
Expand Down
16 changes: 8 additions & 8 deletions modules/navier_stokes/test/include/bcs/CrazyKCPlantFits.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/
//* 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

Expand Down
18 changes: 8 additions & 10 deletions modules/navier_stokes/test/include/bcs/CrazyKCPlantFitsBoundary.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/
//* 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

Expand Down Expand Up @@ -47,8 +47,6 @@ class CrazyKCPlantFitsBoundary : public ADMaterial
ADMaterialProperty<Real> & _surface_tension;
ADMaterialProperty<RealVectorValue> & _grad_surface_tension;
const MooseArray<ADPoint> & _ad_normals;
const MooseArray<ADReal> & _ad_curvatures;
ADMaterialProperty<RealVectorValue> & _surface_term_curvature;
ADMaterialProperty<RealVectorValue> & _surface_term_gradient1;
ADMaterialProperty<RealVectorValue> & _surface_term_gradient2;

Expand Down
18 changes: 9 additions & 9 deletions modules/navier_stokes/test/src/bcs/CrazyKCPlantFits.C
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/****************************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* */
/* MALAMUTE: MOOSE Application Library for Advanced Manufacturing UTilitiEs */
/* */
/* Copyright 2021 - 2023, Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/****************************************************************************/
//* 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 "CrazyKCPlantFits.h"

registerMooseObject("MalamuteApp", CrazyKCPlantFits);
registerMooseObject("NavierStokesTestApp", CrazyKCPlantFits);

InputParameters
CrazyKCPlantFits::validParams()
Expand Down
Loading

0 comments on commit 2cb04ed

Please sign in to comment.