www.mooseframework.org
HyperElasticPhaseFieldIsoDamage.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<FiniteStrainHyperElasticViscoPlastic>();
15  params.addParam<bool>("numerical_stiffness", false, "Flag for numerical stiffness");
16  params.addParam<Real>("damage_stiffness", 1e-8, "Avoid zero after complete damage");
17  params.addParam<Real>("zero_tol", 1e-12, "Tolerance for numerical zero");
18  params.addParam<Real>(
19  "zero_perturb", 1e-8, "Perturbation value when strain value less than numerical zero");
20  params.addParam<Real>("perturbation_scale_factor", 1e-5, "Perturbation scale factor");
21  params.addRequiredCoupledVar("c", "Damage variable");
22  params.addClassDescription(
23  "Computes damaged stress and energy in the intermediate configuration assuming isotropy");
24 
25  return params;
26 }
27 
30  _num_stiffness(getParam<bool>("numerical_stiffness")),
31  _kdamage(getParam<Real>("damage_stiffness")),
32  _zero_tol(getParam<Real>("zero_tol")),
33  _zero_pert(getParam<Real>("zero_perturb")),
34  _pert_val(getParam<Real>("perturbation_scale_factor")),
35  _c(coupledValue("c")),
36  _save_state(false),
37  _G0(declareProperty<Real>(_base_name + "G0")),
38  _dG0_dstrain(declareProperty<RankTwoTensor>(_base_name + "dG0_dstrain")),
39  _dstress_dc(
40  declarePropertyDerivative<RankTwoTensor>(_base_name + "stress", getVar("c", 0)->name())),
41  _etens(LIBMESH_DIM)
42 {
43 }
44 
45 void
47 {
49 
50  _save_state = true;
52  _pk2[_qp] = _pk2_tmp;
53 
54  _save_state = false;
55  if (_num_stiffness)
57 
58  if (_num_stiffness)
60 
61  _dce_dfe.zero();
62  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
63  for (unsigned int j = 0; j < LIBMESH_DIM; ++j)
64  for (unsigned int k = 0; k < LIBMESH_DIM; ++k)
65  {
66  _dce_dfe(i, j, k, i) = _dce_dfe(i, j, k, i) + _fe(k, j);
67  _dce_dfe(i, j, k, j) = _dce_dfe(i, j, k, j) + _fe(k, i);
68  }
69 
71 }
72 
73 void
75 {
76  Real lambda = _elasticity_tensor[_qp](0, 0, 1, 1);
77  Real mu = _elasticity_tensor[_qp](0, 1, 0, 1);
78 
79  Real c = _c[_qp];
80  Real xfac = Utility::pow<2>(1.0 - c) + _kdamage;
81 
82  std::vector<Real> w;
83  RankTwoTensor evec;
84  _ee.symmetricEigenvaluesEigenvectors(w, evec);
85 
86  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
87  _etens[i].vectorOuterProduct(evec.column(i), evec.column(i));
88 
89  Real etr = 0.0;
90  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
91  etr += w[i];
92 
93  Real etrpos = (std::abs(etr) + etr) / 2.0;
94  Real etrneg = (std::abs(etr) - etr) / 2.0;
95 
96  RankTwoTensor pk2pos, pk2neg;
97 
98  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
99  {
100  pk2pos += _etens[i] * (lambda * etrpos + 2.0 * mu * (std::abs(w[i]) + w[i]) / 2.0);
101  pk2neg += _etens[i] * (lambda * etrneg + 2.0 * mu * (std::abs(w[i]) - w[i]) / 2.0);
102  }
103 
104  _pk2_tmp = pk2pos * xfac - pk2neg;
105 
106  if (_save_state)
107  {
108  std::vector<Real> epos(LIBMESH_DIM);
109  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
110  epos[i] = (std::abs(w[i]) + w[i]) / 2.0;
111 
112  _G0[_qp] = 0.0;
113  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
114  _G0[_qp] += Utility::pow<2>(epos[i]);
115  _G0[_qp] *= mu;
116  _G0[_qp] += lambda * Utility::pow<2>(etrpos) / 2.0;
117 
118  _dG0_dee = pk2pos;
119  _dpk2_dc = -pk2pos * (2.0 * (1.0 - c));
120  }
121 }
122 
123 void
125 {
126  RankTwoTensor ee_tmp;
127 
128  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
129  for (unsigned int j = i; j < LIBMESH_DIM; ++j)
130  {
131  Real ee_pert = _zero_pert;
132  if (std::abs(_ee(i, j)) > _zero_tol)
133  ee_pert = _pert_val * std::abs(_ee(i, j));
134 
135  ee_tmp = _ee;
136  _ee(i, j) += ee_pert;
137 
139 
140  for (unsigned int k = 0; k < LIBMESH_DIM; ++k)
141  for (unsigned int l = 0; l < LIBMESH_DIM; ++l)
142  {
143  _dpk2_dee(k, l, i, j) = (_pk2_tmp(k, l) - _pk2[_qp](k, l)) / ee_pert;
144  _dpk2_dee(k, l, j, i) = (_pk2_tmp(k, l) - _pk2[_qp](k, l)) / ee_pert;
145  }
146  _ee = ee_tmp;
147  }
148 }
149 
150 void
152 {
154 
155  RankTwoTensor dG0_dce = _dee_dce.innerProductTranspose(_dG0_dee);
156  RankTwoTensor dG0_dfe = _dce_dfe.innerProductTranspose(dG0_dce);
157  RankTwoTensor dG0_df = _dfe_df.innerProductTranspose(dG0_dfe);
158 
159  _dG0_dstrain[_qp] = _df_dstretch_inc.innerProductTranspose(dG0_df);
160  _dstress_dc[_qp] = _fe.mixedProductIkJl(_fe) * _dpk2_dc;
161 }
This class solves the viscoplastic flow rate equations in the total form Involves 4 different types o...
virtual void computeElasticStrain()
Computes elastic Lagrangian strain.
virtual void computePK2StressAndDerivative()
This function computes PK2 stress.
virtual void computeDamageStress()
This function computes PK2 stress modified to account for damage Computes numerical stiffness if flag...
HyperElasticPhaseFieldIsoDamage(const InputParameters &parameters)
virtual void computeQpJacobian()
This function computes the Jacobian.
Real _zero_pert
Perturbation value for near zero or zero strain components.
InputParameters validParams< HyperElasticPhaseFieldIsoDamage >()
virtual void computeNumStiffness()
This function computes numerical stiffness.
MaterialProperty< RankTwoTensor > & _dG0_dstrain
InputParameters validParams< FiniteStrainHyperElasticViscoPlastic >()
bool _save_state
Flag to save couple material properties.
const VariableValue & _c
Compupled damage variable.
Real _pert_val
Perturbation value for strain components.
Real _zero_tol
Used in numerical stiffness calculation to check near zero values.
MaterialProperty< RankTwoTensor > & _dstress_dc
const MaterialProperty< RankFourTensor > & _elasticity_tensor
bool _num_stiffness
Flag to compute numerical stiffness.
virtual void computeQpJacobian()
This function computes tensors used to construct diagonal and off-diagonal Jacobian.
Real _kdamage
Small stiffness of completely damaged material point.