Skip to content

Commit

Permalink
Fixup laser welding objects to current MOOSE standards
Browse files Browse the repository at this point in the history
  • Loading branch information
cticenhour committed Oct 12, 2021
1 parent e7e8392 commit 6a9f132
Show file tree
Hide file tree
Showing 16 changed files with 202 additions and 266 deletions.
21 changes: 6 additions & 15 deletions include/bcs/DisplaceBoundaryBC.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,20 @@
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#ifndef DISPLACEBOUNDARYBC_H
#define DISPLACEBOUNDARYBC_H
#pragma once

#include "ADNodalBC.h"

template <ComputeStage compute_stage>
class DisplaceBoundaryBC;

declareADValidParams(DisplaceBoundaryBC);

template <ComputeStage compute_stage>
class DisplaceBoundaryBC : public ADNodalBC<compute_stage>
class DisplaceBoundaryBC : public ADNodalBC
{
public:
static InputParameters validParams();

DisplaceBoundaryBC(const InputParameters & parameters);

protected:
virtual typename Moose::RealType<compute_stage>::type computeQpResidual() override;
virtual ADReal computeQpResidual() override;

usingNodalBCMembers;

const typename Moose::RealType<compute_stage>::type & _velocity;
const ADReal & _velocity;
const Real & _u_old;
};

#endif /* DISPLACEBOUNDARYBC_H */
25 changes: 8 additions & 17 deletions include/bcs/GaussianWeldEnergyFluxBC.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,24 @@
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#ifndef GAUSSIANWELDENERGYFLUXBC_H
#define GAUSSIANWELDENERGYFLUXBC_H
#pragma once

#include "ADIntegratedBC.h"

template <ComputeStage>
class GaussianWeldEnergyFluxBC;

declareADValidParams(GaussianWeldEnergyFluxBC);

template <ComputeStage compute_stage>
class GaussianWeldEnergyFluxBC : public ADIntegratedBC<compute_stage>
class GaussianWeldEnergyFluxBC : public ADIntegratedBC
{
public:
static InputParameters validParams();

GaussianWeldEnergyFluxBC(const InputParameters & params);

protected:
virtual ADResidual computeQpResidual() override;
virtual ADReal computeQpResidual() override;

const Real _reff;
const Real _F0;
const Real _R;
Function & _x_beam_coord;
Function & _y_beam_coord;
Function & _z_beam_coord;

usingIntegratedBCMembers;
const Function & _x_beam_coord;
const Function & _y_beam_coord;
const Function & _z_beam_coord;
};

#endif /* GAUSSIANWELDENERGYFLUXBC_H */
19 changes: 5 additions & 14 deletions include/bcs/PenaltyDisplaceBoundaryBC.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,19 @@
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#ifndef PENALTYDISPLACEBOUNDARYBC_H
#define PENALTYDISPLACEBOUNDARYBC_H
#pragma once

#include "ADIntegratedBC.h"

template <ComputeStage compute_stage>
class PenaltyDisplaceBoundaryBC;

declareADValidParams(PenaltyDisplaceBoundaryBC);

template <ComputeStage compute_stage>
class PenaltyDisplaceBoundaryBC : public ADIntegratedBC<compute_stage>
class PenaltyDisplaceBoundaryBC : public ADIntegratedBC
{
public:
static InputParameters validParams();

PenaltyDisplaceBoundaryBC(const InputParameters & parameters);

protected:
virtual typename Moose::RealType<compute_stage>::type computeQpResidual() override;

usingIntegratedBCMembers;
virtual ADReal computeQpResidual() override;

const ADVariableValue & _vel_x;
const ADVariableValue & _vel_y;
Expand All @@ -36,5 +29,3 @@ class PenaltyDisplaceBoundaryBC : public ADIntegratedBC<compute_stage>
const ADVariableValue & _disp_z_dot;
const Real _penalty;
};

