forked from idaholab/moose
/
grav02d.i
395 lines (378 loc) · 7.64 KB
/
grav02d.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
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# Checking that gravity head is established in the transient situation when 0<=saturation<=1 (note the less-than-or-equal-to).
# 2phase (PP), 2components, vanGenuchten, constant fluid bulk-moduli for each phase, constant viscosity, constant permeability, Corey relative perm.
# A boundary condition enforces porepressures at the right boundary
# For better agreement with the analytical solution (ana_pp), just increase nx
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
xmin = -1
xmax = 0
[]
[GlobalParams]
PorousFlowDictator = dictator
[]
[Functions]
[./dts]
type = PiecewiseLinear
x = '1E-3 1E-2 1E-1 2E-1'
y = '1E-3 1E-2 0.2E-1 1E-1'
[../]
[]
[Variables]
[./ppwater]
initial_condition = 0
[../]
[./ppgas]
initial_condition = 0.5
[../]
[]
[AuxVariables]
[./massfrac_ph0_sp0]
initial_condition = 1
[../]
[./massfrac_ph1_sp0]
initial_condition = 0
[../]
[]
[BCs]
[./ppwater]
type = PresetBC
boundary = right
variable = ppwater
value = 0
[../]
[./ppgas]
type = PresetBC
boundary = right
variable = ppgas
value = 0.5
[../]
[]
[Kernels]
[./mass0]
type = PorousFlowMassTimeDerivative
fluid_component = 0
variable = ppwater
[../]
[./flux0]
type = PorousFlowAdvectiveFlux
fluid_component = 0
variable = ppwater
gravity = '-1 0 0'
[../]
[./mass1]
type = PorousFlowMassTimeDerivative
fluid_component = 1
variable = ppgas
[../]
[./flux1]
type = PorousFlowAdvectiveFlux
fluid_component = 1
variable = ppgas
gravity = '-1 0 0'
[../]
[]
[Functions]
[./ana_ppwater]
type = ParsedFunction
vars = 'g B p0 rho0'
vals = '1 2 pp_water_top 1'
value = '-B*log(exp(-p0/B)+g*rho0*x/B)' # expected pp at base
[../]
[]
[UserObjects]
[./dictator]
type = PorousFlowDictator
porous_flow_vars = 'ppwater ppgas'
number_fluid_phases = 2
number_fluid_components = 2
[../]
[./pc]
type = PorousFlowCapillaryPressureVG
m = 0.5
alpha = 1
[../]
[]
[Modules]
[./FluidProperties]
[./simple_fluid0]
type = SimpleFluidProperties
bulk_modulus = 1.2
density0 = 1
viscosity = 1
thermal_expansion = 0
[../]
[./simple_fluid1]
type = SimpleFluidProperties
bulk_modulus = 1
density0 = 0.1
viscosity = 0.5
thermal_expansion = 0
[../]
[../]
[]
[Materials]
[./temperature]
type = PorousFlowTemperature
[../]
[./temperature_nodal]
type = PorousFlowTemperature
at_nodes = true
[../]
[./ppss]
type = PorousFlow2PhasePP
at_nodes = true
phase0_porepressure = ppwater
phase1_porepressure = ppgas
capillary_pressure = pc
[../]
[./ppss_qp]
type = PorousFlow2PhasePP
phase0_porepressure = ppwater
phase1_porepressure = ppgas
capillary_pressure = pc
[../]
[./massfrac]
type = PorousFlowMassFraction
at_nodes = true
mass_fraction_vars = 'massfrac_ph0_sp0 massfrac_ph1_sp0'
[../]
[./simple_fluid0]
type = PorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
at_nodes = true
[../]
[./simple_fluid0_qp]
type = PorousFlowSingleComponentFluid
fp = simple_fluid0
phase = 0
[../]
[./simple_fluid1]
type = PorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
at_nodes = true
[../]
[./simple_fluid1_qp]
type = PorousFlowSingleComponentFluid
fp = simple_fluid1
phase = 1
[../]
[./dens_all]
type = PorousFlowJoiner
include_old = true
at_nodes = true
material_property = PorousFlow_fluid_phase_density_nodal
[../]
[./dens_qp_all]
type = PorousFlowJoiner
material_property = PorousFlow_fluid_phase_density_qp
at_nodes = false
[../]
[./visc_all]
type = PorousFlowJoiner
at_nodes = true
material_property = PorousFlow_viscosity_nodal
[../]
[./porosity]
type = PorousFlowPorosityConst
at_nodes = true
porosity = 0.1
[../]
[./permeability]
type = PorousFlowPermeabilityConst
permeability = '1 0 0 0 2 0 0 0 3'
[../]
[./relperm_water]
type = PorousFlowRelativePermeabilityCorey
n = 1
phase = 0
[../]
[./relperm_gas]
type = PorousFlowRelativePermeabilityCorey
n = 1
phase = 1
[../]
[./relperm_all]
type = PorousFlowJoiner
material_property = PorousFlow_relative_permeability_qp
[../]
[./relperm_water_nodal]
type = PorousFlowRelativePermeabilityCorey
at_nodes = true
n = 1
phase = 0
[../]
[./relperm_gas_nodal]
type = PorousFlowRelativePermeabilityCorey
at_nodes = true
n = 1
phase = 1
[../]
[./relperm_all_nodal]
type = PorousFlowJoiner
at_nodes = true
material_property = PorousFlow_relative_permeability_nodal
[../]
[]
[Postprocessors]
[./pp_water_top]
type = PointValue
variable = ppwater
point = '0 0 0'
[../]
[./pp_water_base]
type = PointValue
variable = ppwater
point = '-1 0 0'
[../]
[./pp_water_analytical]
type = FunctionValuePostprocessor
function = ana_ppwater
point = '-1 0 0'
[../]
[./ppwater_00]
type = PointValue
variable = ppwater
point = '0 0 0'
[../]
[./ppwater_01]
type = PointValue
variable = ppwater
point = '-0.1 0 0'
[../]
[./ppwater_02]
type = PointValue
variable = ppwater
point = '-0.2 0 0'
[../]
[./ppwater_03]
type = PointValue
variable = ppwater
point = '-0.3 0 0'
[../]
[./ppwater_04]
type = PointValue
variable = ppwater
point = '-0.4 0 0'
[../]
[./ppwater_05]
type = PointValue
variable = ppwater
point = '-0.5 0 0'
[../]
[./ppwater_06]
type = PointValue
variable = ppwater
point = '-0.6 0 0'
[../]
[./ppwater_07]
type = PointValue
variable = ppwater
point = '-0.7 0 0'
[../]
[./ppwater_08]
type = PointValue
variable = ppwater
point = '-0.8 0 0'
[../]
[./ppwater_09]
type = PointValue
variable = ppwater
point = '-0.9 0 0'
[../]
[./ppwater_10]
type = PointValue
variable = ppwater
point = '-1 0 0'
[../]
[./ppgas_00]
type = PointValue
variable = ppgas
point = '0 0 0'
[../]
[./ppgas_01]
type = PointValue
variable = ppgas
point = '-0.1 0 0'
[../]
[./ppgas_02]
type = PointValue
variable = ppgas
point = '-0.2 0 0'
[../]
[./ppgas_03]
type = PointValue
variable = ppgas
point = '-0.3 0 0'
[../]
[./ppgas_04]
type = PointValue
variable = ppgas
point = '-0.4 0 0'
[../]
[./ppgas_05]
type = PointValue
variable = ppgas
point = '-0.5 0 0'
[../]
[./ppgas_06]
type = PointValue
variable = ppgas
point = '-0.6 0 0'
[../]
[./ppgas_07]
type = PointValue
variable = ppgas
point = '-0.7 0 0'
[../]
[./ppgas_08]
type = PointValue
variable = ppgas
point = '-0.8 0 0'
[../]
[./ppgas_09]
type = PointValue
variable = ppgas
point = '-0.9 0 0'
[../]
[./ppgas_10]
type = PointValue
variable = ppgas
point = '-1 0 0'
[../]
[]
[Preconditioning]
active = andy
[./andy]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it'
petsc_options_value = 'bcgs bjacobi 1E-12 1E-10 10000'
[../]
[./check]
type = SMP
full = true
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it -snes_type'
petsc_options_value = 'bcgs bjacobi 1E-12 1E-10 10000 test'
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
[./TimeStepper]
type = FunctionDT
function = dts
[../]
end_time = 1.0
[]
[Outputs]
execute_on = 'initial final'
file_base = grav02d
[./csv]
type = CSV
[../]
exodus = true
[]