-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyCAsolver_coupled_aniso.i
308 lines (291 loc) · 6.26 KB
/
myCAsolver_coupled_aniso.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
#
# One particle growth with constant driving force
#
# Sigma, Interfacial energy: 0.3 J/m^2
# Lambda, the half interfaciel thicknes; interfacial width definition: p(0.05) ~ p(0.95)
# corresponding alpha = 2*ln(0.95/0.05) = 5.8889
# Lambda = 3 * dx
# kappa_p = 12 * Sigma * Lambda / alpha = 6 * (2*Lambda) * Sigma / alpha = 1.834e-6
# w, double well height = 3 * Sigma * alpha / (2*Lambda) = 8.833e5
[Mesh]
type = GeneratedMesh
dim = 2
nx = 150
ny = 150
xmax = 150e-6 #[m]
ymax = 150e-6 #[m]
[]
[Variables]
[./p] #phase-field variable
order = FIRST
family = LAGRANGE
[../]
[./mu] #chemical potential variable
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
#[./p_element]
# order = FIRST
# family = MONOMIAL
#[../]
[./gradp_x]
order = FIRST
family = MONOMIAL
[../]
[./gradp_y]
order = FIRST
family = MONOMIAL
[../]
[./gradp_mag]
order = FIRST
family = MONOMIAL
[../]
[]
[ICs]
[./p_circleIC]
type = SmoothCircleIC
variable = p
x1 = 75e-6 #[m]
y1 = 75e-6 #[m]
radius = 1e-6 #[m]
int_width = 6e-6 #[m]
invalue = 1.0
outvalue = 0.0
[../]
[./mu_constantIC]
type = SmoothCircleIC
variable = mu
x1 = 75e-6 #[m]
y1 = 75e-6 #[m]
radius = 1e-6 #[m]
int_width = 6e-6 #[m]
invalue = 0.0
outvalue = 0.2e7
#type = ConstantIC
#variable = mu
#value = 0.2e7
[../]
[]
[BCs]
#Do nothing means no-flux boundary condition
[]
[AuxKernels]
#[./copying_p]
# type = ParsedAux
# variable = p_element
# args = p
# function = 'p'
# execute_on = TIMESTEP_BEGIN
#[../]
[./calc_gradp_x]
type = VariableGradientComponent
variable = gradp_x
gradient_variable = p
component = x
execute_on = TIMESTEP_BEGIN
[../]
[./calc_gradp_y]
type = VariableGradientComponent
variable = gradp_y
gradient_variable = p
component = y
execute_on = TIMESTEP_BEGIN
[../]
[./get_gradp_mag]
type = VectorMagnitudeAux
variable = gradp_mag
x = gradp_x
y = gradp_y
[../]
[]
[Kernels]
#Phase-field
[./time_derivative_p]
type = TimeDerivative
variable = p
[../]
[./InterfacialE]
type = ACInterface
variable = p
mob_name = L
kappa_name = kappa_p
[../]
[./localFE]
type = AllenCahn
variable = p
f_name = f_doublewell
mob_name = L
[../]
#[./DrivingForce]
# type = CoupledAllenCahn
# variable = p
# v = mu
# f_name = coupled_drivF
# mob_name = L
#[../]
[./DrivingForce]
type = ACSwitching
variable = p
Fj_names = 'gpot_a gpot_b'
hj_names = 'ha hb'
args = 'p mu'
mob_name = L
[../]
#Chemical potential field
[./time_derivative_mu]
type = TimeDerivative
variable = mu
[../]
[./div_grad_mu]
type = ACInterface
variable = mu
mob_name = k
#kappa_name = M0
kappa_name = Mob
[../]
[./Partition_term]
type = CoupledSwitchingTimeDerivative
variable = mu
v = p
Fj_names = 'Cma_dha Cmb_dhb'
hj_names = 'ha hb'
args = 'p'
[../]
[]
[Materials]
[./f_doublewell]
type = DerivativeParsedMaterial
f_name = f_doublewell
args = 'p'
material_property_names = 'w'
function = 'w*p^2*(1-p)^2'
derivative_order = 2
outputs = exodus
[../]
#[./f_drivingforce]
# type = DerivativeParsedMaterial
# f_name = coupled_drivF
# args = 'p mu'
# material_property_names = 'ha hb Ba Bb Cma Cmb'
# function = 'ha*(Ba-mu*Cma)+hb*(Bb-mu*Cmb)'
# derivative_order = 2
# outputs = exodus
#[../]
[./Cma_dha]
type = ParsedMaterial
f_name = Cma_dha
material_property_names = 'Cma k'
function = 'Cma*k'
[../]
[./Cmb_dhb]
type = ParsedMaterial
f_name = Cmb_dhb
material_property_names = 'Cmb k'
function = 'Cmb*k'
[../]
[./ha]
type = DerivativeParsedMaterial
f_name = ha
args = 'p'
function = 'p^3*(10-15*p+6*p^2)'
derivative_order = 2
outputs = exodus
[../]
[./hb]
type = DerivativeParsedMaterial
f_name = hb
args = 'p'
function = '1-p^3*(10-15*p+6*p^2)'
derivative_order = 2
outputs = exodus
[../]
[./grandpotnetial_a]
type = DerivativeParsedMaterial
f_name = gpot_a
args = 'mu'
material_property_names = 'Cma Ba'
function = 'Ba-mu*Cma'
outputs = exodus
[../]
[./grandpotnetial_b]
type = DerivativeParsedMaterial
f_name = gpot_b
args = 'mu'
material_property_names = 'Cmb Bb'
function = 'Bb-mu*Cmb'
outputs = exodus
[../]
[./constants]
type = GenericConstantMaterial
prop_names = 'L kappa_p w M0 k Cma Ba Cmb Bb'
prop_values = '0.121 1.834e-6 8.833e5 1e-13 1e7 1.0 0.0 0.0 0.0'
#prop_values = '0.0121 1.834e-6 8.833e5 1e-13 1e7 1.0 0.0 0.0 0.0'
[../]
[./compo_material]
type = ParsedMaterial
f_name = compo_material
material_property_names = 'ha hb k Cma Cmb'
args = 'p mu'
function = '(mu/k+Cma)*ha+(mu/k+Cmb)*hb'
outputs = exodus
[../]
[./mobility_function]
type = ParsedMaterial
f_name = Mob
material_property_names = 'M0'
args = 'p'
constant_names = 'ampl'
constant_expressions = '10'
function = 'M0*(1+ampl*p^2*(1-p)^2/0.5^4)'
outputs = exodus
[../]
[./interfacial_normal_angle]
type = ParsedMaterial
f_name = theta
args = 'gradp_x gradp_y gradp_mag'
material_property_names = 'cosineval'
function = 'r:=acos(cosineval);if(-gradp_y<0,2*3.141592-r,r)'
outputs = exodus
[../]
[./step_function_interface]
type = ParsedMaterial
f_name = cosineval
args = 'gradp_x gradp_mag'
material_property_names = 'kappa_p w'
function = 'r:=-gradp_x/gradp_mag;if(gradp_mag*sqrt(kappa_p/w)<1e-6,0,r)'
outputs = exodus
[../]
[]
[Preconditioning]
[./cw_coupling]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = PJFNK
scheme = bdf2
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu '
l_max_its = 20
l_tol = 1e-7
nl_max_its = 20
nl_rel_tol = 1e-7
line_search = none
dt = 1e-6
#end_time = 20.0
#end_time = 2000000.0
[./TimeStepper]
type = IterationAdaptiveDT
dt = 1e-6
optimal_iterations = 5
iteration_window = 2
[../]
[]
[Outputs]
exodus = true
print_perf_log = true
[]