Skip to content

Commit

Permalink
First round of review changes ref idaholab#11561
Browse files Browse the repository at this point in the history
  • Loading branch information
bwspenc authored and hchen139 committed Jan 13, 2020
1 parent 46f7372 commit 7b3509e
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The deformation gradient is a fundamental measure of deformation in continuum mechanics. It maps line segments in a reference configuration into line segments (consisting of the same material points) in a deformed configuration.

It peridynamics theory, equivalent deformation gradients can be formulated using the weighted least squares numerical technique, given the fact that it is usually too many line segments connected at each individual material point. Base on the concept of weighted least squares technique, two types of deformation gradient can be formulated in a discretized peridynamics domain.
In peridynamic theory, equivalent deformation gradients can be formulated using the weighted least squares numerical technique, given the fact that it is usually too many line segments connected at each individual material point. Based on the concept of weighted least squares technique, two types of deformation gradient can be formulated in a discretized peridynamics domain.

## Deformation gradient in Continuum Mechanics

Expand All @@ -28,7 +28,7 @@ Substituting above Taylor expansion into previous equation and assuming that $|d
d\mathbf{x} \approx \frac{\partial \chi}{\partial \mathbf{X}}(\mathbf{X}) \cdot d\mathbf{X} \equiv \mathbf{F}(\mathbf{X}) \cdot d\mathbf{X}
\end{equation}

The expression tends to exact as the differential $d\mathbf{X}$ goes to zero.
The expression tends to the exact solution as the differential $d\mathbf{X}$ goes to zero.

The deformation gradient thus characterizes the deformation in the neighborhood of material point $\mathbf{X}$, mapping infinitesimal line segment $d\mathbf{X}$ emanating from $\mathbf{X}$ in the reference configuration to the infinitesimal line segment $d\mathbf{x}$ emanating from $\mathbf{x}$ in the deformed configuration.

Expand Down
14 changes: 12 additions & 2 deletions modules/peridynamics/include/auxkernels/BondStatusPD.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,26 @@ class BondStatusPD : public AuxKernelBasePD
protected:
virtual Real computeValue() override;

/// Option of which failure criterion to be used, with critical_stretch as default
MooseEnum _failure_criterion;
/// Enum class used to control which failure criterion to use
enum class FailureCriterion
{
CriticalStretch,
MaximumTensileStress
};

/// Enum used to control which failure criterion to use
const FailureCriterion _failure_criterion;

/// Bond_status variable
const MooseVariableFEBase & _bond_status_var;

/// Critical AuxVariable
const VariableValue & _critical_val;

/// Material property containing the mechanical stretch
const MaterialProperty<Real> & _mechanical_stretch;

/// Material property containing the stress
const MaterialProperty<RankTwoTensor> * _stress;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ class MaxPrincipalStressNOSPD : public AuxKernelBasePD
protected:
Real computeValue() override;

/// Bond_status variable
/// bond_status variable
const MooseVariableFEBase & _bond_status_var;

/// Stress material property
const MaterialProperty<RankTwoTensor> & _stress;
};

