www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ComputeCrackedStress Class Reference

Computes energy and modifies the stress for phase field fracture. More...

#include <ComputeCrackedStress.h>

Inheritance diagram for ComputeCrackedStress:
[legend]

Public Member Functions

 ComputeCrackedStress (const InputParameters &parameters)
 

Protected Member Functions

virtual void computeQpProperties ()
 
virtual void initQpStatefulProperties ()
 

Protected Attributes

const std::string _base_name
 Base name of the stress after being modified to include cracks. More...
 
const std::string _uncracked_base_name
 Base name of the uncracked stress and strain. More...
 
bool _finite_strain_model
 Indicator if finite strain model is used, to determine if mechanical_strain or elastic_strain should be used. More...
 
bool _use_current_hist
 Use current value of history variable. More...
 
const MaterialProperty< RankTwoTensor > & _strain
 Mechanical_strain if finite_strain_model = false, otherwise elastic_strain. More...
 
const MaterialProperty< RankTwoTensor > & _uncracked_stress
 Uncracked stress calculated by another material. More...
 
const MaterialProperty< RankFourTensor > & _uncracked_Jacobian_mult
 Uncracked Jacobian_mult calculated by another material. More...
 
const VariableValue & _c
 Variable defining the phase field damage parameter. More...
 
const MaterialProperty< Real > & _gc_prop
 Critical energy release rate for fracture. More...
 
const MaterialProperty< Real > & _l
 Characteristic length, controls damage zone thickness. More...
 
const MaterialProperty< Real > & _visco
 
Real _kdamage
 Small number to avoid non-positive definiteness at or near complete damage. More...
 
MaterialProperty< RankTwoTensor > & _stress
 Stress being computed by this kernel. More...
 
MaterialProperty< Real > & _F
 
MaterialProperty< Real > & _dFdc
 
MaterialProperty< Real > & _d2Fdc2
 
MaterialProperty< RankTwoTensor > & _d2Fdcdstrain
 
MaterialProperty< RankTwoTensor > & _dstress_dc
 
MaterialProperty< Real > & _hist
 history variable storing the maximum positive deformation energy More...
 
const MaterialProperty< Real > & _hist_old
 
MaterialProperty< RankFourTensor > & _Jacobian_mult
 derivative of stress w.r.t. strain (_dstress_dstrain) More...
 
MaterialProperty< Real > & _kappa
 Property where the value for kappa will be defined. More...
 
MaterialProperty< Real > & _L
 Property where the value for L will be defined. More...
 

Detailed Description

Computes energy and modifies the stress for phase field fracture.

Can be used with any constitutive model or elastic symmetry.

Definition at line 28 of file ComputeCrackedStress.h.

Constructor & Destructor Documentation

◆ ComputeCrackedStress()

ComputeCrackedStress::ComputeCrackedStress ( const InputParameters &  parameters)

Definition at line 39 of file ComputeCrackedStress.C.

