[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203

Sebastien Delaux s.delaux at niwa.co.nz
Fri May 15 02:56:26 UTC 2009


The following commit has been merged in the upstream branch:
commit 34bb0c2c6ce5359545f3b8442e3bbae11dc4c305
Author: Sebastien Delaux <s.delaux at niwa.co.nz>
Date:   Sat May 2 22:21:46 2009 +1000

    Translating hexagon test case
    
    darcs-hash:20090502122146-118cf-73743c6f2cb1059eafb68867cd19bc9afa760b67.gz

diff --git a/test/Makefile.am b/test/Makefile.am
index 0b9d2a8..2f68c9c 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -19,6 +19,7 @@ TESTDIRS = \
 	boundaries \
 	channel \
 	plate \
+	hexagon \
 	spurious \
 	capwave \
 	oscillation \
diff --git a/test/hexagon/hexagon.gfs b/test/hexagon/hexagon.gfs
new file mode 100644
index 0000000..59021f6
--- /dev/null
+++ b/test/hexagon/hexagon.gfs
@@ -0,0 +1,76 @@
+# Title: Translation of an hexagon in a uniform flow
+#
+# Description: An hexagonal solid objects translates uniformly in a
+# fluid moving at the same speed.
+#
+# Only the advection scheme is ON (no diffusion)
+#
+# The second_order scheme should compute the solid flux exactly and
+# generate very small errors which is not the case for the first order
+# scheme.
+#
+# Scheme conservative properties can be checked by filling the
+# simulation domain with tracer and computing the total amount at each
+# time step.
+# 
+# \begin{figure}[htbp]
+# \caption{\label{errorvelocitytime} In blue are the regions where the
+# error on the velocity field at the end of the test is less than
+# 0.001 and in red where it is larger. The domain should be all blue
+# for the second order method.}
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{end-2.eps}
+# \end{center}
+# \end{figure}
+#
+# \begin{figure}[htbp]
+# \caption{\label{ordertime} Evolution of the global error on the
+# velocity field in norm2 with time.}
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{error.eps}
+# \end{center}
+# \end{figure}
+#
+# Author: S\'ebastien Delaux
+# Command: sh hexagon.sh hexagon.gfs
+# Version: 090502
+# Required files: hexagon.sh hexagon.gts hexagon.gfv
+# Generated files: error.eps end-2.eps
+#
+2 1 GfsMovingSimulation GfsBox GfsGEdge {} {
+  Time { end = .1875 }
+  Refine 7
+
+  SolidMoving { istep = 1 } hexagon.gts { scale = 0.250001 } { vx = 1. level = 7 }
+  AdvectionParams { moving_order = ORDER }
+  
+  ProjectionParams { tolerance = 1e-10 }
+  ApproxProjectionParams { tolerance = 1e-10 }
+
+  AdaptVorticity { istep = 1 } { minlevel = 4 maxlevel = 7 cmax = 1e-2 }
+
+  VariableTracer T
+ 
+  SurfaceBc U Dirichlet 1.
+  SurfaceBc V Dirichlet 0.
+
+  Init {} { U = 1 T = 1 }
+
+  OutputErrorNorm { istep = 1 } {
+      awk '{ printf ("%e %e %e %e\n", $3, $5, $7, $9) }' > momentumerror-ORDER
+  } { v = sqrt((U - 1.)*(U - 1.) + V*V) } { s = 0. }
+
+  OutputScalarSum { istep = 1 } {
+      awk '{ printf ("%e %e\n", $3, $5 - 1.953125) }' > tracersum-ORDER
+  } { v = T }
+  OutputSimulation { start = end } end-ORDER.gfs
+  
+}
+GfsBox {
+    left = Boundary {
+	BcDirichlet U 1
+	BcDirichlet T 1
+    }
+}
+GfsBox { right = BoundaryOutflow }
+1 2 right
diff --git a/doc/examples/garden/mesh.gfv b/test/hexagon/hexagon.gfv
similarity index 64%
copy from doc/examples/garden/mesh.gfv
copy to test/hexagon/hexagon.gfv
index 83b64cb..fa93e23 100644
--- a/doc/examples/garden/mesh.gfv
+++ b/test/hexagon/hexagon.gfv
@@ -1,36 +1,38 @@
 # GfsView 2D
 View {
-  tx = 0 ty = 0
+  tx = -0.180022 ty = -0.0101632
   sx = 1 sy = 1 sz = 1
   q0 = 0 q1 = 0 q2 = 0 q3 = 1
-  fov = 24.9119
+  fov = 6.36061
   r = 0.3 g = 0.4 b = 0.6
   res = 1
   lc = 0.001
   reactivity = 0.1
 }
-Isoline {
+Squares {
   r = 0 g = 0 b = 0
   shading = Constant
   maxlevel = -1
 } {
   n.x = 0 n.y = 0 n.z = 1
   pos = 0
-} Hs {
-  amin = 1
-  amax = 1
+} fabs(U-1)*100 > 0.001 ? 1:0 {
+  amin = 0 min = 0
+  amax = 0 max = 1
   cmap = Jet
-} 0 {
-  reversed = 0
-  use_scalar = 1
-} {
-  n = 7
 }
-Cells {
+Vectors {
   r = 0 g = 0 b = 0
   shading = Constant
   maxlevel = -1
 } {
   n.x = 0 n.y = 0 n.z = 1
   pos = 0
+} P {
+  amin = 1
+  amax = 1
+  cmap = Jet
+} U V {
+  scale = 0.0078125
+  use_scalar = 0
 }
diff --git a/test/hexagon/hexagon.gts b/test/hexagon/hexagon.gts
new file mode 100644
index 0000000..b4fdd9b
--- /dev/null
+++ b/test/hexagon/hexagon.gts
@@ -0,0 +1,387 @@
+66 192 128 GtsSurface GtsFace GtsEdge GtsVertex
+0.25 -0.5 0.6
+0.25 -0.5 0.8
+-0.25 -0.5 0.8
+-0.5 0 0.6
+-0.25 -0.5 0.6
+-0.5 0 0.8
+-0.25 0.5 -1
+-0.25 0.5 -0.8
+0.25 0.5 -0.8
+-0.25 0.5 0.8
+-0.25 0.5 1
+0.5 0 -0.8
+0.5 0 -0.6
+0.5 0 -0.4
+0.25 0.5 -0.4
+0.5 0 -0.2
+-0.5 0 -1
+0.5 0 -1
+0.25 0.5 -1
+0.25 0.5 0.4
+0.25 0.5 0.6
+0.5 0 0.6
+-0.5 0 -0.6
+-0.5 0 -0.4
+-0.25 0.5 -0.4
+-0.25 0.5 0.6
+0.25 0.5 0.8
+0.5 0 0.2
+0.5 0 0.4
+0.25 -0.5 0.4
+-0.25 -0.5 0.2
+0.25 -0.5 0.2
+-0.25 -0.5 0.4
+0.25 0.5 -5.551115123e-17
+-0.25 0.5 -5.551115123e-17
+0.25 0.5 0.2
+0.25 -0.5 -1
+0.25 -0.5 -0.8
+-0.25 -0.5 -0.8
+0.25 -0.5 -0.2
+0.25 0.5 -0.6
+0.25 0.5 -0.2
+0.5 0 -5.551115123e-17
+0.25 -0.5 1
+-0.25 -0.5 1
+-0.25 -0.5 -0.4
+0.25 -0.5 -0.4
+-0.25 -0.5 -0.2
+0.25 -0.5 -5.551115123e-17
+-0.25 -0.5 -5.551115123e-17
+-0.5 0 1
+-0.25 -0.5 -1
+0.25 -0.5 -0.6
+-0.25 0.5 0.2
+-0.25 0.5 -0.2
+-0.5 0 0.2
+-0.5 0 0.4
+0.25 0.5 1
+-0.5 0 -0.8
+-0.5 0 -0.2
+-0.5 0 -5.551115123e-17
+0.5 0 1
+-0.25 0.5 0.4
+-0.25 -0.5 -0.6
+0.5 0 0.8
+-0.25 0.5 -0.6
+1 2
+1 3
+3 2
+4 5
+4 6
+5 6
+7 8
+7 9
+9 8
+10 6
+10 11
+6 11
+12 9
+12 13
+9 13
+14 15
+14 16
+15 16
+17 18
+18 19
+17 19
+20 21
+20 22
+22 21
+4 10
+23 24
+23 25
+25 24
+18 12
+19 12
+21 26
+21 27
+26 27
+28 29
+28 30
+30 29
+31 32
+31 33
+32 33
+34 35
+34 36
+35 36
+37 38
+37 39
+39 38
+33 30
+33 5
+30 5
+14 40
+40 16
+13 41
+13 14
+41 14
+42 34
+42 43
+43 34
+2 44
+2 45
+45 44
+46 47
+46 48
+47 48
+43 28
+43 32
+32 28
+7 17
+19 7
+40 49
+16 49
+50 49
+50 31
+49 31
+5 3
+6 3
+6 51
+11 51
+9 41
+15 42
+16 42
+17 52
+52 18
+53 13
+53 47
+13 47
+38 12
+38 53
+12 53
+19 9
+41 15
+36 54
+36 20
+54 20
+26 10
+27 10
+37 18
+18 38
+25 55
+24 55
+32 30
+30 1
+5 1
+56 31
+56 57
+31 57
+3 45
+3 51
+51 45
+57 33
+57 4
+33 4
+47 40
+48 40
+27 58
+10 58
+16 43
+49 43
+17 59
+52 59
+24 46
+24 60
+46 60
+49 32
+48 50
+40 50
+61 50
+61 56
+50 56
+51 62
+45 62
+54 56
+54 63
+56 63
+20 63
+63 21
+64 53
+64 46
+53 46
+62 58
+51 58
+39 64
+38 64
+60 48
+60 61
+48 61
+22 65
+21 65
+55 60
+59 39
+59 23
+39 23
+65 27
+65 62
+27 62
+34 28
+42 55
+55 34
+58 11
+52 39
+47 14
+63 57
+63 26
+57 26
+1 22
+22 2
+8 41
+35 61
+35 54
+61 54
+23 64
+64 24
+55 35
+60 35
+41 66
+66 15
+28 36
+36 29
+29 1
+8 59
+8 66
+59 66
+17 8
+15 25
+25 42
+2 65
+65 44
+26 4
+52 37
+29 20
+29 22
+66 23
+66 25
+44 62
+1 2 3
+4 5 6
+7 8 9
+10 11 12
+13 14 15
+16 17 18
+19 20 21
+22 23 24
+5 25 10
+26 27 28
+20 29 30
+31 32 33
+34 35 36
+37 38 39
+40 41 42
+43 44 45
+46 47 48
+17 49 50
+51 52 53
+54 55 56
+57 58 59
+60 61 62
+63 64 65
+66 21 67
+50 68 69
+70 71 72
+73 6 74
+75 12 76
+77 15 51
+78 18 79
+19 80 81
+82 83 84
+85 86 87
+88 30 13
+89 53 16
+90 91 92
+93 33 94
+95 43 96
+28 97 98
+99 39 46
+100 48 101
+102 103 104
+105 106 107
+108 109 110
+111 62 112
+94 113 114
+115 69 116
+80 117 118
+119 120 121
+122 72 37
+112 123 124
+125 126 127
+107 128 129
+130 131 132
+14 87 82
+133 22 134
+135 136 137
+138 128 139
+45 140 141
+142 143 144
+131 92 133
+29 96 85
+24 145 146
+120 98 147
+148 149 150
+151 152 153
+38 104 108
+56 63 154
+155 54 156
+47 110 4
+11 114 157
+158 118 148
+52 84 159
+160 161 162
+163 1 164
+61 121 142
+68 124 70
+71 127 102
+139 76 157
+9 77 165
+166 167 168
+161 134 31
+83 137 60
+86 141 135
+169 26 170
+123 144 125
+67 88 8
+147 171 172
+173 89 174
+167 42 90
+175 34 176
+32 146 151
+36 100 177
+113 153 138
+178 179 180
+41 154 175
+171 156 40
+66 7 181
+182 78 183
+103 132 160
+184 57 185
+109 162 186
+145 164 184
+101 73 2
+179 165 173
+126 168 130
+81 187 95
+188 189 23
+136 170 119
+140 150 169
+186 93 25
+190 191 27
+143 172 166
+191 174 182
+91 176 188
+189 177 163
+65 99 35
+149 180 190
+187 158 44
+74 75 106
+3 105 58
+117 181 178
+97 183 155
+152 185 192
+159 111 49
+79 115 55
+116 122 64
+59 129 192
diff --git a/test/hexagon/hexagon.sh b/test/hexagon/hexagon.sh
new file mode 100644
index 0000000..0422871
--- /dev/null
+++ b/test/hexagon/hexagon.sh
@@ -0,0 +1,41 @@
+if ! $donotrun; then
+    for order in 1 2 ; do
+	if gerris2D -DORDER=$order hexagon.gfs; then :
+	else
+	    exit 1
+	fi
+    done
+
+fi
+
+if cat <<EOF | gnuplot ; then :
+    set term postscript eps color lw 3 solid 20
+    set output 'error.eps'
+    set xlabel 'Time'
+    set ylabel 'Norm2 of error on the velocity field'
+    set yr [1e-10:0.1]
+    set log y
+    plot 'momentumerror-1' t 'first order' w lp, \
+         'momentumerror-2' t 'second order' w lp
+EOF
+else
+    exit 1
+fi
+
+if echo "Save end-2.eps { format = EPS }" | gfsview-batch2D end-2.gfs hexagon.gfv; then :
+else
+    exit 1
+fi
+
+if cat <<EOF | python ; then :
+from check import *
+from sys import *
+if Curve('tracersum-1',1,2).normi() > 1e-6 or \
+   Curve('tracersum-2',1,2).normi() > 3e-6 or \
+   Curve('momentumerror-1',1,3).max() > 11e-3 or \
+   Curve('momentumerror-2',1,3).max() > 2e-3:
+    exit(1)
+EOF
+else
+    exit 1
+fi
diff --git a/test/template.tex b/test/template.tex
index 65f91f1..2d68fb6 100644
--- a/test/template.tex
+++ b/test/template.tex
@@ -81,6 +81,10 @@ branch only.
 \input{channel/channel.tex}
 \input{plate/plate.tex}
 
+\section{Moving solid boundaries}
+
+\input{hexagon/hexagon.tex}
+
 \section{Surface tension}
 
 \input{spurious/spurious.tex}

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list