www.mooseframework.org
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)
 

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 25 of file ComputeInterfaceStress.h.

Constructor & Destructor Documentation

◆ ComputeInterfaceStress()

ComputeInterfaceStress::ComputeInterfaceStress ( const InputParameters &  parameters)

Definition at line 42 of file ComputeInterfaceStress.C.

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

Member Function Documentation

◆ computeQpProperties()

void ComputeInterfaceStress::computeQpProperties ( )
overrideprotectedvirtual

Definition at line 69 of file ComputeInterfaceStress.C.

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

Member Data Documentation

◆ _grad_v

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

Definition at line 34 of file ComputeInterfaceStress.h.

Referenced by ComputeInterfaceStress(), and computeQpProperties().

◆ _nvar

std::size_t ComputeInterfaceStress::_nvar
protected

Definition at line 33 of file ComputeInterfaceStress.h.

Referenced by ComputeInterfaceStress(), and computeQpProperties().

◆ _op_range

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

Definition at line 35 of file ComputeInterfaceStress.h.

Referenced by ComputeInterfaceStress().

◆ _planar_stress

MaterialProperty<RankTwoTensor>& ComputeInterfaceStress::_planar_stress
protected

Definition at line 38 of file ComputeInterfaceStress.h.

Referenced by computeQpProperties().

◆ _stress

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

Definition at line 36 of file ComputeInterfaceStress.h.

Referenced by ComputeInterfaceStress(), and computeQpProperties().


The documentation for this class was generated from the following files: