~iceshelfcavity/fluidity/basalmelt

« back to all changes in this revision

Viewing changes to tests/mms_ns_p0p1cv_weak_velBC_steady/mms_ns_p0p1cv_weak_velBC_steady.xml

  • Committer: Satoshi Kimura
  • Date: 2011-12-09 10:06:42 UTC
  • mfrom: (3564.21.132 fluidity)
  • Revision ID: skimura04@gmail.com-20111209100642-s28wu1yzbhb0pfc0
Merge the trunk to be updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8" ?>
 
2
<testproblem>
 
3
  <name>p0p1cv with weak velBC navier stokes spatial convergence test using a rotated domain such as to have non cartesian aligned BC</name>
 
4
  <owner userid="btollit"/>
 
5
  <tags>flml</tags>
 
6
  <problem_definition length="short" nprocs="1">
 
7
    <command_line>
 
8
fluidity -v1 -l MMS_A.flml
 
9
fluidity -v1 -l MMS_B.flml
 
10
fluidity -v1 -l MMS_C.flml
 
11
    </command_line>
 
12
  </problem_definition>
 
13
  <variables>
 
14
    <variable name="ab_convergence_vel" language="python">
 
15
from fluidity_tools import stat_parser as stat
 
16
from math import log
 
17
 
 
18
a_error_x = stat("MMS_A.stat")["NS"]["VectorAbsoluteDifference%1"]["l2norm"][-1]
 
19
b_error_x = stat("MMS_B.stat")["NS"]["VectorAbsoluteDifference%1"]["l2norm"][-1]
 
20
a_error_y = stat("MMS_A.stat")["NS"]["VectorAbsoluteDifference%2"]["l2norm"][-1]
 
21
b_error_y = stat("MMS_B.stat")["NS"]["VectorAbsoluteDifference%2"]["l2norm"][-1]
 
22
 
 
23
a_error_inf_x = stat("MMS_A.stat")["NS"]["VectorAbsoluteDifference%1"]["max"][-1]
 
24
b_error_inf_x = stat("MMS_B.stat")["NS"]["VectorAbsoluteDifference%1"]["max"][-1]
 
25
a_error_inf_y = stat("MMS_A.stat")["NS"]["VectorAbsoluteDifference%2"]["max"][-1]
 
26
b_error_inf_y = stat("MMS_B.stat")["NS"]["VectorAbsoluteDifference%2"]["max"][-1]
 
27
 
 
28
print a_error_x
 
29
print b_error_x
 
30
print a_error_y
 
31
print b_error_y
 
32
 
 
33
print a_error_inf_x
 
34
print b_error_inf_x
 
35
print a_error_inf_y
 
36
print b_error_inf_y
 
37
 
 
38
ab_ratio_x = a_error_x / b_error_x
 
39
ab_ratio_y = a_error_y / b_error_y
 
40
ab_ratio_inf_x = a_error_inf_x / b_error_inf_x
 
41
ab_ratio_inf_y = a_error_inf_y / b_error_inf_y
 
42
ab_convergence_vel = [[log(ab_ratio_x, 2), log(ab_ratio_inf_x, 2)], [log(ab_ratio_y, 2), log(ab_ratio_inf_y, 2)]]
 
43
    </variable>
 
44
    <variable name="ab_convergence_p" language="python">
 
45
from fluidity_tools import stat_parser as stat
 
46
from math import log
 
47
 
 
48
a_error = stat("MMS_A.stat")["NS"]["ScalarAbsoluteDifference"]["l2norm"][-1]
 
49
b_error = stat("MMS_B.stat")["NS"]["ScalarAbsoluteDifference"]["l2norm"][-1]
 
50
 
 
51
a_error_inf = stat("MMS_A.stat")["NS"]["ScalarAbsoluteDifference"]["max"][-1]
 
52
b_error_inf = stat("MMS_B.stat")["NS"]["ScalarAbsoluteDifference"]["max"][-1]
 
53
 
 
54
print a_error
 
55
print b_error
 
56
 
 
57
print a_error_inf
 
58
print b_error_inf
 
