~reducedmodelling/fluidity/ROM_Non-intrusive-ann

« back to all changes in this revision

Viewing changes to tests/darcy_p0p1cv_velBCinlet_1solidphase/darcy_p0p1cv_velBCinlet_1solidphase_3d.flml

  • Committer: Brendan Tollit
  • Date: 2011-11-20 13:22:14 UTC
  • mto: This revision was merged to the branch mainline in revision 3860.
  • Revision ID: brendan.tollit05@imperial.ac.uk-20111120132214-no8ljc9argzddwon
Remove the two darcy test cases that were there in 1d and 
replace them with versions that do 1,2 and 3d.

Change the sign of the ct_rhs add to in Divergence_CV.F90 
for incompressible flow.

Adjust the darcy test that was there to test this so that 
it runs and the 1,2 and 3d version use weak velocity BC.

Add a similar test that uses two phase but one with a large 
absorption such as to be the solid porous media. This tests
the multiphase ct_rhs add to sign change.

The mms_ns case still has issues.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version='1.0' encoding='utf-8'?>
 
2
<fluidity_options>
 
3
  <simulation_name>
 
4
    <string_value lines="1">darcy_p0p1cv_velBCinlet_1solidphase_3d</string_value>
 
5
    <comment>a simple short test case for darcy flow using the element type p0p1cv for velocity-pressure
 
6
 
 
7
the intestitial velocity is solved for via defining a second phase with the solid volume fraction.
 
8
 
 
9
it compares the pressure gradient against the analytic, as well as checking that the interstitial velocity is correct 
 
10
 
 
11
the darcy flow equation is
 
12
 
 
13
sigma*darcy_vel = - grad P
 
14
 
 
15
sigma is a function of viscosity and permeability which are two input fields that are named in the flml - not on fluidity special names (ie. this doesnt use the porous media object options)
 
16
 
 
17
python diagnostics are used to form the sigma term that is assoicated with a p0 dg mesh (ie. element wise) and the interstitial velocity
 
18
 
 
19
this case has a 1 region 1 material with velocity boundary condition inflow. 
 
20
 
 
21
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.
 
22
 
 
23
the absorption term is included in the pressure correction (being a necessity as it is the only term in the matrix equation) 
 
24
 
 
25
the geometry is 3d (although this is a 1d problem) and one time step is done (as nothing depends on time)
 
26
</comment>
 
27
  </simulation_name>
 
28
  <problem_type>
 
29
    <string_value lines="1">fluids</string_value>
 
30
  </problem_type>
 
31
  <geometry>
 
32
    <dimension>
 
33
      <integer_value rank="0">3</integer_value>
 
34
    </dimension>
 
35
    <mesh name="CoordinateMesh">
 
36
      <from_file file_name="cube">
 
37
        <format name="gmsh"/>
 
38
        <stat>
 
39
          <include_in_stat/>
 
40
        </stat>
 
41
      </from_file>
 
42
    </mesh>
 
43
    <mesh name="VelocityMesh">
 
44
      <from_mesh>
 
45
        <mesh name="CoordinateMesh"/>
 
46
        <mesh_shape>
 
47
          <polynomial_degree>
 
48
            <integer_value rank="0">0</integer_value>
 
49
          </polynomial_degree>
 
50
        </mesh_shape>
 
51
        <mesh_continuity>
 
52
          <string_value>discontinuous</string_value>
 
53
        </mesh_continuity>
 
54
        <stat>
 
55
          <exclude_from_stat/>
 
56
        </stat>
 
57
      </from_mesh>
 
58
    </mesh>
 
59
    <mesh name="PressureMesh">
 
60
      <from_mesh>
 
61
        <mesh name="CoordinateMesh"/>
 
62
        <mesh_shape>
 
63
          <polynomial_degree>
 
64
            <integer_value rank="0">1</integer_value>
 
65
          </polynomial_degree>
 
66
        </mesh_shape>
 
67
        <stat>
 
68
          <exclude_from_stat/>
 
69
        </stat>
 
70
      </from_mesh>
 
71
    </mesh>
 
72
    <mesh name="OutputMesh">
 
73
      <from_mesh>
 
74
        <mesh name="CoordinateMesh"/>
 
