forked from idaholab/stork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcorrosiontestmesh.i
226 lines (187 loc) · 3.9 KB
/
corrosiontestmesh.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
[Mesh]
file = corrosiontest.e
[]
[Functions]
[./c_one_y]
type = ParsedFunction
value = '(exp(((x-0.5)/(1e-2)))+1)^(-1)'
[../]
[./c_two_y]
type = ParsedFunction
value = '(exp(-((x-0.5)/(1e-2)))+1)^(-1)'
[../]
[./boundary_one_y]
type = ParsedFunction
value = '(sin(y))'
[../]
[./boundary_two_y]
type = ParsedFunction
value = '(sin(y))'
[../]
[]
[ICs]
[./concentrationone_ic]
type = FunctionIC
variable = concentrationone
function = c_one_y
[../]
[./concentrationtwo_ic]
type = FunctionIC
variable = concentrationtwo
function = c_two_y
[../]
[]
[GlobalParams]
#diffcoeff = 1e-09
#permittivity = 8.9e-12
#valence = 1.0
FaradayConst = 1.0
gasconstR = 8.3
temp = 273.0
#diffcoeff = 1.0
#permittivity = 1.0
#valence = 1.0
#FaradayConst = 1.0
#gasconstR = 1.0
#temp = 1.0
valenceone = 1.0
valencetwo = -1.0
concentrationone = concentrationone
concentrationtwo = concentrationtwo
Potential = Potential
[]
[AuxVariables]
[./totalconcentration]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Variables]
[./Potential]
order = FIRST
family = LAGRANGE
[../]
[./concentrationone]
order = FIRST
family = LAGRANGE
[../]
[./concentrationtwo]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./concentrationsum]
type = ConcentrationSum
variable = totalconcentration
[]
[Kernels]
[./diffusionone]
type = EDiffusion
variable = concentrationone
concentration = concentrationone
diffcoeff = 1.2e-09
[../]
[./diffusiontwo]
type = EDiffusion
variable = concentrationtwo
concentration = concentrationtwo
diffcoeff = 2.0e-09
[../]
[./migrationone]
type = Migration
variable = concentrationone
concentration = concentrationone
diffcoeff = 1.2e-09
valence = -1.0
[../]
[./migrationtwo]
type = Migration
variable = concentrationtwo
concentration = concentrationtwo
diffcoeff = 2.0e-09
valence = 1.0
[../]
[./electroneutrality]
type = NeutralityTwo
variable = Potential
[../]
[./laplace]
type = Electrostatics
variable = Potential
permittivity = 1.0
[../]
[./timederiv1]
type = TimeDerivative
variable = concentrationone
[../]
[./timederiv2]
type = TimeDerivative
variable = concentrationtwo
[../]
[]
[BCs]
#Mesh Generation produces boundaries in counter-clockwise fashion
#[./leftpotential]
# type = FunctionDirichletBC
# variable = Potential
# boundary = 1
# function = boundary_one_y
#[../]
#
#[./rightpotential]
# type = FunctionDirichletBC
# variable = Potential
# boundary = 2
# function = boundary_two_y
#[../]
[./leftpotential]
type = DirichletBC
variable = Potential
boundary = 1
value = 1
[../]
[./rightpotential]
type = DirichletBC
variable = Potential
boundary = 1
value = 0
[../]
[./concentrationone]
type = DirichletBC
variable = concentrationone
boundary = 1
value = 1
[../]
[./concentrationtwo]
type = DirichletBC
variable = concentrationtwo
boundary = 2
value = 1
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
#petsc_options = '-snes_check_jacobian' #this only works for small problems and with solve_type NEWTON
petsc_options_iname = '-ksp_gmres_restart -snes_rtol -ksp_rtol -pc_factor_zeropivot'
petsc_options_value = ' 121 1e-8 1e-8 1e-50 '
# snes_rtol e-8 is default
# ksp_rtol e-8 is default but rule of thumb says e-4 -> e-8 is acceptable
[../]
[]
[Executioner]
type = Transient
#Transient = TimeDependenet , Steady = No Time Kernels
# Preconditioned JFNK (default)
solve_type = 'PJFNK'
num_steps = 250
dt = 0.001
[]
[Outputs]
execute_on = 'timestep_end'
file_base = out_corrosiontest2
exodus = true
elemental_as_nodal = true
[]