www.mooseframework.org
PLC_LSH.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
10 #include "PLC_LSH.h"
11 
13 
14 registerMooseObject("SolidMechanicsApp", PLC_LSH);
15 
16 template <>
17 InputParameters
19 {
20  InputParameters params = validParams<SolidModel>();
21 
22  // Power-law creep material parameters
23  params.addRequiredParam<Real>("coefficient", "Leading coefficent in power-law equation");
24  params.addRequiredParam<Real>("n_exponent", "Exponent on effective stress in power-law equation");
25  params.addParam<Real>("m_exponent", 0.0, "Exponent on time in power-law equation");
26  params.addRequiredParam<Real>("activation_energy", "Activation energy");
27  params.addParam<Real>("gas_constant", 8.3143, "Universal gas constant");
28 
29  // Linear strain hardening parameters
30  params.addRequiredParam<Real>("yield_stress",
31  "The point at which plastic strain begins accumulating");
32  params.addRequiredParam<Real>("hardening_constant", "Hardening slope");
33 
34  // Sub-Newton Iteration control parameters
35  params.addParam<unsigned int>("max_its", 30, "Maximum number of sub-newton iterations");
36  params.addParam<bool>("internal_solve_full_iteration_history",
37  false,
38  "Set true to output sub-newton iteration information");
39  params.addParam<Real>(
40  "relative_tolerance", 1e-5, "Relative convergence tolerance for sub-newtion iteration");
41  params.addParam<Real>(
42  "absolute_tolerance", 1e-20, "Absolute convergence tolerance for sub-newtion iteration");
43  params.addParam<PostprocessorName>(
44  "output", "", "The reporting postprocessor to use for the max_iterations value.");
45 
46  // Control of combined plasticity-creep iterarion
47  params.addParam<Real>("absolute_stress_tolerance",
48  1e-5,
49  "Convergence tolerance for combined plasticity-creep stress iteration");
50 
51  return params;
52 }
53 
54 PLC_LSH::PLC_LSH(const InputParameters & parameters)
55  : SolidModel(parameters),
56  _coefficient(parameters.get<Real>("coefficient")),
57  _n_exponent(parameters.get<Real>("n_exponent")),
58  _m_exponent(parameters.get<Real>("m_exponent")),
59  _activation_energy(parameters.get<Real>("activation_energy")),
60  _gas_constant(parameters.get<Real>("gas_constant")),
61 
62  _yield_stress(parameters.get<Real>("yield_stress")),
63  _hardening_constant(parameters.get<Real>("hardening_constant")),
64 
65  _max_its(parameters.get<unsigned int>("max_its")),
66  _internal_solve_full_iteration_history(getParam<bool>("internal_solve_full_iteration_history")),
67  _relative_tolerance(parameters.get<Real>("relative_tolerance")),
68  _absolute_tolerance(parameters.get<Real>("absolute_tolerance")),
69 
70  _absolute_stress_tolerance(parameters.get<Real>("absolute_stress_tolerance")),
71 
72  _creep_strain(declareProperty<SymmTensor>("creep_strain")),
73  _creep_strain_old(getMaterialPropertyOld<SymmTensor>("creep_strain")),
74 
75  _plastic_strain(declareProperty<SymmTensor>("plastic_strain")),
76  _plastic_strain_old(getMaterialPropertyOld<SymmTensor>("plastic_strain")),
77 
78  _hardening_variable(declareProperty<Real>("hardening_variable")),
79  _hardening_variable_old(getMaterialPropertyOld<Real>("hardening_variable")),
80 
81  _output(getParam<PostprocessorName>("output") != "" ? &getPostprocessorValue("output") : NULL)
82 
83 {
84  if (_yield_stress <= 0)
85  {
86  mooseError("Yield stress must be greater than zero");
87  }
88 }
89 
90 void
92 {
93  _hardening_variable[_qp] = 0;
95 }
96 
97 void
99 {
100  // Given the stretching, compute the stress increment and add it to the old stress. Also update
101  // the creep strain
102  // stress = stressOld + stressIncrement
103  // creep_strain = creep_strainOld + creep_strainIncrement
104 
105  if (_t_step == 0 && !_app.isRestarting())
106  return;
107 
109  {
110  _console << std::endl
111  << "iteration output for combined creep-plasticity solve:"
112  << " time=" << _t << " temperature=" << _temperature[_qp] << " int_pt=" << _qp
113  << std::endl;
114  }
115 
116  // compute trial stress
118  stress_new += _stress_old;
119 
120  SymmTensor creep_strain_increment;
121  SymmTensor plastic_strain_increment;
122  SymmTensor elastic_strain_increment;
123  SymmTensor stress_new_last(stress_new);
124  Real delS(_absolute_stress_tolerance + 1);
125  Real first_delS(delS);
126  unsigned int counter(0);
127 
128  while (counter < _max_its && delS > _absolute_stress_tolerance &&
129  (delS / first_delS) > _relative_tolerance)
130  {
131  elastic_strain_increment = _strain_increment;
132  elastic_strain_increment -= plastic_strain_increment;
133  stress_new = *elasticityTensor() * elastic_strain_increment;
134  stress_new += _stress_old;
135 
136  elastic_strain_increment = _strain_increment;
137  computeCreep(elastic_strain_increment, creep_strain_increment, stress_new);
138 
139  // now use stress_new to calculate a new effective_trial_stress and determine if
140  // yield has occured and if so, calculate the corresponding plastic strain
141 
142  elastic_strain_increment -= creep_strain_increment;
143 
144  computeLSH(elastic_strain_increment, plastic_strain_increment, stress_new);
145 
146  elastic_strain_increment -= plastic_strain_increment;
147 
148  // now check convergence
149  SymmTensor deltaS(stress_new_last - stress_new);
150  delS = std::sqrt(deltaS.doubleContraction(deltaS));
151  if (counter == 0)
152  {
153  first_delS = delS;
154  }
155  stress_new_last = stress_new;
156 
158  {
159  _console << "stress_it=" << counter << " rel_delS=" << delS / first_delS
160  << " rel_tol=" << _relative_tolerance << " abs_delS=" << delS
161  << " abs_tol=" << _absolute_stress_tolerance << std::endl;
162  }
163 
164  ++counter;
165  }
166 
167  if (counter == _max_its && delS > _absolute_stress_tolerance &&
168  (delS / first_delS) > _relative_tolerance)
169  {
170  mooseError("Max stress iteration hit during plasticity-creep solve!");
171  }
172 
173  _strain_increment = elastic_strain_increment;
174  _stress[_qp] = stress_new;
175 }
176 
177 void
178 PLC_LSH::computeCreep(const SymmTensor & strain_increment,
179  SymmTensor & creep_strain_increment,
180  SymmTensor & stress_new)
181 {
182  // compute deviatoric trial stress
183  SymmTensor dev_trial_stress(stress_new);
184  dev_trial_stress.addDiag(-dev_trial_stress.trace() / 3.0);
185 
186  // compute effective trial stress
187  Real dts_squared = dev_trial_stress.doubleContraction(dev_trial_stress);
188  Real effective_trial_stress = std::sqrt(1.5 * dts_squared);
189 
190  // Use Newton sub-iteration to determine effective creep strain increment
191 
192  Real exponential(1);
193  if (_has_temp)
194  {
195  exponential = std::exp(-_activation_energy / (_gas_constant * _temperature[_qp]));
196  }
197  Real expTime = std::pow(_t, _m_exponent);
198 
199  Real del_p = 0;
200  unsigned int it = 0;
201  Real creep_residual = 10;
202  Real norm_creep_residual = 10;
203  Real first_norm_creep_residual = 10;
204 
205  while (it < _max_its && norm_creep_residual > _absolute_tolerance &&
206  (norm_creep_residual / first_norm_creep_residual) > _relative_tolerance)
207  {
208 
209  Real phi = _coefficient *
210  std::pow(effective_trial_stress - 3 * _shear_modulus * del_p, _n_exponent) *
211  exponential * expTime;
212  Real dphi_ddelp =
214  std::pow(effective_trial_stress - 3 * _shear_modulus * del_p, _n_exponent - 1) *
215  exponential * expTime;
216 
217  creep_residual = phi - del_p / _dt;
218  norm_creep_residual = std::abs(creep_residual);
219  if (it == 0)
220  {
221  first_norm_creep_residual = norm_creep_residual;
222  }
223 
224  del_p += creep_residual / (1 / _dt - dphi_ddelp);
225 
227  {
228  _console << "crp_it=" << it << " trl_strs=" << effective_trial_stress << " phi=" << phi
229  << " dphi=" << dphi_ddelp << " del_p=" << del_p
230  << " rel_res=" << norm_creep_residual / first_norm_creep_residual
231  << " rel_tol=" << _relative_tolerance << " abs_res=" << norm_creep_residual
232  << " abs_tol=" << _absolute_tolerance << std::endl;
233  }
234 
235  ++it;
236  }
237 
238  if (it == _max_its && norm_creep_residual > _absolute_tolerance &&
239  (norm_creep_residual / first_norm_creep_residual) > _relative_tolerance)
240  {
241  mooseError("Max sub-newton iteration hit during creep solve!");
242  }
243 
244  // compute creep and elastic strain increments (avoid potential divide by zero - how should this
245  // be done)?
246  if (effective_trial_stress < 0.01)
247  {
248  effective_trial_stress = 0.01;
249  }
250 
251  creep_strain_increment = dev_trial_stress;
252  creep_strain_increment *= (1.5 * del_p / effective_trial_stress);
253 
254  SymmTensor elastic_strain_increment(strain_increment);
255  elastic_strain_increment -= creep_strain_increment;
256 
257  // compute stress increment
258  stress_new = *elasticityTensor() * elastic_strain_increment;
259 
260  // update stress and creep strain
261  stress_new += _stress_old;
262 
263  _creep_strain[_qp] = creep_strain_increment;
264  _creep_strain[_qp] += _creep_strain_old[_qp];
265 }
266 
267 void
268 PLC_LSH::computeLSH(const SymmTensor & strain_increment,
269  SymmTensor & plastic_strain_increment,
270  SymmTensor & stress_new)
271 {
272 
273  // compute deviatoric trial stress
274  SymmTensor dev_trial_stress(stress_new);
275  dev_trial_stress.addDiag(-stress_new.trace() / 3);
276 
277  // effective trial stress
278  Real dts_squared = dev_trial_stress.doubleContraction(dev_trial_stress);
279  Real effective_trial_stress = std::sqrt(1.5 * dts_squared);
280 
281  // determine if yield condition is satisfied
282  Real yield_condition = effective_trial_stress - _hardening_variable_old[_qp] - _yield_stress;
283 
286 
287  if (yield_condition >
288  0) // then use newton iteration to determine effective plastic strain increment
289  {
290  unsigned int it = 0;
291  Real plastic_residual = 0;
292  Real norm_plas_residual = 10;
293  Real first_norm_plas_residual = 10;
294  Real scalar_plastic_strain_increment = 0;
295 
296  while (it < _max_its && norm_plas_residual > _absolute_tolerance &&
297  (norm_plas_residual / first_norm_plas_residual) > _relative_tolerance)
298  {
299  plastic_residual = effective_trial_stress -
300  (3. * _shear_modulus * scalar_plastic_strain_increment) -
302  norm_plas_residual = std::abs(plastic_residual);
303  if (it == 0)
304  {
305  first_norm_plas_residual = norm_plas_residual;
306  }
307 
308  scalar_plastic_strain_increment +=
309  plastic_residual / (3. * _shear_modulus + _hardening_constant);
310 
311  _hardening_variable[_qp] =
312  _hardening_variable_old[_qp] + (_hardening_constant * scalar_plastic_strain_increment);
313 
315  {
316  _console << "pls_it=" << it << " trl_strs=" << effective_trial_stress
317  << " del_p=" << scalar_plastic_strain_increment
318  << " harden=" << _hardening_variable[_qp]
319  << " rel_res=" << norm_plas_residual / first_norm_plas_residual
320  << " rel_tol=" << _relative_tolerance << " abs_res=" << norm_plas_residual
321  << " abs_tol=" << _absolute_tolerance << std::endl;
322  }
323 
324  ++it;
325  }
326 
327  if (it == _max_its && norm_plas_residual > _absolute_tolerance &&
328  (norm_plas_residual / first_norm_plas_residual) > _relative_tolerance)
329  {
330  mooseError("Max sub-newton iteration hit during plasticity increment solve!");
331  }
332 
333  if (effective_trial_stress < 0.01)
334  {
335  effective_trial_stress = 0.01;
336  }
337  plastic_strain_increment = dev_trial_stress;
338  plastic_strain_increment *= (1.5 * scalar_plastic_strain_increment / effective_trial_stress);
339 
340  SymmTensor elastic_strain_increment(strain_increment);
341  elastic_strain_increment -= plastic_strain_increment;
342 
343  // compute stress increment
344  stress_new = *elasticityTensor() * elastic_strain_increment;
345 
346  // update stress and plastic strain
347  stress_new += _stress_old;
348  _plastic_strain[_qp] += plastic_strain_increment;
349 
350  } // end of if statement
351 }
PLC_LSH.h
SymmTensor::trace
Real trace() const
Definition: SymmTensor.h:97
validParams< PLC_LSH >
InputParameters validParams< PLC_LSH >()
Definition: PLC_LSH.C:18
PLC_LSH::computeLSH
void computeLSH(const SymmTensor &strain_increment, SymmTensor &plastic_strain_increment, SymmTensor &stress_new)
Definition: PLC_LSH.C:268
SolidModel::elasticityTensor
SymmElasticityTensor * elasticityTensor() const
Definition: SolidModel.h:224
PLC_LSH::_hardening_variable
MaterialProperty< Real > & _hardening_variable
Definition: PLC_LSH.h:55
PLC_LSH::initQpStatefulProperties
virtual void initQpStatefulProperties()
Definition: PLC_LSH.C:91
SolidModel::_shear_modulus
Real _shear_modulus
Definition: SolidModel.h:73
PLC_LSH::_plastic_strain
MaterialProperty< SymmTensor > & _plastic_strain
Definition: PLC_LSH.h:52
pow
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Definition: ExpressionBuilder.h:673
PLC_LSH::_relative_tolerance
Real _relative_tolerance
Definition: PLC_LSH.h:44
SymmIsotropicElasticityTensor.h
counter
static unsigned int counter
Definition: ContactPenetrationAuxAction.C:17
PLC_LSH::_gas_constant
Real _gas_constant
Definition: PLC_LSH.h:37
SolidModel::_strain_increment
SymmTensor _strain_increment
In most models, this is the mechanical strain increment, but for inelastic models,...
Definition: SolidModel.h:151
PLC_LSH::PLC_LSH
PLC_LSH(const InputParameters &parameters)
Definition: PLC_LSH.C:54
PLC_LSH::_yield_stress
Real _yield_stress
Definition: PLC_LSH.h:39
SymmTensor::doubleContraction
Real doubleContraction(const SymmTensor &rhs) const
Definition: SymmTensor.h:259
PLC_LSH::_absolute_stress_tolerance
Real _absolute_stress_tolerance
Definition: PLC_LSH.h:47
PLC_LSH::computeCreep
void computeCreep(const SymmTensor &strain_increment, SymmTensor &creep_strain_increment, SymmTensor &stress_new)
Definition: PLC_LSH.C:178
PLC_LSH::_m_exponent
Real _m_exponent
Definition: PLC_LSH.h:35
PLC_LSH
Combined power-law creep and linear strain hardening material Power law creep is specified by the tim...
Definition: PLC_LSH.h:25
PLC_LSH::_creep_strain_old
const MaterialProperty< SymmTensor > & _creep_strain_old
Definition: PLC_LSH.h:50
SymmTensor::addDiag
void addDiag(Real value)
Definition: SymmTensor.h:281
SolidModel
SolidModel is the base class for all this module's solid mechanics material models.
Definition: SolidModel.h:33
PLC_LSH::_internal_solve_full_iteration_history
bool _internal_solve_full_iteration_history
Definition: PLC_LSH.h:43
PLC_LSH::_creep_strain
MaterialProperty< SymmTensor > & _creep_strain
Definition: PLC_LSH.h:49
PLC_LSH::_hardening_variable_old
const MaterialProperty< Real > & _hardening_variable_old
Definition: PLC_LSH.h:56
SolidModel::_temperature
const VariableValue & _temperature
Definition: SolidModel.h:94
SymmTensor
Definition: SymmTensor.h:21
PLC_LSH::_hardening_constant
Real _hardening_constant
Definition: PLC_LSH.h:40
PLC_LSH::_n_exponent
Real _n_exponent
Definition: PLC_LSH.h:34
SolidModel::_has_temp
const bool _has_temp
Definition: SolidModel.h:93
validParams< SolidModel >
InputParameters validParams< SolidModel >()
Definition: SolidModel.C:31
SolidModel::_stress
MaterialProperty< SymmTensor > & _stress
Definition: SolidModel.h:108
PLC_LSH::_coefficient
Real _coefficient
Definition: PLC_LSH.h:33
SolidModel::initQpStatefulProperties
virtual void initQpStatefulProperties()
Definition: SolidModel.C:696
SolidModel::_stress_old
SymmTensor _stress_old
Definition: SolidModel.h:114
PLC_LSH::_activation_energy
Real _activation_energy
Definition: PLC_LSH.h:36
registerMooseObject
registerMooseObject("SolidMechanicsApp", PLC_LSH)
PLC_LSH::_plastic_strain_old
const MaterialProperty< SymmTensor > & _plastic_strain_old
Definition: PLC_LSH.h:53
PLC_LSH::computeStress
virtual void computeStress()
Compute the stress (sigma += deltaSigma)
Definition: PLC_LSH.C:98
PLC_LSH::_max_its
unsigned int _max_its
Definition: PLC_LSH.h:42
PLC_LSH::_absolute_tolerance
Real _absolute_tolerance
Definition: PLC_LSH.h:45