59
 
 
60
ab_ratio = a_error / b_error
 
61
ab_ratio_inf = a_error_inf / b_error_inf
 
62
ab_convergence_p = [log(ab_ratio, 2), log(ab_ratio_inf, 2)]
 
63
    </variable>
 
64
    <variable name="bc_convergence_vel" language="python">
 
65
from fluidity_tools import stat_parser as stat
 
66
from math import log
 
67
 
 
68
b_error_x = stat("MMS_B.stat")["NS"]["VectorAbsoluteDifference%1"]["l2norm"][-1]
 
69
c_error_x = stat("MMS_C.stat")["NS"]["VectorAbsoluteDifference%1"]["l2norm"][-1]
 
70
b_error_y = stat("MMS_B.stat")["NS"]["VectorAbsoluteDifference%2"]["l2norm"][-1]
 
71
c_error_y = stat("MMS_C.stat")["NS"]["VectorAbsoluteDifference%2"]["l2norm"][-1]
 
72
 
 
73
b_error_inf_x = stat("MMS_B.stat")["NS"]["VectorAbsoluteDifference%1"]["max"][-1]
 
74
c_error_inf_x = stat("MMS_C.stat")["NS"]["VectorAbsoluteDifference%1"]["max"][-1]
 
75
b_error_inf_y = stat("MMS_B.stat")["NS"]["VectorAbsoluteDifference%2"]["max"][-1]
 
76
c_error_inf_y = stat("MMS_C.stat")["NS"]["VectorAbsoluteDifference%2"]["max"][-1]
 
77
 
 
78
print b_error_x
 
79
print c_error_x
 
80
print b_error_y
 
81
print c_error_y
 
82
 
 
83
print b_error_inf_x
 
84
print c_error_inf_x
 
85
print b_error_inf_y
 
86
print c_error_inf_y
 
87
 
 
88
bc_ratio_x = b_error_x / c_error_x
 
89
bc_ratio_y = b_error_y / c_error_y
 
90
bc_ratio_inf_x = b_error_inf_x / c_error_inf_x
 
91
bc_ratio_inf_y = b_error_inf_y / c_error_inf_y
 
92
bc_convergence_vel = [[log(bc_ratio_x, 2), log(bc_ratio_inf_x, 2)], [log(bc_ratio_y, 2), log(bc_ratio_inf_y, 2)]]
 
93
    </variable>
 
94
    <variable name="bc_convergence_p" language="python">
 
95
from fluidity_tools import stat_parser as stat
 
96
from math import log
 
97
 
 
98
b_error = stat("MMS_B.stat")["NS"]["ScalarAbsoluteDifference"]["l2norm"][-1]
 
99
c_error = stat("MMS_C.stat")["NS"]["ScalarAbsoluteDifference"]["l2norm"][-1]
 
100
 
 
101
b_error_inf = stat("MMS_B.stat")["NS"]["ScalarAbsoluteDifference"]["max"][-1]
 
102
c_error_inf = stat("MMS_C.stat")["NS"]["ScalarAbsoluteDifference"]["max"][-1]
 
103
 
 
104
print b_error
 
105
print c_error
 
106
 
 
107
print b_error_inf
 
108
print c_error_inf
 
109
 
 
110
bc_ratio = b_error / c_error
 
111
bc_ratio_inf = b_error_inf / c_error_inf
 
112
bc_convergence_p = [log(bc_ratio, 2), log(bc_ratio_inf, 2)]
 
113
    </variable>
 
114
   <variable name="a_finish_time" language="python">
 
115
from fluidity_tools import stat_parser as stat
 
116
a_finish_time = stat("MMS_A.stat")["ElapsedTime"]["value"][-1]
 
117
    </variable>
 
118
    <variable name="b_finish_time" language="python">
 
119
from fluidity_tools import stat_parser as stat
 
120
b_finish_time = stat("MMS_B.stat")["ElapsedTime"]["value"][-1]
 
121
    </variable>
 
122
    <variable name="c_finish_time" language="python">
 
123
from fluidity_tools import stat_parser as stat
 
