1
<?xml version="1.0" encoding="UTF-8" ?>
2
<!DOCTYPE testproblem SYSTEM "regressiontest.dtd">
4
<name>p2lumpedp1 RANS k-epsilon spatial convergence test with strong bcs</name>
5
<owner userid="sparkinson"/>
7
<problem_definition length="medium" nprocs="1">
8
<command_line>fluidity -v3 MMS_A.flml > MMS_A.log; fluidity -v3 MMS_B.flml > MMS_B.log; fluidity -v3 MMS_C.flml > MMS_C.log; fluidity -v3 MMS_D.flml > MMS_D.log</command_line>
11
<variable name="convergence" language="python">
12
from fluidity_tools import stat_parser as stat
16
meshes = [['A','B'], ['B','C'], ['C','D']]
18
convergence = np.ones(12) * 1e10
21
print 'ORDER OF CONVERGENCE'
22
print '-------------------------------------------'
24
print 'VelocityError:'
25
print '-------------------------------------------'
27
for i, mesh in enumerate(meshes):
29
a_error_x = stat("MMS_"+str(mesh[0])+".stat")["NS"]["VelocityError%1"]["l2norm"][-1]
30
b_error_x = stat("MMS_"+str(mesh[1])+".stat")["NS"]["VelocityError%1"]["l2norm"][-1]
31
a_error_y = stat("MMS_"+str(mesh[0])+".stat")["NS"]["VelocityError%2"]["l2norm"][-1]
32
b_error_y = stat("MMS_"+str(mesh[1])+".stat")["NS"]["VelocityError%2"]["l2norm"][-1]
34
ratio_x = a_error_x / b_error_x
35
ratio_y = a_error_y / b_error_y
37
print mesh[0] + '->' + mesh[1] + ': ', [log(ratio_x, 2), log(ratio_y, 2)]
39
convergence[0] = min(log(ratio_x, 2), log(ratio_y, 2), convergence[0])
41
print '-------------------------------------------'
43
fields = ['TurbulentKineticEnergy_production_termError',
44
'TurbulentKineticEnergy_destruction_termError',
45
'TurbulentKineticEnergy_buoyancy_termError',
46
'TurbulentKineticEnergyError',
47
'TurbulentDissipation_production_termError',
48
'TurbulentDissipation_destruction_termError',
49
'TurbulentDissipation_buoyancy_termError',
50
'TurbulentDissipationError',
51
'ScalarEddyViscosityError',
56
for i, field in enumerate(fields):
58
print '-------------------------------------------'
60
for j, mesh in enumerate(meshes):
62
a_error = stat("MMS_"+str(mesh[0])+".stat")["NS"][field]["l2norm"][-1]
63
b_error = stat("MMS_"+str(mesh[1])+".stat")["NS"][field]["l2norm"][-1]
65
ratio = a_error / b_error
67
print mesh[0] + '->' + mesh[1] + ': ', log(ratio, 2)
69
convergence[i+1] = min(log(ratio, 2), convergence[i+1])
71
print '-------------------------------------------'
75
<variable name="a_finish_time" language="python">
76
from fluidity_tools import stat_parser as stat
77
a_finish_time = stat("MMS_A.stat")["ElapsedTime"]["value"][-1]
79
<variable name="b_finish_time" language="python">
80
from fluidity_tools import stat_parser as stat
81
b_finish_time = stat("MMS_B.stat")["ElapsedTime"]["value"][-1]
83
<variable name="c_finish_time" language="python">
84
from fluidity_tools import stat_parser as stat
85
c_finish_time = stat("MMS_C.stat")["ElapsedTime"]["value"][-1]
87
<variable name="d_finish_time" language="python">
88
from fluidity_tools import stat_parser as stat
89
d_finish_time = stat("MMS_D.stat")["ElapsedTime"]["value"][-1]
93
<test name="velocity convergence order > 2.8" language="python">
94
assert(convergence[0] > 2.8)
96
<test name="k production term convergence order > 1.9" language="python">
97
assert(convergence[1] > 1.9)
99
<test name="k destruction convergence order > 2.8" language="python">
100
assert(convergence[2] > 2.8)
102
<test name="k buoyancy term convergence order > 1.9" language="python">
103
assert(convergence[3] > 1.9)
105
<test name="k convergence order > 2.8" language="python">
106
assert(convergence[4] > 2.8)
108
<test name="epsilon production term convergence order > 1.9" language="python">
109
assert(convergence[5] > 1.9)
111
<test name="epsilon destruction convergence order > 2.8" language="python">
112
assert(convergence[6] > 2.8)
114
<test name="epsilon buoyancy term convergence order > 1.9" language="python">
115
assert(convergence[7] > 1.9)
117
<test name="epsilon convergence order > 2.8" language="python">
118
assert(convergence[8] > 2.8)
120
<test name="scalar eddy viscosity convergence order > 2.8" language="python">
121
assert(convergence[9] > 2.8)
123
<test name="buoyant scalar field convergence order > 2.8" language="python">
124
assert(convergence[10] > 2.8)
126
<test name="pressure convergence order > 1.6" language="python">
127
assert(convergence[11] > 1.6)
129
<test name="checking A finished in less than 100 seconds" language="python">
130
assert(a_finish_time-100.0 < 1.E-10)
132
<test name="checking B finished in less than 100 seconds" language="python">
133
assert(b_finish_time-100.0 < 1.E-10)
135
<test name="checking C finished in less than 100 seconds" language="python">
136
assert(c_finish_time-100.0 < 1.E-10)
138
<test name="checking D finished in less than 100 seconds" language="python">
139
assert(d_finish_time-100.0 < 1.E-10)