https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ComputeSimoHughesJ2PlasticityStress.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11
13
16{
19 params.addClassDescription("The Simo-Hughes style J2 plasticity.");
20 params.addParam<MaterialPropertyName>(
21 "elasticity_tensor", "elasticity_tensor", "The name of the elasticity tensor.");
22 params.addRequiredParam<MaterialName>("flow_stress_material",
23 "The material defining the flow stress");
24 return params;
25}
26
28 const InputParameters & parameters)
31 _elasticity_tensor_name(_base_name + getParam<MaterialPropertyName>("elasticity_tensor")),
32 _elasticity_tensor(getMaterialProperty<RankFourTensor>(_elasticity_tensor_name)),
33 _F_old(getMaterialPropertyOld<RankTwoTensor>(_base_name + "deformation_gradient")),
34 _ep_name(_base_name + "effective_plastic_strain"),
35 _ep(declareProperty<Real>(_ep_name)),
36 _ep_old(getMaterialPropertyOldByName<Real>(_ep_name)),
37 _be(declareProperty<RankTwoTensor>(_base_name +
38 "volume_preserving_elastic_left_cauchy_green_strain")),
39 _be_old(getMaterialPropertyOldByName<RankTwoTensor>(
40 _base_name + "volume_preserving_elastic_left_cauchy_green_strain")),
41 _Np(declareProperty<RankTwoTensor>(_base_name + "flow_direction")),
42 _flow_stress_material(nullptr),
43 _flow_stress_name(_base_name + "flow_stress"),
44 _H(getMaterialPropertyByName<Real>(_flow_stress_name)),
45 _dH(getDefaultMaterialPropertyByName<Real, false>(
46 derivativePropertyName(_flow_stress_name, {_ep_name}))),
47 _d2H(getDefaultMaterialPropertyByName<Real, false>(
48 derivativePropertyName(_flow_stress_name, {_ep_name, _ep_name})))
49{
50}
51
52void
54{
56
57 // The elastic predictor uses the incremental deformation gradient, which is the identity with
58 // small kinematics, so the model would have no deviatoric response.
59 if (!_large_kinematics)
60 mooseError("ComputeSimoHughesJ2PlasticityStress requires large kinematics; set "
61 "large_kinematics = true on the ComputeLagrangianStrain calculator.");
62
63 _flow_stress_material = &getMaterial("flow_stress_material");
64
65 // Enforce isotropic elastic tensor
66 if (!hasGuaranteedMaterialProperty(_elasticity_tensor_name, Guarantee::ISOTROPIC))
67 mooseError("ComputeSimoHughesJ2PlasticityStress requires an isotropic elasticity tensor");
68}
69
70void
77
78void
80{
81 usingTensorIndices(i, j, k, l, m);
84 const auto I = RankTwoTensor::Identity();
85 const auto Fit = _stabilized_deformation_gradient[_qp].inverse().transpose();
86 const auto detJ = _stabilized_deformation_gradient[_qp].det();
87
88 // Update configuration
89 RankTwoTensor f = _inv_df[_qp].inverse();
90 RankTwoTensor f_bar = f / std::cbrt(f.det());
91
92 // Elastic predictor
93 _be[_qp] = f_bar * _be_old[_qp] * f_bar.transpose();
94 RankTwoTensor s = G * _be[_qp].deviatoric();
95 _Np[_qp] = MooseUtils::absoluteFuzzyEqual(s.norm(), 0) ? std::sqrt(1. / 2.) * I
96 : std::sqrt(3. / 2.) * s / s.norm();
97 Real s_eff = s.doubleContraction(_Np[_qp]);
98
99 // Compute the derivative of the strain before return mapping
100 if (_fe_problem.currentlyComputingJacobian())
101 _d_be_d_F = _F_old[_qp].inverse().times<l, m, i, j, k, m>(
102 (I.times<i, k, j, l>(f_bar * _be_old[_qp].transpose()) +
103 I.times<j, k, i, l>(f_bar * _be_old[_qp])) /
104 std::cbrt(f.det()) -
105 2. / 3. * _be[_qp].times<i, j, l, k>(_inv_df[_qp]));
106
107 // Check for plastic loading and do return mapping
108 Real delta_ep = 0;
109 if (computeResidual(s_eff, 0) > 0)
110 {
111 // Initialize the derivative of the internal variable
112 if (_fe_problem.currentlyComputingJacobian())
113 {
114 _d_deltaep_d_betr.zero();
115 if (MooseUtils::absoluteFuzzyEqual(s.norm(), 0))
116 _d_n_d_be.zero();
117 else
118 _d_n_d_be = G / std::sqrt(6) / s.norm() *
119 (3 * I.times<i, k, j, l>(I) - 2 * _Np[_qp].times<i, j, k, l>(_Np[_qp]) -
120 I.times<i, j, k, l>(I));
121 }
122
123 returnMappingSolve(s_eff, delta_ep, _console);
124
125 // Correct the derivative of the strain after return mapping
126 if (_fe_problem.currentlyComputingJacobian())
127 _d_be_d_F -=
128 2. / 3. *
129 (_be[_qp].trace() * _Np[_qp].times<i, j, k, l>(_d_deltaep_d_betr) +
130 delta_ep * _Np[_qp].times<i, j, k, l>(I) + delta_ep * _be[_qp].trace() * _d_n_d_be) *
131 _d_be_d_F;
132 }
133
134 // Update intermediate and current configurations
135 _ep[_qp] = _ep_old[_qp] + delta_ep;
136 _be[_qp] -= 2. / 3. * delta_ep * _be[_qp].trace() * _Np[_qp];
137 s = G * _be[_qp].deviatoric();
138 RankTwoTensor tau = (K * (detJ * detJ - 1) / 2) * I + s;
139 _pk1_stress[_qp] = tau * Fit;
140
141 // Compute the consistent tangent, i.e. the derivative of the PK1 stress w.r.t. the deformation
142 // gradient.
143 if (_fe_problem.currentlyComputingJacobian())
144 {
145 RankFourTensor d_tau_d_F = K * detJ * detJ * I.times<i, j, k, l>(Fit) +
146 G * (_d_be_d_F - I.times<i, j, k, l>(I) * _d_be_d_F / 3);
147 _pk1_jacobian[_qp] = Fit.times<m, j, i, m, k, l>(d_tau_d_F) - Fit.times<k, j, i, l>(tau * Fit);
148 }
149}
150
151Real
153 const Real & scalar)
154{
156 return effective_trial_stress - G * scalar * _be[_qp].trace();
157}
158
159Real
161 const Real & scalar)
162{
164
165 // Update the flow stress
166 _ep[_qp] = _ep_old[_qp] + scalar;
168
169 return effective_trial_stress - G * scalar * _be[_qp].trace() - _H[_qp];
170}
171
172Real
173ComputeSimoHughesJ2PlasticityStress::computeDerivative(const Real & /*effective_trial_stress*/,
174 const Real & scalar)
175{
177
178 // Update the flow stress
179 _ep[_qp] = _ep_old[_qp] + scalar;
181
182 return -G * _be[_qp].trace() - _dH[_qp];
183}
184
185void
186ComputeSimoHughesJ2PlasticityStress::preStep(const Real & scalar, const Real & R, const Real & J)
187{
188 if (!_fe_problem.currentlyComputingJacobian())
189 return;
190
191 const auto I = RankTwoTensor::Identity();
193
194 // Update the flow stress
195 _ep[_qp] = _ep_old[_qp] + scalar;
197
199 G * _Np[_qp] - G * scalar * I - (G * _be[_qp].trace() + _dH[_qp]) * _d_deltaep_d_betr;
200 _d_J_d_betr = -G * I - _d2H[_qp] * _d_deltaep_d_betr;
201 _d_deltaep_d_betr += -1 / J * _d_R_d_betr + R / J / J * _d_J_d_betr;
202}
Real f(Real x)
Test function for Brents method.
registerMooseObject("SolidMechanicsApp", ComputeSimoHughesJ2PlasticityStress)
const double R
void mooseError(Args &&... args)
virtual void initialSetup() override
Derive _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee.
Native interface for providing the 1st Piola Kirchhoff stress.
virtual Real computeDerivative(const Real &effective_trial_stress, const Real &scalar) override
virtual Real computeResidual(const Real &effective_trial_stress, const Real &scalar) override
const MaterialProperty< RankFourTensor > & _elasticity_tensor
const MaterialProperty< RankTwoTensor > & _F_old
virtual Real computeReferenceResidual(const Real &effective_trial_stress, const Real &scalar) override
The return mapping residual and derivative.
ComputeSimoHughesJ2PlasticityStress(const InputParameters &parameters)
const MaterialProperty< RankTwoTensor > & _be_old
virtual void preStep(const Real &scalar_old, const Real &residual, const Real &jacobian) override
RankFourTensor _d_be_d_F
Helper (dummy) variables for iteratively updating the consistant tangent during return mapping.
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)
virtual void initQpStatefulProperties()
virtual void computePropertiesAtQp(unsigned int qp)
RankFourTensorTempl< T > inverse() const
T doubleContraction(const RankTwoTensorTempl< T > &a) const
RankTwoTensorTempl< T > inverse() const
RankTwoTensorTempl< T > transpose() const
static RankTwoTensorTempl Identity()
Base class that provides capability for Newton return mapping iterations on a single variable.
void returnMappingSolve(const GenericReal< is_ad > &effective_trial_stress, GenericReal< is_ad > &scalar, const ConsoleStream &console)
Perform the return mapping iterations.
T getIsotropicBulkModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the bulk modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be i...
T getIsotropicShearModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the shear modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be ...