75
        <mesh_continuity>
 
76
          <string_value>discontinuous</string_value>
 
77
        </mesh_continuity>
 
78
        <stat>
 
79
          <exclude_from_stat/>
 
80
        </stat>
 
81
      </from_mesh>
 
82
    </mesh>
 
83
    <quadrature>
 
84
      <degree>
 
85
        <integer_value rank="0">5</integer_value>
 
86
      </degree>
 
87
    </quadrature>
 
88
  </geometry>
 
89
  <io>
 
90
    <dump_format>
 
91
      <string_value>vtk</string_value>
 
92
    </dump_format>
 
93
    <dump_period_in_timesteps>
 
94
      <constant>
 
95
        <integer_value rank="0">0</integer_value>
 
96
      </constant>
 
97
    </dump_period_in_timesteps>
 
98
    <output_mesh name="OutputMesh"/>
 
99
    <stat/>
 
100
  </io>
 
101
  <timestepping>
 
102
    <current_time>
 
103
      <real_value rank="0">0.0</real_value>
 
104
    </current_time>
 
105
    <timestep>
 
106
      <real_value rank="0">1.0</real_value>
 
107
    </timestep>
 
108
    <finish_time>
 
109
      <real_value rank="0">1.0</real_value>
 
110
    </finish_time>
 
111
  </timestepping>
 
112
  <material_phase name="fluid">
 
113
    <scalar_field name="Pressure" rank="0">
 
114
      <prognostic>
 
115
        <mesh name="PressureMesh"/>
 
116
        <spatial_discretisation>
 
117
          <control_volumes/>
 
118
        </spatial_discretisation>
 
119
        <scheme>
 
120
          <poisson_pressure_solution>
 
121
            <string_value lines="1">never</string_value>
 
122
          </poisson_pressure_solution>
 
123
          <use_projection_method/>
 
124
        </scheme>
 
125
        <solver>
 
126
          <iterative_method name="cg"/>
 
127
          <preconditioner name="sor"/>
 
128
          <relative_error>
 
129
            <real_value rank="0">1.0e-10</real_value>
 
130
          </relative_error>
 
131
          <max_iterations>
 
132
            <integer_value rank="0">1000</integer_value>
 
133
          </max_iterations>
 
134
          <never_ignore_solver_failures/>
 
135
          <diagnostics>
 
136
            <monitors/>
 
137
          </diagnostics>
 
138
        </solver>
 
139
        <boundary_conditions name="right_outflow">
 
140
          <surface_ids>
 
141
            <integer_value shape="1" rank="1">4</integer_value>
 
142
          </surface_ids>
 
143
          <type name="dirichlet">
 
144
            <constant>
 
145
              <real_value rank="0">0.0</real_value>
 
146
            </constant>
 
147
          </type>
 
148
        </boundary_conditions>
 
149
        <output/>
 
150
        <stat/>
 
151
        <convergence>
 
152
          <include_in_convergence/>
 
153
        </convergence>
 
154
        <detectors>
 
155
          <exclude_from_detectors/>
 
156
        </detectors>
 
157
        <steady_state>
 
158
          <include_in_steady_state/>
 
159
        </steady_state>
 
160
        <no_interpolation/>
 
161
      </prognostic>
 
162
    </scalar_field>
 
163
    <vector_field name="Velocity" rank="1">
 
164
      <prognostic>
 
165
        <mesh name="VelocityMesh"/>
 
166
        <equation name="Boussinesq"/>
 
167
        <spatial_discretisation>
 
168
          <discontinuous_galerkin>
 
169
            <mass_terms>
 
170
              <exclude_mass_terms/>
 
171
            </mass_terms>
 
172
            <viscosity_scheme>
 
173
              <compact_discontinuous_galerkin/>
 
174
            </viscosity_scheme>
 
175
            <advection_scheme>
 
176
              <none/>
 
177
              <integrate_advection_by_parts>
 
178
                <twice/>
 
179
              </integrate_advection_by_parts>
 
180
            </advection_scheme>
 
181
          </discontinuous_galerkin>
 
182
          <conservative_advection>
 
183
            <real_value rank="0">0.0</real_value>
 