40  : DerivativeMaterialInterface<Material>(parameters),
41  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
42  _uncracked_base_name(getParam<std::string>("uncracked_base_name") + "_"),
43  _finite_strain_model(getParam<bool>("finite_strain_model")),
44  _use_current_hist(getParam<bool>("use_current_history_variable")),
45  _strain(
47  ? getMaterialPropertyByName<RankTwoTensor>(_uncracked_base_name + "elastic_strain")
48  : getMaterialPropertyByName<RankTwoTensor>(_uncracked_base_name + "mechanical_strain")),
49  _uncracked_stress(getMaterialPropertyByName<RankTwoTensor>(_uncracked_base_name + "stress")),
51  getMaterialPropertyByName<RankFourTensor>(_uncracked_base_name + "Jacobian_mult")),
52  _c(coupledValue("c")),
53  _gc_prop(getMaterialProperty<Real>("gc_prop")),
54  _l(getMaterialProperty<Real>("l")),
55  _visco(getMaterialProperty<Real>("visco")),
56  _kdamage(getParam<Real>("kdamage")),
57  _stress(declareProperty<RankTwoTensor>(_base_name + "stress")),
58  _F(declareProperty<Real>(getParam<MaterialPropertyName>("F_name"))),
59  _dFdc(declarePropertyDerivative<Real>(getParam<MaterialPropertyName>("F_name"),
60  getVar("c", 0)->name())),
61  _d2Fdc2(declarePropertyDerivative<Real>(
62  getParam<MaterialPropertyName>("F_name"), getVar("c", 0)->name(), getVar("c", 0)->name())),
63  _d2Fdcdstrain(declareProperty<RankTwoTensor>("d2Fdcdstrain")),
64  _dstress_dc(declarePropertyDerivative<RankTwoTensor>("stress", getVar("c", 0)->name())),
65  _hist(declareProperty<Real>("hist")),
66  _hist_old(getMaterialPropertyOld<Real>("hist")),
67  _Jacobian_mult(declareProperty<RankFourTensor>(_base_name + "Jacobian_mult")),
68  _kappa(declareProperty<Real>(getParam<MaterialPropertyName>("kappa_name"))),
69  _L(declareProperty<Real>(getParam<MaterialPropertyName>("mobility_name")))
70 {
71 }
const MaterialProperty< Real > & _hist_old
const VariableValue & _c
Variable defining the phase field damage parameter.
MaterialProperty< Real > & _kappa
Property where the value for kappa will be defined.
const MaterialProperty< RankTwoTensor > & _strain
Mechanical_strain if finite_strain_model = false, otherwise elastic_strain.
MaterialProperty< Real > & _hist
history variable storing the maximum positive deformation energy
const std::string _base_name
Base name of the stress after being modified to include cracks.
bool _use_current_hist
Use current value of history variable.
const MaterialProperty< Real > & _visco
const MaterialProperty< RankTwoTensor > & _uncracked_stress
Uncracked stress calculated by another material.
const MaterialProperty< RankFourTensor > & _uncracked_Jacobian_mult
Uncracked Jacobian_mult calculated by another material.
const std::string _uncracked_base_name
Base name of the uncracked stress and strain.
const std::string name
Definition: Setup.h:22
bool _finite_strain_model
Indicator if finite strain model is used, to determine if mechanical_strain or elastic_strain should ...
const MaterialProperty< Real > & _l
Characteristic length, controls damage zone thickness.
MaterialProperty< Real > & _dFdc
MaterialProperty< Real > & _F
const MaterialProperty< Real > & _gc_prop
Critical energy release rate for fracture.
MaterialProperty< RankTwoTensor > & _stress
Stress being computed by this kernel.
MaterialProperty< RankTwoTensor > & _dstress_dc
MaterialProperty< Real > & _L
Property where the value for L will be defined.
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
MaterialProperty< RankTwoTensor > & _d2Fdcdstrain
Real _kdamage
Small number to avoid non-positive definiteness at or near complete damage.
MaterialProperty< Real > & _d2Fdc2

Member Function Documentation

◆ computeQpProperties()

void ComputeCrackedStress::computeQpProperties ( )
protectedvirtual

Definition at line 81 of file ComputeCrackedStress.C.

