11 #include "MathUtils.h"
21 params.addClassDescription(
"Computes the stress and free energy derivatives for the phase field "
22 "fracture model, with small strain");
23 MooseEnum Decomposition(
"strain_spectral strain_vol_dev stress_spectral none",
"none");
24 params.addParam<MooseEnum>(
"decomposition_type",
26 "Decomposition approaches. Choices are: " +
27 Decomposition.getRawNames());
32 const InputParameters & parameters)
35 _decomposition_type(getParam<MooseEnum>(
"decomposition_type").getEnum<
Decomposition_type>())
45 mooseError(
"Decomposition approach of strain_vol_dev and strain_spectral can only be used with "
46 "isotropic elasticity tensor materials, use stress_spectral for anistropic "
47 "elasticity tensor materials");
59 std::vector<Real> eigval(LIBMESH_DIM);
65 std::vector<RankTwoTensor> etens(LIBMESH_DIM);
67 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
68 etens[i].vectorOuterProduct(eigvec.column(i), eigvec.column(i));
71 std::vector<Real> epos(LIBMESH_DIM), eneg(LIBMESH_DIM);
72 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
74 epos[i] = (std::abs(eigval[i]) + eigval[i]) / 2.0;
75 eneg[i] = -(std::abs(eigval[i]) - eigval[i]) / 2.0;
80 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
83 const Real etrpos = (std::abs(etr) + etr) / 2.0;
84 const Real etrneg = -(std::abs(etr) - etr) / 2.0;
88 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
90 stress0pos += etens[i] * (lambda * etrpos + 2.0 * mu * epos[i]);
91 stress0neg += etens[i] * (lambda * etrneg + 2.0 * mu * eneg[i]);
95 Real pval(0.0), nval(0.0);
96 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
98 pval += epos[i] * epos[i];
99 nval += eneg[i] * eneg[i];
102 _stress[_qp] = stress0pos *
_D[_qp] + stress0neg;
105 F_pos = lambda * etrpos * etrpos / 2.0 + mu * pval;
106 F_neg = -lambda * etrneg * etrneg / 2.0 + mu * nval;
126 std::vector<Real> eigval;
128 RankFourTensor Ppos = stress.positiveProjectionEigenDecomposition(eigval, eigvec);
138 _stress[_qp] = stress0pos *
_D[_qp] + stress0neg;
156 const Real k = lambda + 2.0 * mu / LIBMESH_DIM;
164 Real strain0tr, strain0tr_neg, strain0tr_pos;
169 strain0tr_neg = std::min(strain0tr, 0.0);
170 strain0tr_pos = strain0tr - strain0tr_neg;
171 stress0neg = k * strain0tr_neg * I2;
175 F_pos = 0.5 * k * strain0tr_pos * strain0tr_pos + mu * strain0dev2.trace();
176 F_neg = 0.5 * k * strain0tr_neg * strain0tr_neg;
178 _stress[_qp] = stress0pos *
_D[_qp] + stress0neg;
188 Jacobian_neg = k * I2I2;
228 Real hist_variable =
_H_old[_qp];
230 hist_variable =
_H[_qp];
236 _E[_qp] = hist_variable *
_D[_qp] + F_neg;