www.mooseframework.org
ComputeInterfaceStress.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
8 #include "RankTwoTensor.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<Material>();
15  params.addClassDescription(
16  "Stress in the plane of an interface defined by the gradient of an order parameter");
17  params.addCoupledVar("v",
18  "Order parameter that defines the interface. The interface is the region "
19  "where the gradient of this order parameter is non-zero.");
20  params.addRequiredParam<Real>("stress", "Planar stress");
21  params.addRangeCheckedParam<Real>("op_range",
22  1.0,
23  "op_range > 0.0",
24  "Range over which order parameters change across an "
25  "interface. By default order parameters are assumed to "
26  "vary from 0 to 1");
27  params.addParam<MaterialPropertyName>(
28  "planar_stress_name", "extra_stress", "Material property name for the planar stress");
29  return params;
30 }
31 
32 ComputeInterfaceStress::ComputeInterfaceStress(const InputParameters & parameters)
33  : Material(parameters),
34  _grad_v(coupledGradient("v")),
35  _stress(getParam<Real>("stress") / getParam<Real>("op_range")),
36  _planar_stress(
37  declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("planar_stress_name")))
38 {
39 }
40 
41 void
43 {
44  auto & S = _planar_stress[_qp];
45 
46  // no interface, return zero stress
47  const Real grad_norm_sq = _grad_v[_qp].norm_sq();
48  if (grad_norm_sq < libMesh::TOLERANCE)
49  {
50  S.zero();
51  return;
52  }
53 
54  const Real nx = _grad_v[_qp](0);
55  const Real ny = _grad_v[_qp](1);
56  const Real nz = _grad_v[_qp](2);
57  const Real s = _stress / std::sqrt(grad_norm_sq);
58 
59  S(0, 0) = (ny * ny + nz * nz) * s;
60  S(1, 0) = S(0, 1) = -nx * ny * s;
61  S(1, 1) = (nx * nx + nz * nz) * s;
62  S(2, 0) = S(0, 2) = -nx * nz * s;
63  S(2, 1) = S(1, 2) = -ny * nz * s;
64  S(2, 2) = (nx * nx + ny * ny) * s;
65 }
ComputeInterfaceStress(const InputParameters &parameters)
InputParameters validParams< ComputeInterfaceStress >()
virtual void computeQpProperties() override
const VariableGradient & _grad_v
MaterialProperty< RankTwoTensor > & _planar_stress