www.mooseframework.org
LinearIsoElasticPFDamage.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 "libmesh/utility.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<ComputeStressBase>();
15  params.addClassDescription("Phase-field fracture model energy contribution to damage "
16  "growth-isotropic elasticity and undamaged stress under compressive "
17  "strain");
18  params.addRequiredCoupledVar("c",
19  "Order parameter for damage, continuous between 0 and 1, 0 "
20  "represents no damage, 1 represents fully cracked");
21  params.addParam<Real>("kdamage", 1e-6, "Stiffness of damaged matrix");
22 
23  return params;
24 }
25 
26 LinearIsoElasticPFDamage::LinearIsoElasticPFDamage(const InputParameters & parameters)
27  : ComputeStressBase(parameters),
28  _c(coupledValue("c")),
29  _kdamage(getParam<Real>("kdamage")),
30  _G0_pos(declareProperty<Real>("G0_pos")),
31  _dstress_dc(
32  declarePropertyDerivative<RankTwoTensor>(_base_name + "stress", getVar("c", 0)->name())),
33  _dG0_pos_dstrain(declareProperty<RankTwoTensor>("dG0_pos_dstrain")),
34  _etens(LIBMESH_DIM),
35  _epos(LIBMESH_DIM),
36  _eigval(LIBMESH_DIM)
37 {
38 }
39 
40 void
42 {
43  updateVar();
45 }
46 
47 void
49 {
50  // Isotropic elasticity is assumed
51  Real lambda = _elasticity_tensor[_qp](0, 0, 1, 1);
52  Real mu = _elasticity_tensor[_qp](0, 1, 0, 1);
53  Real c = _c[_qp];
54  Real xfac = _kdamage;
55  if (c < 1.0)
56  xfac += Utility::pow<2>(1.0 - c);
57 
58  _mechanical_strain[_qp].symmetricEigenvaluesEigenvectors(_eigval, _eigvec);
59 
60  // Tensors of outerproduct of eigen vectors
61  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
62  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
63  for (unsigned int k = 0; k < LIBMESH_DIM; ++k)
64  _etens[i](j, k) = _eigvec(j, i) * _eigvec(k, i);
65 
66  Real etr = 0.0;
67  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
68  etr += _eigval[i];
69 
70  Real etrpos = (std::abs(etr) + etr) / 2.0;
71  Real etrneg = (std::abs(etr) - etr) / 2.0;
72 
73  RankTwoTensor stress0pos, stress0neg;
74  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
75  {
76  stress0pos +=
77  _etens[i] * (lambda * etrpos + 2.0 * mu * (std::abs(_eigval[i]) + _eigval[i]) / 2.0);
78  stress0neg +=
79  _etens[i] * (lambda * etrneg + 2.0 * mu * (std::abs(_eigval[i]) - _eigval[i]) / 2.0);
80  }
81 
82  // Damage associated with positive component of stress
83  _stress[_qp] = stress0pos * xfac - stress0neg;
84 
85  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
86  _epos[i] = (std::abs(_eigval[i]) + _eigval[i]) / 2.0;
87 
88  Real val = 0.0;
89  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
90  val += Utility::pow<2>(_epos[i]);
91  val *= mu;
92 
93  // Energy with positive principal strains
94  _G0_pos[_qp] = lambda * Utility::pow<2>(etrpos) / 2.0 + val;
95 
96  // Used in PFFracBulkRate Jacobian
97  _dG0_pos_dstrain[_qp] = stress0pos;
98 
99  // Used in StressDivergencePFFracTensors Jacobian
100  if (c < 1.0)
101  _dstress_dc[_qp] = -stress0pos * (2.0 * (1.0 - c));
102  else
103  _dstress_dc[_qp].zero();
104 }
105 
106 void
108 {
110 }
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
MaterialProperty< Real > & _G0_pos
ComputeStressBase is the base class for stress tensors.
MaterialProperty< RankTwoTensor > & _dstress_dc
MaterialProperty< RankTwoTensor > & _stress
std::vector< RankTwoTensor > _etens
LinearIsoElasticPFDamage(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _mechanical_strain
InputParameters validParams< LinearIsoElasticPFDamage >()
MaterialProperty< RankTwoTensor > & _dG0_pos_dstrain
InputParameters validParams< ComputeStressBase >()
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Real _kdamage
Small number to avoid non-positive definiteness at or near complete damage.