~fluidity-core/fluidity/sea-ice-branch

« back to all changes in this revision

Viewing changes to tests/mphase_inlet_velocity_bc_incompressible/mphase_inlet_velocity_bc_incompressible.xml

  • Committer: Simon Mouradian
  • Date: 2012-10-19 10:35:59 UTC
  • mfrom: (3520.32.371 fluidity)
  • Revision ID: simon.mouradian06@imperial.ac.uk-20121019103559-y36qa47phc69q8sc
mergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8" ?>
 
2
<!DOCTYPE testproblem SYSTEM "regressiontest.dtd">
 
3
 
 
4
<testproblem>
 
5
   
 
6
  <name>mphase_inlet_velocity_bc_incompressible</name>
 
7
  <owner userid="ctj10"/>
 
8
  <tags>flml</tags>
 
9
  
 
10
  <problem_definition length="short" nprocs="1">
 
11
    <command_line>make run</command_line>
 
12
    <!-- Check that we can do velocity inlet boundary conditions for incompressible multiphase flow. -->
 
13
    <!-- A velocity of 0.1 is prescribed on the left for the Gas phase. The velocity is zero for both -->
 
14
    <!-- phases on the right, and the left boundary is left open for the Particle phase. -->
 
15
    <!-- By continuity, the velocity should be equal and opposite at the left boundary for the Particle phase -->
 
16
    <!-- since we have a prescribed PhaseVolumeFraction of 0.5 for both phases. -->
 
17
  </problem_definition>
 
18
  
 
19
  <variables>  
 
20
      <variable name="gas_velocity_max" language="python">
 
21
from fluidity_tools import stat_parser
 
22
s = stat_parser("mphase_inlet_velocity_bc_incompressible.stat")
 
23
gas_velocity_max = s["Gas"]["Velocity%1"]["max"]
 
24
      </variable>
 
25
      
 
26
      <variable name="particle_velocity_max" language="python">
 
27
from fluidity_tools import stat_parser
 
28
s = stat_parser("mphase_inlet_velocity_bc_incompressible.stat")
 
29
particle_velocity_max = s["Particle"]["Velocity%1"]["max"]
 
30
      </variable>
 
31
      
 
32
      <variable name="particle_velocity_min" language="python">
 
33
from fluidity_tools import stat_parser
 
34
s = stat_parser("mphase_inlet_velocity_bc_incompressible.stat")
 
35
particle_velocity_min = s["Particle"]["Velocity%1"]["min"]
 
36
      </variable>
 
37
      
 
38
      <variable name="sum_velocity_divergence" language="python">
 
39
from fluidity_tools import stat_parser
 
40
s = stat_parser("mphase_inlet_velocity_bc_incompressible.stat")
 
41
sum_velocity_divergence = s["Gas"]["SumVelocityDivergence"]["max"]
 
42
      </variable>
 
43
  
 
44
    <variable name="solvers_converged" language="python">
 
45
import os
 
46
files = os.listdir("./")
 
47
solvers_converged = not "matrixdump" in files and not "matrixdump.info" in files
 
48
    </variable>
 
49
  </variables>
 
50
    
 
51
  <pass_tests>
 
52
      <test name="Maximum Gas::Velocity is always 0.1" language="python">
 
53
assert(abs(gas_velocity_max - 0.1).all() &lt; 1e-15)
 
54
      </test>
 
55
      
 
56
      <test name="Maximum Particle::Velocity (in magnitude) is 0.1 at the end of the simulation, and is opposite in direction" language="python">
 
57
assert(abs(particle_velocity_min[-1] + 0.1) &lt; 1e-15)
 
58
assert(abs(particle_velocity_max[-1]) &lt; 1e-15)
 
59
      </test>
 
60
      
 
61
      <test name="SumVelocityDivergence is approximately zero" language="python">
 
62
assert(abs(sum_velocity_divergence[-1]) &lt; 1e-11)
 
63
      </test>
 
64
     
 
65
    <test name="Solvers converged" language="python">
 
66
assert(solvers_converged)
 
67
    </test>
 
68
  </pass_tests>
 
69
  
 
70
  <warn_tests>
 
71
  </warn_tests>
 
72
  
 
73
</testproblem>