124
c_finish_time = stat("MMS_C.stat")["ElapsedTime"]["value"][-1]
 
125
    </variable>
 
126
   <variable name="a_div" language="python">
 
127
from fluidity_tools import stat_parser as stat
 
128
a_div = max(abs(stat("MMS_A.stat")["NS"]["ControlVolumeDivergence"]["max"][-1]), abs(stat("MMS_A.stat")["NS"]["ControlVolumeDivergence"]["min"][-1]))
 
129
    </variable>
 
130
    <variable name="b_div" language="python">
 
131
from fluidity_tools import stat_parser as stat
 
132
b_div = max(abs(stat("MMS_B.stat")["NS"]["ControlVolumeDivergence"]["max"][-1]), abs(stat("MMS_A.stat")["NS"]["ControlVolumeDivergence"]["min"][-1]))
 
133
    </variable>
 
134
    <variable name="c_div" language="python">
 
135
from fluidity_tools import stat_parser as stat
 
136
c_div = max(abs(stat("MMS_C.stat")["NS"]["ControlVolumeDivergence"]["max"][-1]), abs(stat("MMS_A.stat")["NS"]["ControlVolumeDivergence"]["min"][-1]))
 
137
    </variable>
 
138
    <variable name="a_final_change_vel" language="python">
 
139
import vtktools
 
140
from fluidity_tools import stat_parser as stat
 
141
vtu = vtktools.vtu("MMS_A_1.vtu")
 
142
dt = stat("MMS_A.stat")["dt"]["value"][-1]
 
143
a_final_change_vel = max(max(abs(vtu.GetVectorField("Velocity")[:,0]-vtu.GetVectorField("OldVelocity")[:,0])/dt), max(abs(vtu.GetVectorField("Velocity")[:,1]-vtu.GetVectorField("OldVelocity")[:,1])/dt))
 
144
    </variable>
 
145
    <variable name="b_final_change_vel" language="python">
 
146
import vtktools
 
147
from fluidity_tools import stat_parser as stat
 
148
vtu = vtktools.vtu("MMS_B_1.vtu")
 
149
dt = stat("MMS_B.stat")["dt"]["value"][-1]
 
150
b_final_change_vel = max(max(abs(vtu.GetVectorField("Velocity")[:,0]-vtu.GetVectorField("OldVelocity")[:,0])/dt), max(abs(vtu.GetVectorField("Velocity")[:,1]-vtu.GetVectorField("OldVelocity")[:,1])/dt))
 
151
    </variable>
 
152
    <variable name="c_final_change_vel" language="python">
 
153
import vtktools
 
154
from fluidity_tools import stat_parser as stat
 
155
vtu = vtktools.vtu("MMS_C_1.vtu")
 
156
dt = stat("MMS_C.stat")["dt"]["value"][-1]
 
157
c_final_change_vel = max(max(abs(vtu.GetVectorField("Velocity")[:,0]-vtu.GetVectorField("OldVelocity")[:,0])/dt), max(abs(vtu.GetVectorField("Velocity")[:,1]-vtu.GetVectorField("OldVelocity")[:,1])/dt))
 
158
    </variable>
 
159
    <variable name="a_final_change_p" language="python">
 
160
import vtktools
 
161
from fluidity_tools import stat_parser as stat
 
162
vtu = vtktools.vtu("MMS_A_1.vtu")
 
163
dt = stat("MMS_A.stat")["dt"]["value"][-1]
 
164
a_final_change_p = max(abs(vtu.GetScalarField("Pressure")-vtu.GetScalarField("OldPressure"))/dt)
 
165
    </variable>
 
166
    <variable name="b_final_change_p" language="python">
 
167
import vtktools
 
168
from fluidity_tools import stat_parser as stat
 
169
vtu = vtktools.vtu("MMS_B_1.vtu")
 
170
dt = stat("MMS_B.stat")["dt"]["value"][-1]
 
171
b_final_change_p = max(abs(vtu.GetScalarField("Pressure")-vtu.GetScalarField("OldPressure"))/dt)
 
172
    </variable>
 
173
    <variable name="c_final_change_p" language="python">
 
