www.mooseframework.org
AllenCahnPFFracture.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 /****************************************************************/
7 #include "AllenCahnPFFracture.h"
8 #include "MathUtils.h"
9 #include "RankTwoTensor.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<Kernel>();
16  params.addClassDescription(
17  "Kernel to compute bulk energy contribution to damage order parameter residual equation");
18  params.addParam<MaterialPropertyName>("l_name", "l", "Interface width");
19  params.addParam<MaterialPropertyName>("visco_name", "visco", "Viscosity parameter");
20  params.addParam<MaterialPropertyName>("gc", "gc_prop", "Critical fracture energy density");
21  params.addRequiredCoupledVar("beta", "Variable storing the laplacian of c");
22  params.addCoupledVar("displacements",
23  "The string of displacements suitable for the problem statement");
24  params.addParam<MaterialPropertyName>(
25  "F_name", "E_el", "Name of material property storing the elastic energy");
26 
27  return params;
28 }
29 
30 AllenCahnPFFracture::AllenCahnPFFracture(const InputParameters & parameters)
31  : DerivativeMaterialInterface<JvarMapKernelInterface<Kernel>>(parameters),
32  _gc_prop(getMaterialProperty<Real>("gc")),
33  _beta(coupledValue("beta")),
34  _beta_var(coupled("beta")),
35  _ndisp(coupledComponents("displacements")),
36  _disp_var(_ndisp),
37  _l(getMaterialProperty<Real>("l_name")),
38  _visco(getMaterialProperty<Real>("visco_name")),
39  _dFdc(getMaterialPropertyDerivative<Real>("F_name", _var.name())),
40  _d2Fdc2(getMaterialPropertyDerivative<Real>("F_name", _var.name(), _var.name())),
41  _d2Fdcdstrain(getMaterialProperty<RankTwoTensor>("d2Fdcdstrain"))
42 {
43  for (unsigned int i = 0; i < _ndisp; ++i)
44  _disp_var[i] = coupled("displacements", i);
45 }
46 
47 Real
49 {
50  const Real x =
51  (_l[_qp] * _beta[_qp] - _dFdc[_qp] / _gc_prop[_qp] - _u[_qp] / _l[_qp]) * _test[_i][_qp];
52  return -(std::abs(x) + x) / 2.0 / _visco[_qp];
53 }
54 
55 Real
57 {
58  const Real x =
59  (_l[_qp] * _beta[_qp] - _dFdc[_qp] / _gc_prop[_qp] - _u[_qp] / _l[_qp]) * _test[_i][_qp];
60  const Real dx = (_d2Fdc2[_qp] - 1.0 / _l[_qp]) * _phi[_j][_qp] * _test[_i][_qp];
61  return -(MathUtils::sign(x) + 1.0) / 2.0 * dx / _visco[_qp];
62 }
63 
64 Real
66 {
67  const Real x =
68  (_l[_qp] * _beta[_qp] - _dFdc[_qp] / _gc_prop[_qp] - _u[_qp] / _l[_qp]) * _test[_i][_qp];
69 
70  if (jvar == _beta_var)
71  return -(MathUtils::sign(x) + 1.0) / 2.0 / _visco[_qp] * _l[_qp] * _phi[_j][_qp] *
72  _test[_i][_qp];
73  else
74  for (unsigned int c_comp = 0; c_comp < _ndisp; ++c_comp)
75  if (jvar == _disp_var[c_comp])
76  {
77  const Real dxddFdc = -1.0 / _gc_prop[_qp] * _test[_i][_qp];
78  const Real d2Fdcdstrain_comp =
79  (_d2Fdcdstrain[_qp].column(c_comp) + _d2Fdcdstrain[_qp].row(c_comp)) / 2.0 *
80  _grad_phi[_j][_qp];
81  return -(MathUtils::sign(x) + 1.0) / 2.0 / _visco[_qp] * dxddFdc * d2Fdcdstrain_comp;
82  }
83 
84  return 0.0;
85 }
const MaterialProperty< Real > & _visco
Viscosity parameter ( visco -> 0, rate independent )
Real sign(Real x)
Definition: MathUtils.h:24
const MaterialProperty< Real > & _dFdc
Free energy material properties and derivatives.
const MaterialProperty< RankTwoTensor > & _d2Fdcdstrain
const unsigned int _beta_var
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
const MaterialProperty< Real > & _l
Characteristic length, controls damage zone thickness.
virtual Real computeQpJacobian() override
AllenCahnPFFracture(const InputParameters &parameters)
const unsigned int _ndisp
Displacement variables used for off-diagonal Jacobian.
const VariableValue & _beta
Coupled variable that is the laplacian of c.
std::vector< unsigned int > _disp_var
const MaterialProperty< Real > & _d2Fdc2
InputParameters validParams< AllenCahnPFFracture >()
virtual Real computeQpResidual() override
const MaterialProperty< Real > & _gc_prop
Critical energy release rate for fracture.