www.mooseframework.org
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ComputeInterfaceStress Class Reference

Calculates an Extra-Stress tensor that lies in the plane of an interface defined by the gradient of an order parameter. More...

#include <ComputeInterfaceStress.h>

Inheritance diagram for ComputeInterfaceStress:
[legend]

Public Member Functions

 ComputeInterfaceStress (const InputParameters &parameters)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void computeQpProperties () override
 

Protected Attributes

std::size_t _nvar
 
std::vector< const VariableGradient * > _grad_v
 
std::vector< Real > _op_range
 
std::vector< Real > _stress
 
MaterialProperty< RankTwoTensor > & _planar_stress
 

Detailed Description

Calculates an Extra-Stress tensor that lies in the plane of an interface defined by the gradient of an order parameter.

Definition at line 26 of file ComputeInterfaceStress.h.

Constructor & Destructor Documentation

◆ ComputeInterfaceStress()

ComputeInterfaceStress::ComputeInterfaceStress ( const InputParameters &  parameters)

Definition at line 43 of file ComputeInterfaceStress.C.

44  : Material(parameters),
45  _nvar(coupledComponents("v")),
46  _grad_v(_nvar),
47  _op_range(getParam<std::vector<Real>>("op_range")),
48  _stress(getParam<std::vector<Real>>("stress")),
50  declareProperty<RankTwoTensor>(getParam<MaterialPropertyName>("planar_stress_name")))
51 {
52  if (_stress.size() == 1)
53  _stress.assign(_nvar, _stress[0]);
54  if (_stress.size() != _nvar)
55  paramError("stress", "Supply either one single stress or one per order parameter");
56 
57  if (_op_range.size() == 1)
58  _op_range.assign(_nvar, _op_range[0]);
59  if (_op_range.size() != _nvar)
60  paramError("op_range", "Supply either one single op_range or one per order parameter");
61 
62  for (MooseIndex(_grad_v) i = 0; i < _nvar; ++i)
63  {
64  _grad_v[i] = &coupledGradient("v", i);
65  _stress[i] /= _op_range[i];
66  }
67 }

Member Function Documentation

◆ computeQpProperties()

void ComputeInterfaceStress::computeQpProperties ( )
overrideprotectedvirtual

Definition at line 70 of file ComputeInterfaceStress.C.

71 {
72  auto & S = _planar_stress[_qp];
73  S.zero();
74 
75  // loop over interface variables
76  for (MooseIndex(_grad_v) i = 0; i < _nvar; ++i)
77  {
78  // compute norm square of the order parameter gradient
79  const Real grad_norm_sq = (*_grad_v[i])[_qp].norm_sq();
80 
81  // gradient square is zero -> no interface -> no interfacial stress contribution
82  if (grad_norm_sq < libMesh::TOLERANCE)
83  continue;
84 
85  const Real nx = (*_grad_v[i])[_qp](0);
86  const Real ny = (*_grad_v[i])[_qp](1);
87  const Real nz = (*_grad_v[i])[_qp](2);
88  const Real s = _stress[i] / std::sqrt(grad_norm_sq);
89 
90  S(0, 0) += (ny * ny + nz * nz) * s;
91  S(0, 1) += -nx * ny * s;
92  S(1, 1) += (nx * nx + nz * nz) * s;
93  S(0, 2) += -nx * nz * s;
94  S(1, 2) += -ny * nz * s;
95  S(2, 2) += (nx * nx + ny * ny) * s;
96  }
97 
98  // fill in symmetrically
99  S(1, 0) = S(0, 1);
100  S(2, 0) = S(0, 2);
101  S(2, 1) = S(1, 2);
102 }

◆ validParams()

InputParameters ComputeInterfaceStress::validParams ( )
static

Definition at line 18 of file ComputeInterfaceStress.C.

19 {
20  InputParameters params = Material::validParams();
21  params.addClassDescription(
22  "Stress in the plane of an interface defined by the gradient of an order parameter");
23  params.addCoupledVar("v",
24  "Order parameters that define the interface. The interface is the region "
25  "where the gradient of this order parameter is non-zero.");
26  params.addRequiredParam<std::vector<Real>>("stress",
27  "Interfacial planar stress magnitude (one "
28  "value to apply to all order parameters or one value "
29  "per order parameter listed in 'v')");
30  params.addRangeCheckedParam<std::vector<Real>>(
31  "op_range",
32  {1.0},
33  "op_range > 0.0",
34  "Range over which order parameters change across an "
35  "interface. By default order parameters are assumed to "
36  "vary from 0 to 1");
37  params.addParam<MaterialPropertyName>("planar_stress_name",
38  "extra_stress",
39  "Material property name for the interfacial planar stress");
40  return params;
41 }

Member Data Documentation

◆ _grad_v

std::vector<const VariableGradient *> ComputeInterfaceStress::_grad_v
protected

Definition at line 37 of file ComputeInterfaceStress.h.

Referenced by ComputeInterfaceStress(), and computeQpProperties().

◆ _nvar

std::size_t ComputeInterfaceStress::_nvar
protected

Definition at line 36 of file ComputeInterfaceStress.h.

Referenced by ComputeInterfaceStress(), and computeQpProperties().

◆ _op_range

std::vector<Real> ComputeInterfaceStress::_op_range
protected

Definition at line 38 of file ComputeInterfaceStress.h.

Referenced by ComputeInterfaceStress().

◆ _planar_stress

MaterialProperty<RankTwoTensor>& ComputeInterfaceStress::_planar_stress
protected

Definition at line 41 of file ComputeInterfaceStress.h.

Referenced by computeQpProperties().

◆ _stress

std::vector<Real> ComputeInterfaceStress::_stress
protected

Definition at line 39 of file ComputeInterfaceStress.h.

Referenced by ComputeInterfaceStress(), and computeQpProperties().


The documentation for this class was generated from the following files:
ComputeInterfaceStress::_nvar
std::size_t _nvar
Definition: ComputeInterfaceStress.h:36
ComputeInterfaceStress::_op_range
std::vector< Real > _op_range
Definition: ComputeInterfaceStress.h:38
ComputeInterfaceStress::_stress
std::vector< Real > _stress
Definition: ComputeInterfaceStress.h:39
ComputeInterfaceStress::_planar_stress
MaterialProperty< RankTwoTensor > & _planar_stress
Definition: ComputeInterfaceStress.h:41
validParams
InputParameters validParams()
ComputeInterfaceStress::_grad_v
std::vector< const VariableGradient * > _grad_v
Definition: ComputeInterfaceStress.h:37