~reducedmodelling/fluidity/ROM_Non-intrusive-ann

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
<?xml version="1.0" encoding="UTF-8" ?>

<testproblem>
   
  <name>mphase_sedimentation_1d</name>
  <owner userid="ctj10"/>
  <tags>flml</tags>
  
  <problem_definition length="short" nprocs="1">
    <command_line>make run</command_line>
    <!-- 1D multi-phase test case to check that the volume fraction fields are behaving properly. -->
   
    <!-- The test case considers a 1D domain filled with two incompressible fluids starting with a zero velocity field. -->
    <!-- One liquid is denser than the other (\rho_1 = 1.0, \rho_2 = 1.1) and the volume fraction of each phase is initially set to 0.5 everywhere. -->
    <!-- The heavier liquid should sink beneath the lighter one as time progresses due to the density difference, causing the volume fraction -->
    <!-- of the heavier liquid to tend to 1.0 and 0.0 in the lower and upper half of the domain respectively. -->
  </problem_definition>
  
  <variables>
    <variable name="f1_vfrac_max" language="python">
from fluidity_tools import stat_parser
s = stat_parser("mphase_sedimentation_1d.stat")
f1_vfrac_max = s["Fluid1"]["PhaseVolumeFraction"]["max"][-1]
    </variable>
    
    <variable name="f1_vfrac_min" language="python">
from fluidity_tools import stat_parser
s = stat_parser("mphase_sedimentation_1d.stat")
f1_vfrac_min = s["Fluid1"]["PhaseVolumeFraction"]["min"][-1]
    </variable>
    
    <variable name="f2_vfrac_max" language="python">
from fluidity_tools import stat_parser
s = stat_parser("mphase_sedimentation_1d.stat")
f2_vfrac_max = s["Fluid2"]["PhaseVolumeFraction"]["max"][-1]
    </variable>
    
    <variable name="f2_vfrac_min" language="python">
from fluidity_tools import stat_parser
s = stat_parser("mphase_sedimentation_1d.stat")
f2_vfrac_min = s["Fluid2"]["PhaseVolumeFraction"]["min"][-1]
    </variable>
    
    <variable name="f1_vfrac_integral" language="python">
from fluidity_tools import stat_parser
s = stat_parser("mphase_sedimentation_1d.stat")
f1_vfrac_integral = s["Fluid1"]["PhaseVolumeFraction"]["integral"][-1]
    </variable>
    
    <variable name="f2_vfrac_integral" language="python">
from fluidity_tools import stat_parser
s = stat_parser("mphase_sedimentation_1d.stat")
f2_vfrac_integral = s["Fluid2"]["PhaseVolumeFraction"]["integral"][-1]
    </variable>
    
    <variable name="divergence" language="python">
from fluidity_tools import stat_parser
s = stat_parser("mphase_sedimentation_1d.stat")
divergence = s["Fluid1"]["SumVelocityDivergence"]["max"][-1]
    </variable>
    
  </variables>
    
  <pass_tests>
    <test name="Fluid 1 has max(vfrac) in [0.9, 1.0]" language="python">
assert abs(f1_vfrac_max - 1.0) &lt; 1e-1
    </test>
    <test name="Fluid 1 has min(vfrac) in [0.0, 0.1]" language="python">
assert abs(f1_vfrac_min) &lt; 1e-1
    </test>
    <test name="Fluid 2 has max(vfrac) in [0.9, 1.0]" language="python">
assert abs(f2_vfrac_max - 1.0) &lt; 1e-1
    </test>
    <test name="Fluid 2 has min(vfrac) in [0.0, 0.1]" language="python">
assert abs(f2_vfrac_min) &lt; 1e-1
    </test>
    <test name="SumVelocityDivergence is less than 1e-8" language="python">
assert abs(divergence) &lt; 1e-8
    </test>
    <test name="PhaseVolumeFraction for Fluid 1 is conserved" language="python">
assert abs(f1_vfrac_integral - 0.5) &lt; 1e-6
    </test>
    <test name="PhaseVolumeFraction for Fluid 2 is conserved" language="python">
assert abs(f2_vfrac_integral - 0.5) &lt; 1e-6
    </test>
  </pass_tests>
  
  <warn_tests>
  </warn_tests>
  
</testproblem>