82 {
83  const Real c = _c[_qp];
84 
85  // Zero out values when c > 1
86  Real cfactor = 1.0;
87  if (c > 1.0)
88  cfactor = 0.0;
89 
90  // Create the positive and negative projection tensors
91  RankFourTensor I4sym(RankFourTensor::initIdentitySymmetricFour);
92  std::vector<Real> eigval;
93  RankTwoTensor eigvec;
94  RankFourTensor Ppos = _uncracked_stress[_qp].positiveProjectionEigenDecomposition(eigval, eigvec);
95  RankFourTensor Pneg = I4sym - Ppos;
96 
97  // Project the positive and negative stresses
98  RankTwoTensor stress0pos = Ppos * _uncracked_stress[_qp];
99  RankTwoTensor stress0neg = Pneg * _uncracked_stress[_qp];
100 
101  // Compute the positive and negative elastic energies
102  Real G0_pos = (stress0pos).doubleContraction(_strain[_qp]) / 2.0;
103  Real G0_neg = (stress0neg).doubleContraction(_strain[_qp]) / 2.0;
104 
105  // Update the history variable
106  if (G0_pos > _hist_old[_qp])
107  _hist[_qp] = G0_pos;
108  else
109  _hist[_qp] = _hist_old[_qp];
110 
111  Real hist_variable = _hist_old[_qp];
112  if (_use_current_hist)
113  hist_variable = _hist[_qp];
114 
115  // Compute degredation function and derivatives
116  Real h = cfactor * (1.0 - c) * (1.0 - c) * (1.0 - _kdamage) + _kdamage;
117  Real dhdc = -2.0 * cfactor * (1.0 - c) * (1.0 - _kdamage);
118  Real d2hdc2 = 2.0 * cfactor * (1.0 - _kdamage);
119 
120  // Compute stress and its derivatives
121  _stress[_qp] = (Ppos * h + Pneg) * _uncracked_stress[_qp];
122  _dstress_dc[_qp] = stress0pos * dhdc;
123  _Jacobian_mult[_qp] = (Ppos * h + Pneg) * _uncracked_Jacobian_mult[_qp];
124 
125  // Compute energy and its derivatives
126  _F[_qp] = hist_variable * h - G0_neg + _gc_prop[_qp] * c * c / (2 * _l[_qp]);
127  _dFdc[_qp] = hist_variable * dhdc + _gc_prop[_qp] * c / _l[_qp];
128  _d2Fdc2[_qp] = hist_variable * d2hdc2 + _gc_prop[_qp] / _l[_qp];
129 
130  // 2nd derivative wrt c and strain = 0.0 if we used the previous step's history varible
131  if (_use_current_hist)
132  _d2Fdcdstrain[_qp] = stress0pos * dhdc;
133 
134  // Assign L and kappa
135  _kappa[_qp] = _gc_prop[_qp] * _l[_qp];
136  _L[_qp] = 1.0 / (_gc_prop[_qp] * _visco[_qp]);
137 }
const MaterialProperty< Real > & _hist_old
const VariableValue & _c
Variable defining the phase field damage parameter.
MaterialProperty< Real > & _kappa
Property where the value for kappa will be defined.
const MaterialProperty< RankTwoTensor > & _strain
Mechanical_strain if finite_strain_model = false, otherwise elastic_strain.
MaterialProperty< Real > & _hist
history variable storing the maximum positive deformation energy
bool _use_current_hist
Use current value of history variable.
const MaterialProperty< Real > & _visco
const MaterialProperty< RankTwoTensor > & _uncracked_stress
Uncracked stress calculated by another material.
const MaterialProperty< RankFourTensor > & _uncracked_Jacobian_mult
Uncracked Jacobian_mult calculated by another material.
const MaterialProperty< Real > & _l
Characteristic length, controls damage zone thickness.
MaterialProperty< Real > & _dFdc
MaterialProperty< Real > & _F
const MaterialProperty< Real > & _gc_prop
Critical energy release rate for fracture.
MaterialProperty< RankTwoTensor > & _stress
Stress being computed by this kernel.
MaterialProperty< RankTwoTensor > & _dstress_dc
MaterialProperty< Real > & _L
Property where the value for L will be defined.
MaterialProperty< RankFourTensor > & _Jacobian_mult
derivative of stress w.r.t. strain (_dstress_dstrain)
MaterialProperty< RankTwoTensor > & _d2Fdcdstrain
Real _kdamage
Small number to avoid non-positive definiteness at or near complete damage.
MaterialProperty< Real > & _d2Fdc2

◆ initQpStatefulProperties()

void ComputeCrackedStress::initQpStatefulProperties ( )
protectedvirtual

Definition at line 74 of file ComputeCrackedStress.C.

