/
FiniteStrainCrystalPlasticity.h
360 lines (284 loc) · 10 KB
/
FiniteStrainCrystalPlasticity.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#ifndef FINITESTRAINCRYSTALPLASTICITY_H
#define FINITESTRAINCRYSTALPLASTICITY_H
#include "ComputeStressBase.h"
class FiniteStrainCrystalPlasticity;
template <>
InputParameters validParams<FiniteStrainCrystalPlasticity>();
/**
* FiniteStrainCrystalPlasticity uses the multiplicative decomposition of deformation gradient
* and solves the PK2 stress residual equation at the intermediate configuration to evolve the
* material state.
* The internal variables are updated using an interative predictor-corrector algorithm.
* Backward Euler integration rule is used for the rate equations.
*/
class FiniteStrainCrystalPlasticity : public ComputeStressBase
{
public:
FiniteStrainCrystalPlasticity(const InputParameters & parameters);
protected:
/**
* This function updates the stress at a quadrature point.
*/
virtual void computeQpStress();
/**
* This function updates the elasticity tensor at a quadrature point.
* Presently void.
*/
virtual void computeQpElasticityTensor();
/**
* This function initializes the stateful properties such as
* stress, plastic deformation gradient, slip system resistances, etc.
*/
virtual void initQpStatefulProperties();
/**
* This function calls the residual and jacobian functions used in the
* stress update algorithm.
*/
virtual void calc_resid_jacob(RankTwoTensor &, RankFourTensor &);
/**
* This function updates the slip increments.
* And derivative of slip w.r.t. resolved shear stress.
*/
virtual void getSlipIncrements();
// Override to modify slip system resistance evolution
/**
* This function updates the slip system resistances.
*/
virtual void update_slip_system_resistance();
// Old function: Kept to avoid code break in computeQpStress
/**
* This function updates the slip system resistances.
*/
virtual void updateGss();
/**
* This function reads slip system from file - see test.
*/
virtual void getSlipSystems();
/**
* This function assign initial values of slip system resistances/internal variables
* read from getSlipSystems().
*/
virtual void assignSlipSysRes();
/**
* This function read slip system resistances from file - see test.
*/
virtual void readFileInitSlipSysRes();
/**
* This function assign slip system resistances - see test.
* .i input file format start_slip_sys_num, end_slip_sys_num, value.
*/
virtual void getInitSlipSysRes();
/**
* This function read flow rate parameters from file - see test.
*/
virtual void readFileFlowRateParams();
/**
* This function assign flow rate parameters - see test.
* .i input file format start_slip_sys_num, end_slip_sys_num, value1, value2
*/
virtual void getFlowRateParams();
/**
* This function read hardness parameters from file.
*/
virtual void readFileHardnessParams();
/**
* This function assign flow rate parameters from .i file - see test.
*/
virtual void getHardnessParams();
/**
* This function initializes slip system resistances.
*/
virtual void initSlipSysProps();
/**
* This function initializes additional parameters.
*/
virtual void initAdditionalProps();
/**
* This function set variables for stress and internal variable solve.
*/
virtual void preSolveQp();
/**
* This function solves stress and internal variables.
*/
virtual void solveQp();
/**
* This function update stress and internal variable after solve.
*/
virtual void postSolveQp();
/**
* This function set variables for internal variable solve.
*/
virtual void preSolveStatevar();
/**
* This function solves internal variables.
*/
virtual void solveStatevar();
/**
* This function update internal variable after solve.
*/
virtual void postSolveStatevar();
/**
* This function set variables for stress solve.
*/
virtual void preSolveStress();
/**
* This function solves for stress, updates plastic deformation gradient.
*/
virtual void solveStress();
/**
* This function update stress and plastic deformation gradient after solve.
*/
virtual void postSolveStress();
/**
* This function calculate stress residual.
*/
virtual void calcResidual(RankTwoTensor &);
/**
* This function calculate jacobian.
*/
virtual void calcJacobian(RankFourTensor &);
/**
* This function calculate the tangent moduli for preconditioner.
* Default is the elastic stiffness matrix.
* Exact jacobian is currently implemented.
* tan_mod_type can be modified to exact in .i file to turn it on.
*/
virtual RankFourTensor calcTangentModuli();
/**
* This function calculate the elastic tangent moduli for preconditioner.
*/
virtual RankFourTensor elasticTangentModuli();
/**
* This function calculate the exact tangent moduli for preconditioner.
*/
virtual RankFourTensor elastoPlasticTangentModuli();
/**
* This function perform RU decomposition to obtain the rotation tensor.
*/
RankTwoTensor get_current_rotation(const RankTwoTensor & a);
////Old function: Kept to avoid code break in computeQpStress
/**
* This function perform RU decomposition to obtain the rotation tensor.
*/
RankTwoTensor getMatRot(const RankTwoTensor & a);
/**
* This function calculate the Schmid tensor.
*/
void calc_schmid_tensor();
/**
* This function performs the line search update
*/
bool line_search_update(const Real rnorm_prev, const RankTwoTensor);
/**
* This function updates internal variables after each NewTon Raphson iteration (_fp_inv)
*/
void internalVariableUpdateNRiteration();
/// Number of slip system resistance
const unsigned int _nss;
std::vector<Real> _gprops;
std::vector<Real> _hprops;
std::vector<Real> _flowprops;
///File should contain slip plane normal and direction. See test.
std::string _slip_sys_file_name;
///File should contain initial values of the slip system resistances.
std::string _slip_sys_res_prop_file_name;
///File should contain values of the flow rate equation parameters.
///Values for every slip system must be provided.
///Should have the same order of slip systens as in slip_sys_file. See test.
///The option of reading all the properties from .i is still present.
std::string _slip_sys_flow_prop_file_name;
///The hardening parameters in this class are read from .i file. The user can override to read from file.
std::string _slip_sys_hard_prop_file_name;
///Stress residual equation relative tolerance
Real _rtol;
///Stress residual equation absolute tolerance
Real _abs_tol;
///Internal variable update equation tolerance
Real _gtol;
///Slip increment tolerance
Real _slip_incr_tol;
///Maximum number of iterations for stress update
unsigned int _maxiter;
///Maximum number of iterations for internal variable update
unsigned int _maxiterg;
///Number of slip system flow rate parameters
unsigned int _num_slip_sys_flowrate_props;
///Type of tangent moduli calculation
MooseEnum _tan_mod_type;
///Read from options for initial values of internal variables
MooseEnum _intvar_read_type;
///Number of slip system specific properties provided in the file containing slip system normals and directions
unsigned int _num_slip_sys_props;
bool _gen_rndm_stress_flag;
///Input option for scaling variable to generate random stress when convergence fails
bool _input_rndm_scale_var;
///Scaling value
Real _rndm_scale_var;
///Seed value
unsigned int _rndm_seed;
///Maximum number of substep iterations
unsigned int _max_substep_iter;
///Flag to activate line serach
bool _use_line_search;
///Minimum line search step size
Real _min_lsrch_step;
///Line search bisection method tolerance
Real _lsrch_tol;
///Line search bisection method maximum iteration number
unsigned int _lsrch_max_iter;
// Line search method
MooseEnum _lsrch_method;
MaterialProperty<RankTwoTensor> & _fp;
const MaterialProperty<RankTwoTensor> & _fp_old;
MaterialProperty<RankTwoTensor> & _pk2;
const MaterialProperty<RankTwoTensor> & _pk2_old;
MaterialProperty<RankTwoTensor> & _lag_e;
const MaterialProperty<RankTwoTensor> & _lag_e_old;
MaterialProperty<std::vector<Real>> & _gss;
const MaterialProperty<std::vector<Real>> & _gss_old;
MaterialProperty<Real> & _acc_slip;
const MaterialProperty<Real> & _acc_slip_old;
MaterialProperty<RankTwoTensor> & _update_rot;
const MaterialProperty<RankTwoTensor> & _deformation_gradient;
const MaterialProperty<RankTwoTensor> & _deformation_gradient_old;
/// Name of the elasticity tensor material property
const std::string _elasticity_tensor_name;
/// Elasticity tensor material property
const MaterialProperty<RankFourTensor> & _elasticity_tensor;
const MaterialProperty<RankTwoTensor> & _crysrot;
DenseVector<Real> _mo;
DenseVector<Real> _no;
DenseVector<Real> _a0;
DenseVector<Real> _xm;
Real _h0;
Real _tau_sat;
Real _tau_init;
Real _r;
RankTwoTensor _dfgrd_tmp;
RankTwoTensor _fe, _fp_old_inv, _fp_inv, _fp_prev_inv;
DenseVector<Real> _slip_incr, _tau, _dslipdtau;
std::vector<RankTwoTensor> _s0;
RankTwoTensor _pk2_tmp, _pk2_tmp_old;
Real _accslip_tmp, _accslip_tmp_old;
std::vector<Real> _gss_tmp;
std::vector<Real> _gss_tmp_old;
DenseVector<Real> _slip_sys_props;
DenseMatrix<Real> _dgss_dsliprate;
bool _read_from_slip_sys_file;
bool _err_tol; ///Flag to check whether convergence is achieved
///Used for substepping; Uniformly divides the increment in deformation gradient
RankTwoTensor _delta_dfgrd, _dfgrd_tmp_old;
///Scales the substepping increment to obtain deformation gradient at a substep iteration
Real _dfgrd_scale_factor;
///Flags to reset variables and reinitialize variables
bool _first_step_iter, _last_step_iter, _first_substep;
};
#endif // FINITESTRAINCRYSTALPLASTICITY_H