#endif /* PENALTYDISPLACEBOUNDARYBC_H */
23 changes: 7 additions & 16 deletions include/bcs/RadiationEnergyFluxBC.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,21 @@
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#ifndef RADIATIONENERGYFLUXBC_H
#define RADIATIONENERGYFLUXBC_H
#pragma once

#include "ADIntegratedBC.h"

template <ComputeStage compute_stage>
class RadiationEnergyFluxBC;

declareADValidParams(RadiationEnergyFluxBC);

template <ComputeStage compute_stage>
class RadiationEnergyFluxBC : public ADIntegratedBC<compute_stage>
class RadiationEnergyFluxBC : public ADIntegratedBC
{
public:
static InputParameters validParams();

RadiationEnergyFluxBC(const InputParameters & parameters);

protected:
virtual ADResidual computeQpResidual() override;
virtual ADReal computeQpResidual() override;

const ADMaterialProperty(Real) & _sb_constant;
const ADMaterialProperty(Real) & _absorptivity;
const ADMaterialProperty<Real> & _sb_constant;
const ADMaterialProperty<Real> & _absorptivity;
const Real _ff_temp;

usingIntegratedBCMembers;
};

#endif /* RADIATIONENERGYFLUXBC_H */
25 changes: 8 additions & 17 deletions include/bcs/SurfaceTensionBC.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,22 @@
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#ifndef SURFACETENSIONBC_H
#define SURFACETENSIONBC_H
#pragma once

#include "ADIntegratedBC.h"

template <ComputeStage compute_stage>
class SurfaceTensionBC;

declareADValidParams(SurfaceTensionBC);

template <ComputeStage compute_stage>
class SurfaceTensionBC : public ADIntegratedBC<compute_stage>
class SurfaceTensionBC : public ADIntegratedBC
{
public:
static InputParameters validParams();

SurfaceTensionBC(const InputParameters & parameters);

protected:
virtual ADResidual computeQpResidual() override;

usingIntegratedBCMembers;
virtual ADReal computeQpResidual() override;

const unsigned _component;
const ADMaterialProperty(RealVectorValue) & _surface_term_curvature;
const ADMaterialProperty(RealVectorValue) & _surface_term_gradient1;
const ADMaterialProperty(RealVectorValue) & _surface_term_gradient2;
const ADMaterialProperty<RealVectorValue> & _surface_term_curvature;
const ADMaterialProperty<RealVectorValue> & _surface_term_gradient1;
const ADMaterialProperty<RealVectorValue> & _surface_term_gradient2;
};

#endif /* SURFACETENSIONBC_H */
21 changes: 6 additions & 15 deletions include/bcs/VaporRecoilPressureMomentumFluxBC.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,20 @@
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#ifndef VAPORRECOILPRESSUREMOMENTUMFLUXBC_H
#define VAPORRECOILPRESSUREMOMENTUMFLUXBC_H
#pragma once

#include "ADIntegratedBC.h"

template <ComputeStage compute_stage>
class VaporRecoilPressureMomentumFluxBC;

declareADValidParams(VaporRecoilPressureMomentumFluxBC);

template <ComputeStage compute_stage>
class VaporRecoilPressureMomentumFluxBC : public ADIntegratedBC<compute_stage>
class VaporRecoilPressureMomentumFluxBC : public ADIntegratedBC
{
public:
static InputParameters validParams();

VaporRecoilPressureMomentumFluxBC(const InputParameters & parameters);

protected:
virtual ADResidual computeQpResidual() override;

usingIntegratedBCMembers;
virtual ADReal computeQpResidual() override;

const unsigned _component;
const ADMaterialProperty(Real) & _rc_pressure;
const ADMaterialProperty<Real> & _rc_pressure;
};

#endif /* VAPORRECOILPRESSUREMOMENTUMFLUXBC_H */
23 changes: 7 additions & 16 deletions include/kernels/ADStressDivergence.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,21 @@
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#ifndef ADSTRESSDIVERGENCE_H
#define ADSTRESSDIVERGENCE_H