75 {
76  _stress[_qp].zero();
77  _hist[_qp] = 0.0;
78 }
MaterialProperty< Real > & _hist
history variable storing the maximum positive deformation energy
MaterialProperty< RankTwoTensor > & _stress
Stress being computed by this kernel.

Member Data Documentation

◆ _base_name

const std::string ComputeCrackedStress::_base_name
protected

Base name of the stress after being modified to include cracks.

Definition at line 37 of file ComputeCrackedStress.h.

◆ _c

const VariableValue& ComputeCrackedStress::_c
protected

Variable defining the phase field damage parameter.

Definition at line 58 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _d2Fdc2

MaterialProperty<Real>& ComputeCrackedStress::_d2Fdc2
protected

Definition at line 77 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _d2Fdcdstrain

MaterialProperty<RankTwoTensor>& ComputeCrackedStress::_d2Fdcdstrain
protected

Definition at line 78 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _dFdc

MaterialProperty<Real>& ComputeCrackedStress::_dFdc
protected

Definition at line 76 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _dstress_dc

MaterialProperty<RankTwoTensor>& ComputeCrackedStress::_dstress_dc
protected

Definition at line 79 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _F

MaterialProperty<Real>& ComputeCrackedStress::_F
protected

Definition at line 75 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _finite_strain_model

bool ComputeCrackedStress::_finite_strain_model
protected

Indicator if finite strain model is used, to determine if mechanical_strain or elastic_strain should be used.

Definition at line 43 of file ComputeCrackedStress.h.

◆ _gc_prop

const MaterialProperty<Real>& ComputeCrackedStress::_gc_prop
protected

Critical energy release rate for fracture.

Definition at line 61 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _hist

MaterialProperty<Real>& ComputeCrackedStress::_hist
protected

history variable storing the maximum positive deformation energy

Definition at line 82 of file ComputeCrackedStress.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ _hist_old

const MaterialProperty<Real>& ComputeCrackedStress::_hist_old
protected

Definition at line 83 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _Jacobian_mult

MaterialProperty<RankFourTensor>& ComputeCrackedStress::_Jacobian_mult
protected

derivative of stress w.r.t. strain (_dstress_dstrain)

Definition at line 86 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _kappa

MaterialProperty<Real>& ComputeCrackedStress::_kappa
protected

Property where the value for kappa will be defined.

Definition at line 89 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _kdamage

Real ComputeCrackedStress::_kdamage
protected

Small number to avoid non-positive definiteness at or near complete damage.

Definition at line 70 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _l

const MaterialProperty<Real>& ComputeCrackedStress::_l
protected

Characteristic length, controls damage zone thickness.

Definition at line 64 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _L

MaterialProperty<Real>& ComputeCrackedStress::_L
protected

Property where the value for L will be defined.

Definition at line 92 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _strain

const MaterialProperty<RankTwoTensor>& ComputeCrackedStress::_strain
protected

Mechanical_strain if finite_strain_model = false, otherwise elastic_strain.

Definition at line 49 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _stress

MaterialProperty<RankTwoTensor>& ComputeCrackedStress::_stress
protected

Stress being computed by this kernel.

Definition at line 73 of file ComputeCrackedStress.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ _uncracked_base_name

const std::string ComputeCrackedStress::_uncracked_base_name
protected

Base name of the uncracked stress and strain.

Definition at line 40 of file ComputeCrackedStress.h.

◆ _uncracked_Jacobian_mult

const MaterialProperty<RankFourTensor>& ComputeCrackedStress::_uncracked_Jacobian_mult
protected

Uncracked Jacobian_mult calculated by another material.

Definition at line 55 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _uncracked_stress

const MaterialProperty<RankTwoTensor>& ComputeCrackedStress::_uncracked_stress
protected

Uncracked stress calculated by another material.

Definition at line 52 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _use_current_hist

bool ComputeCrackedStress::_use_current_hist
protected

Use current value of history variable.

Definition at line 46 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _visco

const MaterialProperty<Real>& ComputeCrackedStress::_visco
protected

Definition at line 67 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().


The documentation for this class was generated from the following files: