https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private 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 Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ComputeCrackedStress (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

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.
 
const std::string _uncracked_base_name
 Base name of the uncracked stress and strain.
 
bool _finite_strain_model
 Indicator if finite strain model is used, to determine if mechanical_strain or elastic_strain should be used.
 
bool _use_current_hist
 Use current value of history variable.
 
const MaterialProperty< RankTwoTensor > & _strain
 Mechanical_strain if finite_strain_model = false, otherwise elastic_strain.
 
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 VariableValue_c
 Variable defining the phase field damage parameter.
 
const MaterialProperty< Real > & _gc_prop
 Critical energy release rate for fracture.
 
const MaterialProperty< Real > & _l
 Characteristic length, controls damage zone thickness.
 
const MaterialProperty< Real > & _visco
 
Real _kdamage
 Small number to avoid non-positive definiteness at or near complete damage.
 
MaterialProperty< RankTwoTensor > & _stress
 Stress being computed by this kernel.
 
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
 
const MaterialProperty< Real > & _hist_old
 
MaterialProperty< RankFourTensor > & _Jacobian_mult
 derivative of stress w.r.t. strain (_dstress_dstrain)
 
MaterialProperty< Real > & _kappa
 Property where the value for kappa will be defined.
 
MaterialProperty< Real > & _L
 Property where the value for L will be defined.
 

Private Member Functions

bool haveMaterialProperty (const std::string &prop_name)
 
std::vector< VariableName > buildVariableVector (const VariableName &c1, const VariableName &c2, const VariableName &c3)
 
void validateCouplingHelper (const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
 
bool isNotObjectVariable (const VariableName &name)
 

Private Attributes

FEProblemBase_dmi_fe_problem
 

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 22 of file ComputeCrackedStress.h.

Constructor & Destructor Documentation

◆ ComputeCrackedStress()

ComputeCrackedStress::ComputeCrackedStress ( const InputParameters parameters)

Definition at line 38 of file ComputeCrackedStress.C.

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

Member Function Documentation

◆ computeQpProperties()

void ComputeCrackedStress::computeQpProperties ( )
protectedvirtual

Definition at line 80 of file ComputeCrackedStress.C.

81{
82 const Real c = _c[_qp];
83
84 // Zero out values when c > 1
85 Real cfactor = 1.0;
86 if (c > 1.0)
87 cfactor = 0.0;
88
89 // Create the positive and negative projection tensors
91 std::vector<Real> eigval;
92 RankTwoTensor eigvec;
93 RankFourTensor Ppos = _uncracked_stress[_qp].positiveProjectionEigenDecomposition(eigval, eigvec);
94 RankFourTensor Pneg = I4sym - Ppos;
95
96 // Project the positive and negative stresses
97 RankTwoTensor stress0pos = Ppos * _uncracked_stress[_qp];
98 RankTwoTensor stress0neg = Pneg * _uncracked_stress[_qp];
99
100 // Compute the positive and negative elastic energies
101 Real G0_pos = (stress0pos).doubleContraction(_strain[_qp]) / 2.0;
102 Real G0_neg = (stress0neg).doubleContraction(_strain[_qp]) / 2.0;
103
104 // Update the history variable
105 if (G0_pos > _hist_old[_qp])
106 _hist[_qp] = G0_pos;
107 else
108 _hist[_qp] = _hist_old[_qp];
109
110 Real hist_variable = _hist_old[_qp];
112 hist_variable = _hist[_qp];
113
114 // Compute degredation function and derivatives
115 Real h = cfactor * (1.0 - c) * (1.0 - c) * (1.0 - _kdamage) + _kdamage;
116 Real dhdc = -2.0 * cfactor * (1.0 - c) * (1.0 - _kdamage);
117 Real d2hdc2 = 2.0 * cfactor * (1.0 - _kdamage);
118
119 // Compute stress and its derivatives
120 _stress[_qp] = (Ppos * h + Pneg) * _uncracked_stress[_qp];
121 _dstress_dc[_qp] = stress0pos * dhdc;
122 _Jacobian_mult[_qp] = (Ppos * h + Pneg) * _uncracked_Jacobian_mult[_qp];
123
124 // Compute energy and its derivatives
125 _F[_qp] = hist_variable * h - G0_neg + _gc_prop[_qp] * c * c / (2 * _l[_qp]);
126 _dFdc[_qp] = hist_variable * dhdc + _gc_prop[_qp] * c / _l[_qp];
127 _d2Fdc2[_qp] = hist_variable * d2hdc2 + _gc_prop[_qp] / _l[_qp];
128
129 // 2nd derivative wrt c and strain = 0.0 if we used the previous step's history varible
131 _d2Fdcdstrain[_qp] = stress0pos * dhdc;
132
133 // Assign L and kappa
134 _kappa[_qp] = _gc_prop[_qp] * _l[_qp];
135 _L[_qp] = 1.0 / (_gc_prop[_qp] * _visco[_qp]);
136}

◆ initQpStatefulProperties()

void ComputeCrackedStress::initQpStatefulProperties ( )
protectedvirtual

Definition at line 73 of file ComputeCrackedStress.C.

74{
75 _stress[_qp].zero();
76 _hist[_qp] = 0.0;
77}

◆ validParams()

InputParameters ComputeCrackedStress::validParams ( )
static

Definition at line 15 of file ComputeCrackedStress.C.

16{
18 params.addClassDescription("Computes energy and modifies the stress for phase field fracture");
19 params.addRequiredCoupledVar("c", "Order parameter for damage");
20 params.addParam<Real>("kdamage", 1e-9, "Stiffness of damaged matrix");
21 params.addParam<bool>("finite_strain_model", false, "The model is using finite strain");
22 params.addParam<bool>(
23 "use_current_history_variable", false, "Use the current value of the history variable.");
24 params.addParam<MaterialPropertyName>(
25 "F_name", "E_el", "Name of material property storing the elastic energy");
26 params.addParam<MaterialPropertyName>(
27 "kappa_name",
28 "kappa_op",
29 "Name of material property being created to store the interfacial parameter kappa");
30 params.addParam<MaterialPropertyName>(
31 "mobility_name", "L", "Name of material property being created to store the mobility L");
32 params.addParam<std::string>("base_name", "The base name used to save the cracked stress");
33 params.addRequiredParam<std::string>("uncracked_base_name",
34 "The base name used to calculate the original stress");
35 return params;
36}
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()

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 33 of file ComputeCrackedStress.h.

◆ _c

const VariableValue& ComputeCrackedStress::_c
protected

Variable defining the phase field damage parameter.

Definition at line 54 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _d2Fdc2

MaterialProperty<Real>& ComputeCrackedStress::_d2Fdc2
protected

Definition at line 73 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _d2Fdcdstrain

MaterialProperty<RankTwoTensor>& ComputeCrackedStress::_d2Fdcdstrain
protected

Definition at line 74 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _dFdc

MaterialProperty<Real>& ComputeCrackedStress::_dFdc
protected

Definition at line 72 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _dstress_dc

MaterialProperty<RankTwoTensor>& ComputeCrackedStress::_dstress_dc
protected

Definition at line 75 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _F

MaterialProperty<Real>& ComputeCrackedStress::_F
protected

Definition at line 71 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 39 of file ComputeCrackedStress.h.

◆ _gc_prop

const MaterialProperty<Real>& ComputeCrackedStress::_gc_prop
protected

Critical energy release rate for fracture.

Definition at line 57 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _hist

MaterialProperty<Real>& ComputeCrackedStress::_hist
protected

history variable storing the maximum positive deformation energy

Definition at line 78 of file ComputeCrackedStress.h.

Referenced by computeQpProperties(), and initQpStatefulProperties().

◆ _hist_old

const MaterialProperty<Real>& ComputeCrackedStress::_hist_old
protected

Definition at line 79 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 82 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 85 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 66 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _l

const MaterialProperty<Real>& ComputeCrackedStress::_l
protected

Characteristic length, controls damage zone thickness.

Definition at line 60 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 88 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 45 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _stress

MaterialProperty<RankTwoTensor>& ComputeCrackedStress::_stress
protected

Stress being computed by this kernel.

Definition at line 69 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 36 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 51 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 48 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 42 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().

◆ _visco

const MaterialProperty<Real>& ComputeCrackedStress::_visco
protected

Definition at line 63 of file ComputeCrackedStress.h.

Referenced by computeQpProperties().


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