#pragma once

#include "ADKernel.h"
#include "MaterialProperty.h"

// Forward Declaration
template <ComputeStage compute_stage>
class ADStressDivergence;

declareADValidParams(ADStressDivergence);

template <ComputeStage compute_stage>
class ADStressDivergence : public ADKernel<compute_stage>
class ADStressDivergence : public ADKernel
{
public:
static InputParameters validParams();

ADStressDivergence(const InputParameters & parameters);

protected:
virtual ADResidual computeQpResidual();

ADMaterialProperty(RealVectorValue) const * _stress;
virtual ADReal computeQpResidual();

usingKernelMembers;
ADMaterialProperty<RealVectorValue> const * _stress;
};

#endif // ADSTRESSDIVERGENCE_H
24 changes: 8 additions & 16 deletions include/materials/PseudoSolidStress.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,28 @@
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#ifndef PSEUDOSOLIDSTRESS_H
#define PSEUDOSOLIDSTRESS_H

#include "ADMaterial.h"

template <ComputeStage>
class PseudoSolidStress;
#pragma once

declareADValidParams(PseudoSolidStress);
#include "ADMaterial.h"

/**
* A material that couples a material property
*/
template <ComputeStage compute_stage>
class PseudoSolidStress : public ADMaterial<compute_stage>
class PseudoSolidStress : public ADMaterial
{
public:
static InputParameters validParams();

PseudoSolidStress(const InputParameters & parameters);

protected:
virtual void computeQpProperties();

ADMaterialProperty(RealVectorValue) & _stress_x;
ADMaterialProperty(RealVectorValue) & _stress_y;
ADMaterialProperty(RealVectorValue) & _stress_z;
ADMaterialProperty<RealVectorValue> & _stress_x;
ADMaterialProperty<RealVectorValue> & _stress_y;
ADMaterialProperty<RealVectorValue> & _stress_z;
const ADVariableGradient & _grad_disp_x;
const ADVariableGradient & _grad_disp_y;
const ADVariableGradient & _grad_disp_z;

usingMaterialMembers;
};

#endif // PSEUDOSOLIDSTRESS_H
26 changes: 14 additions & 12 deletions src/bcs/DisplaceBoundaryBC.C
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,26 @@

#include "DisplaceBoundaryBC.h"

registerADMooseObject("LaserWeldingApp", DisplaceBoundaryBC);
registerMooseObject("LaserWeldingApp", DisplaceBoundaryBC);

defineADValidParams(DisplaceBoundaryBC,
ADNodalBC,
params.addClassDescription("For displacing a boundary");
params.addRequiredCoupledVar("velocity", "The velocity at which to displace"););
InputParameters
DisplaceBoundaryBC::validParams()
{
InputParameters params = ADNodalBC::validParams();
params.addClassDescription("For displacing a boundary");
params.addRequiredCoupledVar("velocity", "The velocity at which to displace");
return params;
}

template <ComputeStage compute_stage>
DisplaceBoundaryBC<compute_stage>::DisplaceBoundaryBC(const InputParameters & parameters)
: ADNodalBC<compute_stage>(parameters),
_velocity(adCoupledNodalValue("velocity")),
DisplaceBoundaryBC::DisplaceBoundaryBC(const InputParameters & parameters)
: ADNodalBC(parameters),
_velocity(adCoupledNodalValue<Real>("velocity")),
_u_old(_var.nodalValueOld())
{
}

template <ComputeStage compute_stage>
typename Moose::RealType<compute_stage>::type
DisplaceBoundaryBC<compute_stage>::computeQpResidual()
ADReal
DisplaceBoundaryBC::computeQpResidual()
{
return _u - (_u_old + this->_dt * _velocity);
}
Loading

0 comments on commit 6a9f132

Please sign in to comment.