[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:55:34 UTC 2009
The following commit has been merged in the upstream branch:
commit 1de311a5cf64c22cf5803ad6611ba87f084c72b5
Author: Stephane Popinet <popinet at users.sf.net>
Date: Fri Jul 18 10:38:12 2008 +1000
Axisymmetric potential flow around a sphere test case
darcs-hash:20080718003812-d4795-7eaa1dd4129d90466b60cf4662911e2732002167.gz
diff --git a/test/Makefile.am b/test/Makefile.am
index 7be01ca..232b650 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -9,6 +9,7 @@ TESTDIRS = \
reynolds \
periodic \
merging \
+ axi \
lid \
poiseuille \
couette \
diff --git a/test/axi/axi.gfs b/test/axi/axi.gfs
new file mode 100644
index 0000000..902eacf
--- /dev/null
+++ b/test/axi/axi.gfs
@@ -0,0 +1,68 @@
+# Title: Potential flow around a sphere
+#
+# Description:
+#
+# The axisymmetric potential flow around a sphere is computed (Figure
+# \ref{isolines}) and compared to the theoretical solution
+# \cite{lamb}. A large domain is used together with variable spatial
+# resolution to minimise the influence of the finite domain size.
+#
+# Figure \ref{error} and \ref{order} illustrate the convergence of the
+# solution for the horizontal component of velocity with increased
+# resolution.
+#
+# \begin{figure}[htbp]
+# \caption{\label{isolines}Isolines of the velocity components ($x$ in red, $y$ in blue).}
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{isolines.eps}
+# \end{center}
+# \end{figure}
+#
+# \begin{figure}[htbp]
+# \caption{\label{error}Evolution of the error as a function of resolution.}
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{error.eps}
+# \end{center}
+# \end{figure}
+#
+# \begin{figure}[htbp]
+# \caption{\label{order}Corresponding convergence order.}
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{order.eps}
+# \end{center}
+# \end{figure}
+#
+# Author: St\'ephane Popinet
+# Command: sh axi.sh axi.gfs
+# Version: 1.3.0
+# Required files: axi.sh error.ref order.ref isolines.gfv
+# Generated files: error.eps order.eps isolines.eps
+#
+1 0 GfsAxi GfsBox GfsGEdge {} {
+ Time { iend = 0 end = 1 }
+ AdvectionParams { scheme = none }
+ ApproxProjectionParams { tolerance = 1e-10 }
+ Refine 4
+ Refine (LEVEL + 50.*(x*x + y*y)*(4. - LEVEL))
+ Global {
+ #define A0 0.01
+ #define U0 1.
+ }
+ Solid (ellipse (0., 0., A0, A0))
+ Init {} {
+ U = U0
+ Phi = {
+ double r = sqrt (cx*cx + cy*cy);
+ double theta = atan2 (cy, cx);
+ return U0*A0*A0*A0*cos(theta)/(2.*r*r);
+ }
+ }
+ OutputErrorNorm { start = end } { awk '{ print LEVEL " " $7 " " $9}' } { v = U } {
+ s = (dx("Phi") + 1.)
+ }
+ OutputSimulation { start = end } sim-LEVEL.gfs
+}
+GfsBox {
+ left = Boundary { BcDirichlet U U0 }
+ right = Boundary { BcDirichlet U U0 }
+}
diff --git a/test/axi/axi.sh b/test/axi/axi.sh
new file mode 100644
index 0000000..11be029
--- /dev/null
+++ b/test/axi/axi.sh
@@ -0,0 +1,66 @@
+if ! $donotrun; then
+ rm -f error
+ for level in 10 11 12 13; do
+ if sed "s/LEVEL/$level/g" < $1 | \
+ gerris2D - >> error; then :
+ else
+ exit 1
+ fi
+ done
+fi
+
+if echo "Save isolines.eps { format = EPS }" | gfsview-batch2D sim-13.gfs isolines.gfv; then :
+else
+ exit 1
+fi
+
+if awk '
+BEGIN { n = 0 }
+{
+ l[n] = $1; n2[n] = $2; ni[n++] = $3;
+}
+END {
+ for (i = 1; i < n; i++)
+ print l[i] " " log(n2[i-1]/n2[i])/log(2.) " " log(ni[i-1]/ni[i])/log(2.);
+}' < error > order; then :
+else
+ exit 1
+fi
+
+if cat <<EOF | gnuplot ; then :
+ set term postscript eps color lw 3 solid 20
+ set output 'error.eps'
+ set xlabel 'Level'
+ set ylabel 'Error norms'
+ set key
+ set logscale y
+ plot 'error.ref' u 1:2 t '2 (ref)' w lp, \
+ 'error.ref' u 1:3 t 'max (ref)' w lp, \
+ 'error' u 1:2 t '2' w lp, \
+ 'error' u 1:3 t 'max' w lp
+ set output 'order.eps'
+ set xlabel 'Level'
+ set ylabel 'Order'
+ set key
+ unset logscale
+ set xtics 0,1
+ set ytics 0,1
+ set grid
+ plot [][0:2] 'order.ref' u 1:2 t '2 (ref)' w lp, \
+ 'order.ref' u 1:3 t 'max (ref)' w lp, \
+ 'order' u 1:2 t '2' w lp, \
+ 'order' u 1:3 t 'max' w lp
+EOF
+else
+ exit 1
+fi
+
+if cat <<EOF | python ; then :
+from check import *
+from sys import *
+if (Curve('error',1,3) - Curve('error.ref',1,3)).max() > 1e-5:
+ exit(1)
+EOF
+else
+ exit 1
+fi
diff --git a/test/axi/error.ref b/test/axi/error.ref
new file mode 100644
index 0000000..3ce9c93
--- /dev/null
+++ b/test/axi/error.ref
@@ -0,0 +1,4 @@
+10 1.102e-04 1.210e-01
+11 3.994e-05 5.267e-02
+12 1.418e-05 2.793e-02
+13 5.068e-06 1.466e-02
diff --git a/test/circle/thin/solution.gfv b/test/axi/isolines.gfv
similarity index 71%
copy from test/circle/thin/solution.gfv
copy to test/axi/isolines.gfv
index 9e826a1..39ef52a 100644
--- a/test/circle/thin/solution.gfv
+++ b/test/axi/isolines.gfv
@@ -1,46 +1,52 @@
# GfsView 2D
View {
- tx = -0.591968 ty = 0.496337
+ tx = 0 ty = 0
+ sx = 1 sy = 1 sz = 1
q0 = 0 q1 = 0 q2 = 0 q3 = 1
- fov = 37.9885
+ fov = 0.955076
r = 0.3 g = 0.4 b = 0.6
res = 1
lc = 0.001
reactivity = 0.1
}
-Boundaries {
- r = 0 g = 0 b = 0
- shading = Constant
- maxlevel = -1
-}
-Solid {
- r = 0 g = 0 b = 0
- shading = Constant
- maxlevel = -1
-}
Isoline {
- r = 0 g = 0 b = 0
+ r = 1 g = 0 b = 0
shading = Constant
maxlevel = -1
} {
n.x = 0 n.y = 0 n.z = 1
pos = 0
-} P {
+} U {
amin = 1
amax = 1
cmap = Jet
} {
- n = 30
+ n = 10
}
-Squares {
- r = 0 g = 0 b = 0
+Isoline {
+ r = 0 g = 0.0160678 b = 1
shading = Constant
maxlevel = -1
} {
n.x = 0 n.y = 0 n.z = 1
pos = 0
-} P {
+} V {
amin = 1
amax = 1
cmap = Jet
+} {
+ n = 10
+}
+Symmetry {
+ r = 0 g = 0 b = 0
+ shading = Constant
+ maxlevel = -1
+} {
+ n.x = 0 n.y = 1 n.z = 0
+ pos = 0
+}
+Solid {
+ r = 0 g = 0 b = 0
+ shading = Constant
+ maxlevel = -1
}
diff --git a/test/axi/order.ref b/test/axi/order.ref
new file mode 100644
index 0000000..273bbb2
--- /dev/null
+++ b/test/axi/order.ref
@@ -0,0 +1,3 @@
+11 1.46422 1.19995
+12 1.49398 0.915166
+13 1.48437 0.92993
diff --git a/test/template.tex b/test/template.tex
index 379a94d..368b33f 100644
--- a/test/template.tex
+++ b/test/template.tex
@@ -59,6 +59,9 @@ branch only.
\input{periodic/periodic.tex}
\input{merging/merging.tex}
+\section{Axisymmetric Euler}
+\input{axi/axi.tex}
+
\section{Navier-Stokes}
\input{lid/lid.tex}
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list