-
Notifications
You must be signed in to change notification settings - Fork 0
/
script_MOOSE_ThermoCP.i
379 lines (361 loc) · 8.15 KB
/
script_MOOSE_ThermoCP.i
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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
[Mesh]
[./gmg]
type = GeneratedMeshGenerator
dim = 3
nx = 4
ny = 4
nz = 4
xmax = 0.1
ymax = 0.1
zmax = 0.1
elem_type = HEX8 #TET4, HEX, HEX8
#show_info = True
[]
[./subdomains]
type = ParsedSubdomainMeshGenerator
input = gmg
combinatorial_geometry = '(x) > (0.05001*1)'
block_id = 1
[]
[./left_bottom_node]
type = BoundingBoxNodeSetGenerator
input = subdomains
bottom_left = '-0.0001 -0.0001 -0.0001'
top_right = '0.0001 0.0001 1.0001'
new_boundary = left_bottom_node
show_info = True
[../]
[./back_bottom_node]
type = BoundingBoxNodeSetGenerator
input = left_bottom_node
bottom_left = '-0.0001 -0.0001 -0.0001'
top_right = '1.001 0.001 0.001'
new_boundary = back_bottom_node
[../]
[./Partitioner]
type = LibmeshPartitioner
partitioner = linear
[../]
parallel_type = distributed
[]
[Outputs]
file_base = method_ThermoCP
csv = true
exodus = true
append_date = true
append_date_format = '%Y-%m-%d-%H-%M-%S'
execute_on = 'timestep_end'
[./console]
type = Console
output_file = true
max_rows = 0
[../]
[]
[UserObjects]
[./prop_read]
type = PropertyReadFile
prop_file_name = 'euler_ang_file.inp' #'EulerAngle_cylinder_n10_01.ori' , 'euler_ang_file.inp'
# Enter file data as prop#1, prop#2, .., prop#nprop
nprop = 3
read_type = block
nblock= 20
[../]
[]
[AuxVariables]
[temperature]
order = FIRST
family = LAGRANGE
[]
[]
[AuxKernels]
[temperature]
type = FunctionAux
variable = temperature
function = '0+900*t' # temperature increases at a constant rate
execute_on = timestep_begin
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Modules/TensorMechanics/Master/all]
strain = FINITE
add_variables = true
#volumetric_locking_correction=true
generate_output = 'stress_xx stress_yy stress_xy strain_xx strain_yy strain_xy'
[]
[Materials]
#inactive ='elasticity_tensor01 stress_01 '
inactive ='elasticity_tensor02 stress_02 trial_xtalpl thermal_eigenstrain_1 thermal_eigenstrain_2'
[./elasticity_tensor01]
type = ComputeElasticityTensorCP
C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
fill_method = symmetric9
read_prop_user_object = prop_read
[../]
[./stress_01]
type = ComputeFiniteStrainElasticStress
[../]
[elasticity_tensor02]
type = ComputeElasticityTensorConstantRotationCP
C_ijkl = '1.684e5 1.214e5 1.214e5 1.684e5 1.214e5 1.684e5 0.754e5 0.754e5 0.754e5'
fill_method = symmetric9
[]
[stress_02]
type = ComputeMultipleCrystalPlasticityStress
crystal_plasticity_models = 'trial_xtalpl'
eigenstrain_names = "thermal_eigenstrain_1 thermal_eigenstrain_2"
tan_mod_type = exact
maximum_substep_iteration = 5
[]
[trial_xtalpl]
type = CrystalPlasticityKalidindiUpdate
number_slip_systems = 12
slip_sys_file_name = input_slip_sys.inp
[]
[thermal_eigenstrain_1]
type = ComputeCrystalPlasticityThermalEigenstrain
eigenstrain_name = thermal_eigenstrain_1
deformation_gradient_name = thermal_deformation_gradient_1
temperature = temperature
thermal_expansion_coefficients = '1e-05 2e-05 3e-05' # thermal expansion coefficients along three directions
[]
[thermal_eigenstrain_2]
type = ComputeCrystalPlasticityThermalEigenstrain
eigenstrain_name = thermal_eigenstrain_2
deformation_gradient_name = thermal_deformation_gradient_2
temperature = temperature
thermal_expansion_coefficients = '2e-05 3e-05 4e-05' # thermal expansion coefficients along three directions
[]
[]
[BCs]
#inactive = 'BC_Bottom_X BC_Top_X BC_Bottom_Y BC_Top_Y'
[./BC_Bottom_X]
type = FunctionDirichletBC
variable = disp_x
boundary = 'bottom'
function = '0.00'
[../]
[./BC_Bottom_Y]
type = FunctionDirichletBC
variable = disp_y
boundary = 'bottom'
function = '0.00'
[../]
[./BC_Top_X]
type = FunctionDirichletBC
variable = disp_x
boundary = 'top'
function = '0.0*y*t'
[../]
[./BC_Top_Y]
type = FunctionDirichletBC
variable = disp_y
boundary = 'top'
function = '0.0*y*t'
[../]
[./BC_BottomLeft_X]
type = FunctionDirichletBC
variable = disp_x
boundary = 'left_bottom_node'
function = 0.0
[../]
[./BC_BottomLeft_Y]
type = FunctionDirichletBC
variable = disp_y
boundary = 'left_bottom_node'
function = 0.0
[../]
[./BC_BottomBack_Y]
type = FunctionDirichletBC
variable = disp_y
boundary = 'back_bottom_node'
function = 0.0
[../]
[./BC_BottomBack_Z]
type = FunctionDirichletBC
variable = disp_z
boundary = 'back_bottom_node'
function = 0.0
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON' #'NEWTON' , 'PJFNK'
automatic_scaling = false # 'true' will throw segfault due to memory issue
#scaling_group_variables = 'disp_x disp_y disp_z; Rho_EdgePositive_01'
petsc_options_iname = '-pc_type -pc_asm_overlap -sub_pc_type -ksp_type -ksp_gmres_restart'
petsc_options_value = ' asm 2 lu gmres 200'
nl_abs_tol = 1e-5 #1e-10 for all *_tol
nl_rel_tol = 1e-5
nl_abs_step_tol = 1e-5
#nl_max_its = 10
dt = 0.01
dtmin = 0.00001
dtmax = 0.05
end_time = 0.1
[]
[AuxVariables]
[f1_xx]
order = CONSTANT
family = MONOMIAL
[]
[f1_yy]
order = CONSTANT
family = MONOMIAL
[]
[f1_zz]
order = CONSTANT
family = MONOMIAL
[]
[f2_xx]
order = CONSTANT
family = MONOMIAL
[]
[f2_yy]
order = CONSTANT
family = MONOMIAL
[]
[f2_zz]
order = CONSTANT
family = MONOMIAL
[]
[feig_xx]
order = CONSTANT
family = MONOMIAL
[]
[feig_yy]
order = CONSTANT
family = MONOMIAL
[]
[feig_zz]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[f1_xx]
type = RankTwoAux
variable = f1_xx
rank_two_tensor = thermal_deformation_gradient_1
index_j = 0
index_i = 0
execute_on = timestep_end
[]
[f1_yy]
type = RankTwoAux
variable = f1_yy
rank_two_tensor = thermal_deformation_gradient_1
index_j = 1
index_i = 1
execute_on = timestep_end
[]
[f1_zz]
type = RankTwoAux
variable = f1_zz
rank_two_tensor = thermal_deformation_gradient_1
index_j = 2
index_i = 2
execute_on = timestep_end
[]
[f2_xx]
type = RankTwoAux
variable = f2_xx
rank_two_tensor = thermal_deformation_gradient_2
index_j = 0
index_i = 0
execute_on = timestep_end
[]
[f2_yy]
type = RankTwoAux
variable = f2_yy
rank_two_tensor = thermal_deformation_gradient_2
index_j = 1
index_i = 1
execute_on = timestep_end
[]
[f2_zz]
type = RankTwoAux
variable = f2_zz
rank_two_tensor = thermal_deformation_gradient_2
index_j = 2
index_i = 2
execute_on = timestep_end
[]
[feig_xx]
type = RankTwoAux
variable = feig_xx
rank_two_tensor = eigenstrain_deformation_gradient
index_j = 0
index_i = 0
execute_on = timestep_end
[]
[feig_yy]
type = RankTwoAux
variable = feig_yy
rank_two_tensor = eigenstrain_deformation_gradient
index_j = 1
index_i = 1
execute_on = timestep_end
[]
[feig_zz]
type = RankTwoAux
variable = feig_zz
rank_two_tensor = eigenstrain_deformation_gradient
index_j = 2
index_i = 2
execute_on = timestep_end
[]
[]
[Postprocessors]
[temperature]
type = ElementAverageValue
variable = temperature
[]
[stress_yy]
type = ElementAverageValue
variable = stress_yy
[]
[f1_xx]
type = ElementAverageValue
variable = f1_xx
[]
[f1_yy]
type = ElementAverageValue
variable = f1_yy
[]
[f1_zz]
type = ElementAverageValue
variable = f1_zz
[]
[f2_xx]
type = ElementAverageValue
variable = f2_xx
[]
[f2_yy]
type = ElementAverageValue
variable = f2_yy
[]
[f2_zz]
type = ElementAverageValue
variable = f2_zz
[]
[feig_xx]
type = ElementAverageValue
variable = feig_xx
[]
[feig_yy]
type = ElementAverageValue
variable = feig_yy
[]
[feig_zz]
type = ElementAverageValue
variable = feig_zz
[]
[]