184
          </conservative_advection>
 
185
        </spatial_discretisation>
 
186
        <temporal_discretisation>
 
187
          <theta>
 
188
            <real_value rank="0">1.0</real_value>
 
189
          </theta>
 
190
          <relaxation>
 
191
            <real_value rank="0">1.0</real_value>
 
192
          </relaxation>
 
193
        </temporal_discretisation>
 
194
        <solver>
 
195
          <iterative_method name="gmres">
 
196
            <restart>
 
197
              <integer_value rank="0">30</integer_value>
 
198
            </restart>
 
199
          </iterative_method>
 
200
          <preconditioner name="sor"/>
 
201
          <relative_error>
 
202
            <real_value rank="0">1.0e-10</real_value>
 
203
          </relative_error>
 
204
          <max_iterations>
 
205
            <integer_value rank="0">1000</integer_value>
 
206
          </max_iterations>
 
207
          <never_ignore_solver_failures/>
 
208
          <diagnostics>
 
209
            <monitors/>
 
210
          </diagnostics>
 
211
        </solver>
 
212
        <initial_condition name="WholeMesh">
 
213
          <constant>
 
214
            <real_value shape="3" dim1="dim" rank="1">0.0 0.0 0.0</real_value>
 
215
          </constant>
 
216
        </initial_condition>
 
217
        <boundary_conditions name="left_inflow">
 
218
          <surface_ids>
 
219
            <integer_value shape="1" rank="1">3</integer_value>
 
220
          </surface_ids>
 
221
          <type name="dirichlet">
 
222
            <apply_weakly/>
 
223
            <align_bc_with_cartesian>
 
224
              <x_component>
 
225
                <constant>
 
226
                  <real_value rank="0">10.0</real_value>
 
227
                </constant>
 
228
              </x_component>
 
229
            </align_bc_with_cartesian>
 
230
          </type>
 
231
        </boundary_conditions>
 
232
        <boundary_conditions name="no_outflow_top_bottom">
 
233
          <surface_ids>
 
234
            <integer_value shape="2" rank="1">1 2</integer_value>
 
235
          </surface_ids>
 
236
          <type name="dirichlet">
 
237
            <apply_weakly/>
 
238
            <align_bc_with_cartesian>
 
239
              <z_component>
 
240
                <constant>
 
241
                  <real_value rank="0">0.0</real_value>
 
242
                </constant>
 
243
              </z_component>
 
244
            </align_bc_with_cartesian>
 
245
          </type>
 
246
        </boundary_conditions>
 
247
        <boundary_conditions name="no_outflow_front_back">
 
248
          <surface_ids>
 
249
            <integer_value shape="2" rank="1">5 6</integer_value>
 
250
          </surface_ids>
 
251
          <type name="dirichlet">
 
252
            <apply_weakly/>
 
253
            <align_bc_with_cartesian>
 
254
              <y_component>
 
255
                <constant>
 
256
                  <real_value rank="0">0.0</real_value>
 
257
                </constant>
 
258
              </y_component>
 
259
            </align_bc_with_cartesian>
 
260
          </type>
 
261
        </boundary_conditions>
 
262
        <vector_field name="Absorption" rank="1">
 
263
          <diagnostic>
 
264
            <mesh name="PressureMesh"/>
 
265
            <algorithm name="vector_python_diagnostic" material_phase_support="multiple">
 
266
              <string_value lines="20" type="python"># get the prescribed fields 
 
267
perm = states["fluid"].scalar_fields["Permeability"]
 
268
visc = states["fluid"].scalar_fields["Viscosity"]
 
269
volf_f = states["fluid"].scalar_fields["PhaseVolumeFraction"]
 
270
 
 
271
for n in range(field.node_count):
 
272
   perm_n = perm.node_val(n)
 
273
   visc_n = visc.node_val(n)
 
274
   volf_f_n = volf_f.node_val(n)
 
275
   
 
276
   # porosity is this fluid volf for one phase
 
277
   phi_n = volf_f_n
 
278
   
 
279
   # calc the absorption term
 
280
   sigma_n = phi_n*visc_n/perm_n
 
281
   
 
282
   # set the absorption term
 