174
import vtktools
 
175
from fluidity_tools import stat_parser as stat
 
176
vtu = vtktools.vtu("MMS_C_1.vtu")
 
177
dt = stat("MMS_C.stat")["dt"]["value"][-1]
 
178
c_final_change_p = max(abs(vtu.GetScalarField("Pressure")-vtu.GetScalarField("OldPressure"))/dt)
 
179
    </variable>
 
180
  </variables>
 
181
  <pass_tests>
 
182
    <test name="ab_convergence_vel_x: L2 order between 1.6 and 2.0" language="python">
 
183
assert(abs(ab_convergence_vel[0][0]-1.8) &lt; 0.2)
 
184
    </test>
 
185
    <test name="ab_convergence_vel_y: L2 order between 1.6 and 2.0" language="python">
 
186
assert(abs(ab_convergence_vel[1][0]-1.8) &lt; 0.2)
 
187
    </test>
 
188
    <test name="ab_convergence_p: L2 order between 2.0 and 2.2" language="python">
 
189
assert(abs(ab_convergence_p[0]-2.1) &lt; 0.11)
 
190
    </test>
 
191
    <test name="bc_convergence_vel_x: L2 order between 0.8 and 1.0" language="python">
 
192
assert(abs(bc_convergence_vel[0][0]-0.9) &lt; 0.1)
 
193
    </test>
 
194
    <test name="bc_convergence_vel_y: L2 order between 0.8 and 1.0" language="python">
 
195
assert(abs(bc_convergence_vel[1][0]-0.9) &lt; 0.1)
 
196
    </test>
 
197
    <test name="bc_convergence_p: L2 order between 0.8 and 1.0" language="python">
 
198
assert(abs(bc_convergence_p[0]-0.9) &lt; 0.1)
 
199
    </test>
 
200
    <test name="checking divergence in A vel with tolerance 1.0e-08" language="python">
 
201
assert(a_div &lt; 1.E-8)
 
202
    </test>
 
203
    <test name="checking divergence in B vel with tolerance 1.0e-08" language="python">
 
204
assert(b_div &lt; 1.E-8)
 
205
    </test>
 
206
    <test name="checking divergence in C vel with tolerance 1.0e-08" language="python">
 
207
assert(c_div &lt; 1.E-8)
 
208
    </test>
 
209
    <test name="checking A finished in less than 50.0" language="python">
 
210
assert(a_finish_time-50.0 &lt; 1.E-10)
 
211
    </test>
 
212
    <test name="checking B finished in less than 50.0" language="python">
 
213
assert(b_finish_time-50.0 &lt; 1.E-10)
 
214
    </test>
 
215
    <test name="checking C finished in less than 50.0" language="python">
 
216
assert(c_finish_time-50.0 &lt; 1.E-10)
 
217
    </test>
 
218
    <test name="checking steady state was reached in A vel with tolerance 1.0e-05" language="python">
 
219
assert(a_final_change_vel &lt; 1.0e-05)
 
220
    </test>
 
221
    <test name="checking steady state was reached in B vel with tolerance 1.0e-05" language="python">
 
222
assert(b_final_change_vel &lt; 1.0e-05)
 
223
    </test>
 
224
    <test name="checking steady state was reached in C vel with tolerance 1.0e-05" language="python">
 
225
assert(c_final_change_vel &lt; 1.0e-05)
 
226
    </test>
 
227
    <test name="checking steady state was reached in A p with tolerance 1.0e-05" language="python">
 
228
assert(a_final_change_p &lt; 1.0e-05)
 
229
    </test>
 
230
    <test name="checking steady state was reached in B p with tolerance 1.0e-05" language="python">
 
231
assert(b_final_change_p &lt; 1.0e-05)
 
232
    </test>
 
233
    <test name="checking steady state was reached in C p with tolerance 1.0e-05" language="python">
 
234
assert(c_final_change_p &lt; 1.0e-05)
 
235
    </test>
 
236
  </pass_tests>
 
237
  <warn_tests>
 
238
  </warn_tests>
 
239
</testproblem>
 
240