www.mooseframework.org
PFFracBulkRate.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 "PFFracBulkRate.h"
8 #include "MathUtils.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<KernelValue>();
15  params.addClassDescription(
16  "Kernel to compute bulk energy contribution to damage order parameter residual equation");
17  params.addRequiredParam<Real>("l", "Width of the smooth crack representation");
18  params.addRequiredParam<Real>(
19  "visco", "Viscosity parameter, which reflects the transition right at crack stress");
20  params.addRequiredParam<MaterialPropertyName>(
21  "gc_prop_var", "Material property which provides the maximum stress/crack stress");
22  params.addRequiredParam<MaterialPropertyName>(
23  "G0_var", "Material property name with undamaged strain energy driving damage (G0_pos)");
24  params.addParam<MaterialPropertyName>(
25  "dG0_dstrain_var", "Material property name with derivative of G0_pos with strain");
26  params.addRequiredCoupledVar("beta", "Laplacian of the kernel variable");
27 
28  params.addCoupledVar(
29  "displacements",
30  "The displacements appropriate for the simulation geometry and coordinate system");
31  params.addParam<std::string>("base_name",
32  "Optional parameter that allows the user to define "
33  "multiple mechanics material systems on the same "
34  "block, i.e. for multiple phases");
35 
36  return params;
37 }
38 
39 PFFracBulkRate::PFFracBulkRate(const InputParameters & parameters)
40  : KernelValue(parameters),
41  _gc_prop(getMaterialProperty<Real>("gc_prop_var")),
42  _G0_pos(getMaterialProperty<Real>("G0_var")),
43  _dG0_pos_dstrain(isParamValid("dG0_dstrain_var")
44  ? &getMaterialProperty<RankTwoTensor>("dG0_dstrain_var")
45  : NULL),
46  _betaval(coupledValue("beta")),
47  _beta_var(coupled("beta")),
48  _ndisp(coupledComponents("displacements")),
49  _disp_var(_ndisp),
50  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
51  _l(getParam<Real>("l")),
52  _visco(getParam<Real>("visco"))
53 {
54  mooseDeprecated("Use 'SplitPFFractureBulkRate'. Parameter name changes: l->width, "
55  "visco->viscosity, gc_prop_var->gc, G0_var->G0, dG0_dstrain_var->dG0_dstrain");
56  for (unsigned int i = 0; i < _ndisp; ++i)
57  _disp_var[i] = coupled("displacements", i);
58 }
59 
60 Real
62 {
63  const Real gc = _gc_prop[_qp];
64  const Real c = _u[_qp];
65  const Real x = _l * _betaval[_qp] + 2.0 * (1.0 - c) * _G0_pos[_qp] / gc - c / _l;
66 
67  return -((std::abs(x) + x) / 2.0) / _visco;
68 }
69 
70 Real
72 {
73  const Real gc = _gc_prop[_qp];
74  const Real c = _u[_qp];
75  const Real x = _l * _betaval[_qp] + 2.0 * (1.0 - c) * _G0_pos[_qp] / gc - c / _l;
76 
77  return (MathUtils::sign(x) + 1.0) / 2.0 * (2.0 * _G0_pos[_qp] / gc + 1.0 / _l) / _visco *
78  _phi[_j][_qp];
79 }
80 
81 Real
83 {
84  unsigned int c_comp;
85  bool disp_flag = false;
86 
87  const Real c = _u[_qp];
88  const Real gc = _gc_prop[_qp];
89 
90  const Real x = _l * _betaval[_qp] + 2.0 * (1.0 - c) * (_G0_pos[_qp] / gc) - c / _l;
91 
92  const Real signx = MathUtils::sign(x);
93 
94  Real xfacbeta = -((signx + 1.0) / 2.0) / _visco * _l;
95  Real xfac = -((signx + 1.0) / 2.0) / _visco * 2.0 * (1.0 - c) / gc;
96 
97  // Contribution of auxiliary variable to off diag Jacobian of c
98  for (unsigned int k = 0; k < _ndisp; ++k)
99  {
100  if (jvar == _beta_var)
101  return xfacbeta * _phi[_j][_qp] * _test[_i][_qp];
102  else if (jvar == _disp_var[k])
103  {
104  c_comp = k;
105  disp_flag = true;
106  }
107  else
108  return 0.0;
109  }
110 
111  // Contribution of displacements to off diag Jacobian of c
112  if (disp_flag && _dG0_pos_dstrain != NULL)
113  {
114  Real val = 0.0;
115  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
116  val += ((*_dG0_pos_dstrain)[_qp](c_comp, i) + (*_dG0_pos_dstrain)[_qp](i, c_comp)) / 2.0 *
117  _grad_phi[_j][_qp](i);
118 
119  return xfac * val * _test[_i][_qp];
120  }
121 
122  return 0.0;
123 }
Real sign(Real x)
Definition: MathUtils.h:24
const unsigned int _beta_var
Real _visco
Viscosity parameter ( visco -> 0, rate independent )
const VariableValue & _betaval
Auxiliary variable: beta = Laplacian of c.
PFFracBulkRate(const InputParameters &parameters)
const MaterialProperty< Real > & _gc_prop
Critical energy release rate for fracture.
InputParameters validParams< PFFracBulkRate >()
virtual Real precomputeQpJacobian()
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Real _l
Characteristic length, controls damage zone thickness.
const MaterialProperty< Real > & _G0_pos
Contribution of umdamaged strain energy to damage evolution.
virtual Real precomputeQpResidual()
std::vector< unsigned int > _disp_var
const unsigned int _ndisp
Coupled displacement variables.
const MaterialProperty< RankTwoTensor > * _dG0_pos_dstrain
Variation of undamaged strain energy driving damage evolution with strain.