283
   field.set(n,sigma_n)</string_value>
 
284
            </algorithm>
 
285
            <output/>
 
286
            <stat>
 
287
              <include_in_stat/>
 
288
            </stat>
 
289
            <convergence>
 
290
              <include_in_convergence/>
 
291
            </convergence>
 
292
            <detectors>
 
293
              <include_in_detectors/>
 
294
            </detectors>
 
295
            <steady_state>
 
296
              <include_in_steady_state/>
 
297
            </steady_state>
 
298
          </diagnostic>
 
299
          <include_pressure_correction/>
 
300
        </vector_field>
 
301
        <output/>
 
302
        <stat>
 
303
          <include_in_stat/>
 
304
          <previous_time_step>
 
305
            <exclude_from_stat/>
 
306
          </previous_time_step>
 
307
          <nonlinear_field>
 
308
            <exclude_from_stat/>
 
309
          </nonlinear_field>
 
310
        </stat>
 
311
        <convergence>
 
312
          <include_in_convergence/>
 
313
        </convergence>
 
314
        <detectors>
 
315
          <include_in_detectors/>
 
316
        </detectors>
 
317
        <steady_state>
 
318
          <include_in_steady_state/>
 
319
        </steady_state>
 
320
        <consistent_interpolation/>
 
321
      </prognostic>
 
322
    </vector_field>
 
323
    <scalar_field name="Permeability" rank="0">
 
324
      <prescribed>
 
325
        <mesh name="PressureMesh"/>
 
326
        <value name="WholeMesh">
 
327
          <constant>
 
328
            <real_value rank="0">1.0e-10</real_value>
 
329
          </constant>
 
330
        </value>
 
331
        <output/>
 
332
        <stat/>
 
333
        <detectors>
 
334
          <exclude_from_detectors/>
 
335
        </detectors>
 
336
      </prescribed>
 
337
    </scalar_field>
 
338
    <scalar_field name="Viscosity" rank="0">
 
339
      <prescribed>
 
340
        <mesh name="PressureMesh"/>
 
341
        <value name="WholeMesh">
 
342
          <constant>
 
343
            <real_value rank="0">1.0e-04</real_value>
 
344
          </constant>
 
345
        </value>
 
346
        <output/>
 
347
        <stat/>
 
348
        <detectors>
 
349
          <exclude_from_detectors/>
 
350
        </detectors>
 
351
      </prescribed>
 
352
    </scalar_field>
 
353
    <scalar_field name="PhaseVolumeFraction" rank="0">
 
354
      <diagnostic>
 
355
        <mesh name="PressureMesh"/>
 
356
        <algorithm name="Internal" material_phase_support="multiple"/>
 
357
        <output/>
 
358
        <stat/>
 
359
        <detectors>
 
360
          <include_in_detectors/>
 
361
        </detectors>
 
362
      </diagnostic>
 
363
    </scalar_field>
 
364
  </material_phase>
 
365
  <material_phase name="solid">
 
366
    <vector_field name="Velocity" rank="1">
 
367
      <prescribed>
 
368
        <mesh name="VelocityMesh"/>
 
369
        <value name="WholeMesh">
 
370
          <constant>
 
371
            <real_value shape="3" dim1="dim" rank="1">0.0 0.0 0.0</real_value>
 
372
          </constant>
 
373
        </value>
 
374
        <output/>
 
375
        <stat>
 
376
          <include_in_stat/>
 
377
        </stat>
 
378
        <detectors>
 
379
          <exclude_from_detectors/>
 
380
        </detectors>
 
381
      </prescribed>
 
382
    </vector_field>
 
383
    <scalar_field name="PhaseVolumeFraction" rank="0">
 
384
      <prescribed>
 
385
        <mesh name="PressureMesh"/>
 
386
        <value name="WholeMesh">
 
387
          <constant>
 
388
            <real_value rank="0">0.5</real_value>
 
389
          </constant>
 
390
        </value>
 
391
        <output/>
 
392
        <stat/>
 
393
        <detectors>
 
394
          <exclude_from_detectors/>
 
395
        </detectors>
 
396
      </prescribed>
 
397
    </scalar_field>
 
398
  </material_phase>
 
399
</fluidity_options>