Expand Down
40 changes: 15 additions & 25 deletions modules/peridynamics/src/actions/GeneralizedPlaneStrainActionPD.C
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ validParams<GeneralizedPlaneStrainActionPD>()
params.addParam<Real>("factor", 1.0, "Scale factor applied to prescribed out-of-plane pressure");
params.addParam<bool>("full_jacobian",
false,
"Parameter to set whether to use the nonlocal full jacobian formulation "
"for the scalar components or not");
"Parameter to set whether to use the nonlocal full Jacobian formulation "
"for the scalar components");
params.addParam<bool>(
"use_displaced_mesh",
false,
"Parameter to set whether to use the displaced mesh for computation or not");
"Parameter to set whether to use the displaced mesh for computation");
params.addParam<std::vector<SubdomainName>>("block",
"List of ids of the blocks (subdomains) that the "
"GeneralizedPlaneStrainActionPD will be applied "
Expand Down Expand Up @@ -85,18 +85,13 @@ GeneralizedPlaneStrainActionPD::act()
if (_current_task == "add_kernel")
{
std::string k_type;
switch (_formulation)
{
case 0:
if (_formulation == "OrdinaryState")
k_type = "GeneralizedPlaneStrainOffDiagOSPD"; // Based on ordinary state-based model
break;
case 1:
k_type = "GeneralizedPlaneStrainOffDiagNOSPD"; // Based on bond-associated non-rodinary
// state-based model
break;
default:
mooseError("Unsupported PD formulation. Choose from: OrdinaryState or NonOrdinaryState");
}
else if (_formulation == "NonOrdinaryState")
k_type = "GeneralizedPlaneStrainOffDiagNOSPD"; // Based on bond-associated non-ordinary
// state-based model
else
paramError("formulation", "Unsupported peridynamic formulation. Choose from: OrdinaryState or NonOrdinaryState");

InputParameters params = _factory.getValidParams(k_type);

Expand Down Expand Up @@ -144,17 +139,12 @@ GeneralizedPlaneStrainActionPD::act()
else if (_current_task == "add_user_object")
{
std::string uo_type;
switch (_formulation)
{
case 0:
uo_type = "GeneralizedPlaneStrainUserObjectOSPD";
break;
case 1:
uo_type = "GeneralizedPlaneStrainUserObjectNOSPD";
break;
default:
mooseError("Unsupported PD formulation. Choose from: OrdinaryState or NonOrdinaryState");
}
if (_formulation == "OrdinaryState")
uo_type = "GeneralizedPlaneStrainUserObjectOSPD";
else if (_formulation == "NonOrdinaryState")
uo_type = "GeneralizedPlaneStrainUserObjectNOSPD";
else
paramError("formulation", "Unsupported peridynamic formulation. Choose from: OrdinaryState or NonOrdinaryState");

InputParameters params = _factory.getValidParams(uo_type);

Expand Down
56 changes: 22 additions & 34 deletions modules/peridynamics/src/actions/MechanicsActionPD.C
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ MechanicsActionPD::act()
else if (_current_task == "add_user_object")
{
// add ghosting UO
std::string uo_type = "GhostElemPD";
std::string uo_name = "GhostElemPD";
const std::string uo_type = "GhostElemPD";
const std::string uo_name = "GhostElemPD";

InputParameters params = _factory.getValidParams(uo_type);
params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
Expand All @@ -138,12 +138,12 @@ MechanicsActionPD::act()
}
else if (_current_task == "add_kernel")
{
std::string kernel_type = getKernelType();
const std::string kernel_type = getKernelType();
InputParameters params = getKernelParameters(kernel_type);

for (unsigned int i = 0; i < _ndisp; ++i)
{
std::string kernel_name = "Peridynamics_" + Moose::stringify(i);
const std::string kernel_name = "Peridynamics_" + Moose::stringify(i);

params.set<unsigned int>("component") = i;
params.set<NonlinearVariableName>("variable") = _displacements[i];
Expand All @@ -165,38 +165,26 @@ MechanicsActionPD::getKernelType()
{
std::string type;

switch (_formulation)
if (_formulation == "Bond")
type = "MechanicsBPD";
else if (_formulation == "OrdinaryState")
type = "MechanicsOSPD";
else if (_formulation == "NonOrdinaryState")
{
case 0: // bond based PD formulation
type = "MechanicsBPD";
break;

case 1: // ordinary state based PD formulation
type = "MechanicsOSPD";
break;

case 2: // non-ordinary state based PD formulation
switch (_stabilization)
{
case 0: // fictitious force-stabilized
type = "ForceStabilizedSmallStrainMechanicsNOSPD";
break;

case 1: // self-stabilized
if (_finite_strain_formulation)
type = "FiniteStrainMechanicsNOSPD";
else
type = "SmallStrainMechanicsNOSPD";
break;

default:
mooseError("Unknown PD stabilization scheme. Choose from: Force Self");
}
break;

default:
mooseError("Unsupported PD formulation. Choose from: Bond OrdinaryState NonOrdinaryState");
if (_stabilization == "Force")
type = "ForceStabilizedSmallStrainMechanicsNOSPD";
else if (_stabilization == "Self")
{
if (_finite_strain_formulation)
type = "FiniteStrainMechanicsNOSPD";
else
type = "SmallStrainMechanicsNOSPD";
}
else
paramError("stabilization", "Unknown PD stabilization scheme. Choose from: Force Self");
}
else
paramError("formulation", "Unsupported peridynamic formulation. Choose from: Bond OrdinaryState NonOrdinaryState");

return type;
}
Expand Down
20 changes: 10 additions & 10 deletions modules/peridynamics/src/auxkernels/BondStatusPD.C
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ validParams<BondStatusPD>()
params.addClassDescription("Class for updating the bond status based on different failure "
"criteria: critical stretch and "
"maximum principal stress");
MooseEnum FailureCriteriaType("Critical_Stretch Maximum_Tensile_Stress", "Critical_Stretch");
MooseEnum FailureCriteriaType("CriticalStretch MaximumTensileStress", "CriticalStretch");
params.addParam<MooseEnum>(
"failure_criterion", FailureCriteriaType, "Which failure criterion to be used");
params.addRequiredCoupledVar("critical_variable", "Name of critical AuxVariable");
Expand All @@ -31,18 +31,18 @@ validParams<BondStatusPD>()

BondStatusPD::BondStatusPD(const InputParameters & parameters)
: AuxKernelBasePD(parameters),
_failure_criterion(getParam<MooseEnum>("failure_criterion")),
_failure_criterion(getParam<MooseEnum>("failure_criterion").getEnum<FailureCriterion>()),
_bond_status_var(_subproblem.getVariable(_tid, "bond_status")),
_critical_val(coupledValue("critical_variable")),
_mechanical_stretch(getMaterialProperty<Real>("mechanical_stretch")),
_stress(NULL)
{
switch (_failure_criterion)
{
case 0:
case FailureCriterion::CriticalStretch:
break;

case 1:
case FailureCriterion::MaximumTensileStress:
{
if (hasMaterialProperty<RankTwoTensor>("stress"))
_stress = &getMaterialProperty<RankTwoTensor>("stress");
Expand All @@ -53,8 +53,8 @@ BondStatusPD::BondStatusPD(const InputParameters & parameters)
}

default:
mooseError("Unsupported PD failure criterion. Choose from: Critical_Stretch and "
"Maximum_Principal_Stress");
paramError("failure_criterion", "Unsupported PD failure criterion. Choose from: CriticalStretch and "
"MaximumPrincipalStress");
}
}

Expand All @@ -65,11 +65,11 @@ BondStatusPD::computeValue()

switch (_failure_criterion)
{
case 0:
case FailureCriterion::CriticalStretch:
val = _mechanical_stretch[0];
break;

case 1:
case FailureCriterion::MaximumTensileStress:
{
RankTwoTensor avg_stress = 0.5 * ((*_stress)[0] + (*_stress)[1]);
std::vector<Real> eigvals(LIBMESH_DIM, 0.0);
Expand All @@ -82,8 +82,8 @@ BondStatusPD::computeValue()
}

default:
mooseError("Unsupported PD failure criterion. Choose from: Critical_Stretch and "
"Maximum_Principal_Stress");
paramError("failure_criterion", "Unsupported PD failure criterion. Choose from: CriticalStretch and "
"MaximumPrincipalStress");
}

if (_bond_status_var.getElementalValue(_current_elem) > 0.5 && val < _critical_val[0])
Expand Down
2 changes: 1 addition & 1 deletion modules/peridynamics/src/auxkernels/MechanicalStretchPD.C
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ InputParameters
validParams<MechanicalStretchPD>()
{
InputParameters params = validParams<AuxKernelBasePD>();
params.addClassDescription("Class for outputing bond mechanical stretch value");
params.addClassDescription("Class for outputing bond mechanical stretch");
params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;

return params;
Expand Down

0 comments on commit 7b3509e

Please sign in to comment.