1
<?xml version='1.0' encoding='utf-8'?>
4
<string_value lines="1">darcy_p0p1_test_cty_cv_pressBCinlet_2d</string_value>
5
<comment>a simple short test case for darcy flow using the element type p0p1_test_cty_cv for velocity-pressure
7
the darcy velocity is solved for then the tracer is advected using a CV scheme on a continuous mesh.
9
it compares the pressure gradient against the analytic, as well as checking that the interstitial velocity is correct
11
the darcy flow equation is
13
sigma*darcy_vel = - grad P
15
where darcy_vel = porosity*interstitial_velocity
17
sigma is a function of viscosity and permeability
19
python diagnostics are used to form the sigma term that is assoicated with a p0 dg mesh (ie. element wise) and the interstitial velocity
21
this case has a 1 region 1 material with pressure boundary condition inflow.
23
to get a darcy equation the time, stress and advection terms are not included in a bousinessq formulation (to avoid needing to specify a density). Ideally it would be better to actually have a darcy momentum option to simplify the input.
25
the absorption term is included in the pressure correction (being a necessity as it is the only term in the matrix equation)
27
the geometry is 2d (although this is a 1d problem)
29
NOTE: Because the velocity and pressure are time independent the simulation is broken into two.
30
First the velocity and pressure are solved and checkpointed.
31
Second the tracer is advected using a prescribed velocity from the previous checkpointed run.</comment>
34
<string_value lines="1">fluids</string_value>
38
<integer_value rank="0">2</integer_value>
40
<mesh name="CoordinateMesh">
41
<from_file file_name="steptwochannel">
48
<mesh name="VelocityMesh">
50
<mesh name="CoordinateMesh"/>
53
<integer_value rank="0">0</integer_value>
57
<string_value>discontinuous</string_value>
64
<mesh name="PressureMesh">
66
<mesh name="CoordinateMesh"/>
74
<mesh name="CoordinateMesh"/>
77
<integer_value rank="0">0</integer_value>
81
<string_value>discontinuous</string_value>
90
<integer_value rank="0">3</integer_value>
96
<string_value>vtk</string_value>
98
<dump_period_in_timesteps>
100
<integer_value rank="0">0</integer_value>
102
</dump_period_in_timesteps>
103
<output_mesh name="VelocityMesh"/>
105
<checkpoint_period_in_dumps>
106
<integer_value rank="0">1000</integer_value>
107
</checkpoint_period_in_dumps>
114
<real_value rank="0">0.0</real_value>
117
<real_value rank="0">0.1</real_value>
120
<real_value rank="0">9.0</real_value>
123
<integer_value rank="0">1</integer_value>
126
<material_phase name="fluid">
127
<scalar_field name="Pressure" rank="0">
129
<mesh name="PressureMesh"/>
130
<spatial_discretisation>
131
<continuous_galerkin>
132
<test_continuity_with_cv_dual/>
133
</continuous_galerkin>
134
</spatial_discretisation>
136
<poisson_pressure_solution>
137
<string_value lines="1">never</string_value>
138
</poisson_pressure_solution>
139
<use_projection_method/>
140
<update_discretised_equation/>
143
<iterative_method name="gmres">
145
<integer_value rank="0">30</integer_value>
148
<preconditioner name="sor"/>
150
<real_value rank="0">1.0e-10</real_value>
153
<integer_value rank="0">1000</integer_value>
155
<never_ignore_solver_failures/>
160
<boundary_conditions name="right_outflow">
162
<integer_value shape="1" rank="1">8</integer_value>
164
<type name="dirichlet">
166
<real_value rank="0">0.0</real_value>
169
</boundary_conditions>
170
<boundary_conditions name="left_inflow">
172
<integer_value shape="2" rank="1">10 100</integer_value>
174
<type name="dirichlet">
176
<real_value rank="0">1.5e+09</real_value>
179
</boundary_conditions>
183
<include_in_convergence/>
186
<exclude_from_detectors/>
189
<include_in_steady_state/>
194
<vector_field name="Velocity" rank="1">
196
<mesh name="VelocityMesh"/>
197
<equation name="Boussinesq"/>
198
<spatial_discretisation>
199
<discontinuous_galerkin>
201
<exclude_mass_terms/>
204
<compact_discontinuous_galerkin/>
208
<integrate_advection_by_parts>
210
</integrate_advection_by_parts>
212
</discontinuous_galerkin>
213
<conservative_advection>
214
<real_value rank="0">0.0</real_value>
215
</conservative_advection>
216
</spatial_discretisation>
217
<temporal_discretisation>
219
<real_value rank="0">1.0</real_value>
222
<real_value rank="0">1.0</real_value>
224
</temporal_discretisation>
226
<iterative_method name="gmres">
228
<integer_value rank="0">30</integer_value>
231
<preconditioner name="sor"/>
233
<real_value rank="0">1.0e-10</real_value>
236
<integer_value rank="0">1000</integer_value>
238
<never_ignore_solver_failures/>
243
<initial_condition name="WholeMesh">
245
<real_value shape="2" dim1="dim" rank="1">0.0 0.0</real_value>
248
<boundary_conditions name="no_outflow_top_bottom">
250
<integer_value shape="2" rank="1">7 9</integer_value>
252
<type name="dirichlet">
254
<align_bc_with_cartesian>
257
<real_value rank="0">0.0</real_value>
260
</align_bc_with_cartesian>
262
</boundary_conditions>
263
<vector_field name="Absorption" rank="1">
266
<algorithm name="vector_python_diagnostic" material_phase_support="multiple">
267
<string_value lines="20" type="python"># get the prescribed fields
268
perm = states["fluid"].scalar_fields["Permeability"]
269
visc = states["fluid"].scalar_fields["Viscosity"]
271
# loop the DMmesh_p0 nodes (which are element centred)
272
for n in range(field.node_count):
273
perm_n = perm.node_val(n)
274
visc_n = visc.node_val(n)
276
# calc the absorption term
277
sigma_n = visc_n/perm_n
279
# set the absorption term
280
field.set(n,sigma_n)</string_value>
281
<comment>this assumes that the porosity, absorption, permeability, and viscosity are defined on a p0 dg mesh (ie. element wise) such that the number of nodes is also the number of elements
283
also assume that the velocity is dg</comment>
290
<include_in_convergence/>
293
<include_in_detectors/>
296
<include_in_steady_state/>
299
<include_pressure_correction/>
306
</previous_time_step>
312
<include_in_convergence/>
315
<include_in_detectors/>
318
<include_in_steady_state/>
320
<consistent_interpolation/>
323
<scalar_field name="Viscosity" rank="0">
326
<value name="WholeMesh">
328
<real_value rank="0">1.0e-04</real_value>
334
<exclude_from_detectors/>
338
<scalar_field name="ControlVolumeDivergence" rank="0">
339
<diagnostic field_name="Velocity">
340
<algorithm name="Internal" material_phase_support="multiple"/>
341
<mesh name="PressureMesh"/>
345
<include_in_convergence/>
348
<include_in_detectors/>
351
<include_in_steady_state/>
355
<vector_field name="InterstitialVelocity" rank="1">
357
<algorithm name="vector_python_diagnostic" material_phase_support="multiple">
358
<string_value lines="20" type="python">phi = states["fluid"].scalar_fields["Porosity"]
359
darcy_vel = states["fluid"].vector_fields["Velocity"]
361
for ele in range(field.element_count):
362
phi_ele = phi.node_val(ele)
364
factor_ele = 1.0/max(phi_ele,1.0e-08)
367
for i in range(len(darcy_vel.ele_val(ele))):
368
vel_ele.append(factor_ele*darcy_vel.ele_val(ele)[i])
370
field.set(darcy_vel.ele_nodes(ele),vel_ele)</string_value>
372
<mesh name="VelocityMesh"/>
378
<include_in_convergence/>
381
<include_in_detectors/>
384
<include_in_steady_state/>
390
<scalar_field name="Porosity">
393
<value name="left_bottom">
395
<integer_value shape="1" rank="1">11</integer_value>
398
<real_value rank="0">0.1</real_value>
401
<value name="right_bottom">
403
<integer_value shape="1" rank="1">12</integer_value>
406
<real_value rank="0">0.4</real_value>
409
<value name="left_top">
411
<integer_value shape="1" rank="1">13</integer_value>
414
<real_value rank="0">0.2</real_value>
417
<value name="right_top">
419
<integer_value shape="1" rank="1">14</integer_value>
422
<real_value rank="0">0.2</real_value>
428
<exclude_from_detectors/>
432
<scalar_field name="Permeability">
435
<value name="WholeMesh">
437
<real_value rank="0">1.0e-10</real_value>
443
<exclude_from_detectors/>