[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
s.popinet at niwa.co.nz
Fri May 15 02:52:03 UTC 2009
The following commit has been merged in the upstream branch:
commit 2f58212a43a8f7d4b208c5fec320abc948ee15f0
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date: Tue Jun 21 08:12:53 2005 +1000
Added 'boundaries' test case
darcs-hash:20050620221253-fbd8f-00236a6cf4b98e9141fd032dfec6531e30b0c324.gz
diff --git a/test/euler/Makefile.am b/test/euler/Makefile.am
index ca7f1e5..17737d4 100644
--- a/test/euler/Makefile.am
+++ b/test/euler/Makefile.am
@@ -3,7 +3,8 @@
TESTDIRS = \
reynolds \
periodic \
- merging
+ merging \
+ boundaries
EXTRA_DIST = \
template.tex \
diff --git a/test/euler/boundaries/boundaries.gfs b/test/euler/boundaries/boundaries.gfs
new file mode 100644
index 0000000..350f84e
--- /dev/null
+++ b/test/euler/boundaries/boundaries.gfs
@@ -0,0 +1,46 @@
+# Title: Convergence of a potential flow solution
+#
+# Description:
+#
+# A test case initially presented by Almgren et al \cite{almgren97}.
+# Three elliptical bodies are placed in the unit square. Constant
+# unity inflow and outflow are specified on the left and right
+# boundaries. Projection is then preformed to obtain a potential flow
+# solution around the bodies.
+#
+# Tables \ref{x} and \ref{y} illustrate the errors and convergence
+# orders obtained for both components of the velocity when the
+# resolution varies. Richardson extrapolation is used. The errors are
+# computed either on the whole domain (All cells) or on the cells
+# whose parents at level 7 are entirely contained in the fluid (Full
+# 128 cells).
+#
+# Close to second-order convergence is obtained in the bulk of the
+# fluid, reducing to first-order close to the boundaries. The errors
+# are small in all cases (with a maximum of 6\%) and comparable to
+# that obtained by Almgren et al using a different discretisation.
+#
+# \input{convergence.tex}
+#
+# Author: St\'ephane Popinet
+# Command: sh boundaries.sh boundaries.gfs
+# Version: 0.6.4
+# Required files: boundaries.sh orderU.ref orderfU.ref orderV.ref orderfV.ref
+# Running time: 3 minutes
+# Generated files: convergence.tex
+#
+1 0 GfsSimulation GfsBox GfsGEdge {} {
+ Time { end = 0 }
+ AdvectionParams { scheme = none }
+ ApproxProjectionParams { tolerance = 1e-6 }
+ Refine LEVEL
+ GtsSurfaceFile boundaries.gts
+ Init {} { U = 1 }
+ OutputSimulation { start = end } sim-LEVEL {
+ variables = U,V,P
+ }
+}
+GfsBox {
+ left = Boundary { BcDirichlet U 1 }
+ right = Boundary { BcDirichlet U 1 }
+}
diff --git a/test/euler/boundaries/boundaries.sh b/test/euler/boundaries/boundaries.sh
new file mode 100644
index 0000000..e17317b
--- /dev/null
+++ b/test/euler/boundaries/boundaries.sh
@@ -0,0 +1,83 @@
+if ! $donotrun; then
+ ../../poisson/shapes almgren > boundaries.gts
+ for level in 7 8 9; do
+ if sed "s/LEVEL/$level/g" < $1 | \
+ gerris2D -; then :
+ else
+ exit 1
+ fi
+ done
+fi
+
+for v in U V; do
+ rm -f order$v orderf$v
+ for level in 7 8; do
+ level1=`expr $level + 1`
+ echo -n "$level " >> order$v
+ if gfscompare2D -c -v sim-$level sim-$level1 $v 2>&1 | \
+ awk '{if ($1 == "total") print $4 " " $6 " " $8;}' >> order$v; then :
+ else
+ exit 1
+ fi
+ echo -n "$level " >> orderf$v
+ if gfscompare2D -f 7 -v sim-$level sim-$level1 $v 2>&1 | \
+ awk '{if ($1 == "total") print $4 " " $6 " " $8;}' >> orderf$v; then :
+ else
+ exit 1
+ fi
+ done
+done
+
+if cat <<EOF | python > convergence.tex; then :
+from check import *
+from sys import *
+from math import *
+
+for component,variable in [('x','U'),('y','V')]:
+ print r"""\begin{table}[htbp]
+ \begin{center}
+ \begin{tabular}{||l|c|c|c||c|c|c||} \hline
+ & \multicolumn{3}{c||}{All cells} & \multicolumn{3}{c||}{Full 128 cells} \\\ \hline
+ & 128-256 & Rate & 256-512 & 128-256 & Rate & 256-512 \\\ \hline"""
+
+ for i,name in [(2,r"\$L_1\$"),(3,r"\$L_2\$"),(4,r"\$L_\infty\$")]:
+ a=Curve('order'+variable,1,i)
+ b=Curve('orderf'+variable,1,i)
+ print name,
+ print "& %.2e & %4.2f & %.2e & %.2e & %4.2f & %.2e" % (\
+ a.l[0][1], log(a.l[0][1]/a.l[1][1])/log(2.), a.l[1][1], \
+ b.l[0][1], log(b.l[0][1]/b.l[1][1])/log(2.), b.l[1][1]),
+ print r"\\\"
+
+ a=Curve('order'+variable+'.ref',1,i)
+ b=Curve('orderf'+variable+'.ref',1,i)
+ print "& {\color{blue}%.2e} & {\color{blue}%4.2f} & {\color{blue}%.2e} & {\color{blue}%.2e} & {\color{blue}%4.2f} & {\color{blue}%.2e}" % (\
+ a.l[0][1], log(a.l[0][1]/a.l[1][1])/log(2.), a.l[1][1], \
+ b.l[0][1], log(b.l[0][1]/b.l[1][1])/log(2.), b.l[1][1]),
+ print r"\\\"
+
+ print r"\hline"
+ print r"""\end{tabular}
+ \end{center}
+ \caption{"""
+ print r"Errors and convergence rates for the \$"+component+r"\$-component of the velocity.}"
+ print r"\label{" + component + "}"
+ print r"\end{table}"
+EOF
+else
+ exit 1
+fi
+
+if cat <<EOF | python ; then :
+from check import *
+from sys import *
+
+for f in ['orderU','orderV','orderfU','orderfV']:
+ if (Curve(f,1,2) - Curve(f+'.ref',1,2)).max() > 1e-6 or\
+ (Curve(f,1,3) - Curve(f+'.ref',1,3)).max() > 1e-6 or\
+ (Curve(f,1,4) - Curve(f+'.ref',1,4)).max() > 1e-6:
+ exit(1)
+EOF
+else
+ exit 1
+fi
diff --git a/test/euler/boundaries/orderU.ref b/test/euler/boundaries/orderU.ref
new file mode 100644
index 0000000..a88bb62
--- /dev/null
+++ b/test/euler/boundaries/orderU.ref
@@ -0,0 +1,2 @@
+7 3.322e-04 1.743e-03 6.209e-02
+8 1.101e-04 8.767e-04 4.133e-02
diff --git a/test/euler/boundaries/orderV.ref b/test/euler/boundaries/orderV.ref
new file mode 100644
index 0000000..6d52efb
--- /dev/null
+++ b/test/euler/boundaries/orderV.ref
@@ -0,0 +1,2 @@
+7 3.661e-04 1.316e-03 4.369e-02
+8 1.138e-04 6.391e-04 3.437e-02
diff --git a/test/euler/boundaries/orderfU.ref b/test/euler/boundaries/orderfU.ref
new file mode 100644
index 0000000..d5ea7ff
--- /dev/null
+++ b/test/euler/boundaries/orderfU.ref
@@ -0,0 +1,2 @@
+7 2.247e-04 4.772e-04 6.828e-03
+8 6.153e-05 1.533e-04 5.224e-03
diff --git a/test/euler/boundaries/orderfV.ref b/test/euler/boundaries/orderfV.ref
new file mode 100644
index 0000000..cd7860b
--- /dev/null
+++ b/test/euler/boundaries/orderfV.ref
@@ -0,0 +1,2 @@
+7 2.961e-04 7.718e-04 8.718e-03
+8 8.136e-05 2.569e-04 3.745e-03
diff --git a/test/euler/reference2D/boundaries.tex b/test/euler/reference2D/boundaries.tex
deleted file mode 100644
index 5956fd5..0000000
--- a/test/euler/reference2D/boundaries.tex
+++ /dev/null
@@ -1,28 +0,0 @@
-% command: boundaries.sh
-% legend: Projection test of Almgren et al., 1997.
-
-\begin{table}[htbp]
-\begin{center}
-\begin{tabular}{||l|c|c|c||c|c|c||} \hline
- & \multicolumn{3}{c||}{All cells} & \multicolumn{3}{c||}{Full 128 cells} \\ \hline
- & 128-256 & Rate & 256-512 & 128-256 & Rate & 256-512 \\ \hline
-$L_1$ & 5.13e-04 & 1.60 & 1.69e-04 & 2.27e-04 & 1.87 & 6.23e-05 \\
-$L_2$ & 2.78e-03 & 1.09 & 1.31e-03 & 4.74e-04 & 1.64 & 1.52e-04 \\
-$L_\infty$ & 6.68e-02 & 0.59 & 4.44e-02 & 6.69e-03 & 0.38 & 5.13e-03 \\ \hline
-\end{tabular}
-\end{center}
-\caption{Errors and convergence rates for the $x$-component of the velocity.}
-\end{table}
-
-\begin{table}[htbp]
-\begin{center}
-\begin{tabular}{||l|c|c|c||c|c|c||} \hline
- & \multicolumn{3}{c||}{All cells} & \multicolumn{3}{c||}{Full 128 cells} \\ \hline
- & 128-256 & Rate & 256-512 & 128-256 & Rate & 256-512 \\ \hline
-$L_1$ & 4.47e-04 & 1.59 & 1.48e-04 & 2.31e-04 & 1.83 & 6.48e-05 \\
-$L_2$ & 2.18e-03 & 1.11 & 1.01e-03 & 5.51e-04 & 1.68 & 1.72e-04 \\
-$L_\infty$ & 4.87e-02 & -0.04 & 5.01e-02 & 8.69e-03 & 1.21 & 3.76e-03 \\ \hline
-\end{tabular}
-\end{center}
-\caption{Errors and convergence rates for the $y$-component of the velocity.}
-\end{table}
diff --git a/test/euler/scripts/boundaries.sh b/test/euler/scripts/boundaries.sh
deleted file mode 100755
index 7d77ab6..0000000
--- a/test/euler/scripts/boundaries.sh
+++ /dev/null
@@ -1,151 +0,0 @@
-#! /bin/sh
-
-if test -e boundaries; then
- :
-else
- mkdir boundaries
-fi
-
-PATH=$PATH:../../poisson:../../../tools:..
-cd boundaries
-/bin/sh -c "shapes almgren > boundaries.gts"
-
-cat <<EOF | gerris2D -
-1 0 GfsSimulation GfsBox GfsGEdge {} {
- Time { end = 0 }
- ApproxProjectionParams {
- tolerance = 1e-6
- }
- Refine 7
- GtsSurfaceFile boundaries.gts
- Init {} { U = 1 }
- OutputSimulation { start = end } boundaries_128.gfs {
- variables = U,V,P
- }
-}
-GfsBox { left = BoundaryInflowConstant 1 right = BoundaryOutflow }
-EOF
-
-cat <<EOF | gerris2D -
-1 0 GfsSimulation GfsBox GfsGEdge {} {
- Time { end = 0 }
- ApproxProjectionParams {
- tolerance = 1e-6
- }
- Refine 8
- GtsSurfaceFile boundaries.gts
- Init {} { U = 1 }
- OutputSimulation { start = end } boundaries_256.gfs {
- variables = U,V,P
- }
-}
-GfsBox { left = BoundaryInflowConstant 1 right = BoundaryOutflow }
-EOF
-
-cat <<EOF | gerris2D -
-1 0 GfsSimulation GfsBox GfsGEdge {} {
- Time { end = 0 }
- ApproxProjectionParams {
- tolerance = 1e-6
- }
- Refine 9
- GtsSurfaceFile boundaries.gts
- Init {} { U = 1 }
- OutputSimulation { start = end } boundaries_512.gfs {
- variables = U,V,P
- }
-}
-GfsBox { left = BoundaryInflowConstant 1 right = BoundaryOutflow }
-EOF
-
-error256=`gfscompare2D -n -v boundaries_256.gfs boundaries_512.gfs U 2>&1 | awk '{if ($1 == "total") print $0;}'`
-error128=`gfscompare2D -n -v boundaries_128.gfs boundaries_256.gfs U 2>&1 | awk '{if ($1 == "total") print $0;}'`
-error256full=`gfscompare2D -f 7 -n -v boundaries_256.gfs boundaries_512.gfs U 2>&1 | awk '{if ($1 == "total") print $0;}'`
-error128full=`gfscompare2D -f 7 -n -v boundaries_128.gfs boundaries_256.gfs U 2>&1 | awk '{if ($1 == "total") print $0;}'`
-
-cat <<EOF
-% command: boundaries.sh
-% legend: Projection test of Almgren et al., 1997.
-
-\begin{table}[htbp]
-\begin{center}
-\begin{tabular}{||l|c|c|c||c|c|c||} \hline
- & \multicolumn{3}{c||}{All cells} & \multicolumn{3}{c||}{Full 128 cells} \\\\ \hline
- & 128-256 & Rate & 256-512 & 128-256 & Rate & 256-512 \\\\ \hline
-EOF
-
-L1_128=`echo $error128 | awk '{ printf ("%.2e", $4)}'`
-L1_256=`echo $error256 | awk '{ printf ("%.2e", $4)}'`
-L1_128full=`echo $error128full | awk '{ printf ("%.2e", $4)}'`
-L1_256full=`echo $error256full | awk '{ printf ("%.2e", $4)}'`
-rate=`awk -v e1=$L1_128 -v e2=$L1_256 'BEGIN{printf ("%.2f", log(e1/e2)/log(2))}'`
-ratefull=`awk -v e1=$L1_128full -v e2=$L1_256full 'BEGIN{printf ("%.2f", log(e1/e2)/log(2))}'`
-echo "\$L_1\$ & $L1_128 & $rate & $L1_256 & $L1_128full & $ratefull & $L1_256full \\\\"
-
-L1_128=`echo $error128 | awk '{ printf ("%.2e", $6)}'`
-L1_256=`echo $error256 | awk '{ printf ("%.2e", $6)}'`
-L1_128full=`echo $error128full | awk '{ printf ("%.2e", $6)}'`
-L1_256full=`echo $error256full | awk '{ printf ("%.2e", $6)}'`
-rate=`awk -v e1=$L1_128 -v e2=$L1_256 'BEGIN{printf ("%.2f", log(e1/e2)/log(2))}'`
-ratefull=`awk -v e1=$L1_128full -v e2=$L1_256full 'BEGIN{printf ("%.2f", log(e1/e2)/log(2))}'`
-echo "\$L_2\$ & $L1_128 & $rate & $L1_256 & $L1_128full & $ratefull & $L1_256full \\\\"
-
-L1_128=`echo $error128 | awk '{ printf ("%.2e", $8)}'`
-L1_256=`echo $error256 | awk '{ printf ("%.2e", $8)}'`
-L1_128full=`echo $error128full | awk '{ printf ("%.2e", $8)}'`
-L1_256full=`echo $error256full | awk '{ printf ("%.2e", $8)}'`
-rate=`awk -v e1=$L1_128 -v e2=$L1_256 'BEGIN{printf ("%.2f", log(e1/e2)/log(2))}'`
-ratefull=`awk -v e1=$L1_128full -v e2=$L1_256full 'BEGIN{printf ("%.2f", log(e1/e2)/log(2))}'`
-echo "\$L_\infty\$ & $L1_128 & $rate & $L1_256 & $L1_128full & $ratefull & $L1_256full \\\\ \hline"
-
-cat <<EOF
-\end{tabular}
-\end{center}
-\caption{Errors and convergence rates for the \$x\$-component of the velocity.}
-\end{table}
-EOF
-
-error256=`gfscompare2D -n -v boundaries_256.gfs boundaries_512.gfs V 2>&1 | awk '{if ($1 == "total") print $0;}'`
-error128=`gfscompare2D -n -v boundaries_128.gfs boundaries_256.gfs V 2>&1 | awk '{if ($1 == "total") print $0;}'`
-error256full=`gfscompare2D -f 7 -n -v boundaries_256.gfs boundaries_512.gfs V 2>&1 | awk '{if ($1 == "total") print $0;}'`
-error128full=`gfscompare2D -f 7 -n -v boundaries_128.gfs boundaries_256.gfs V 2>&1 | awk '{if ($1 == "total") print $0;}'`
-
-cat <<EOF
-
-\begin{table}[htbp]
-\begin{center}
-\begin{tabular}{||l|c|c|c||c|c|c||} \hline
- & \multicolumn{3}{c||}{All cells} & \multicolumn{3}{c||}{Full 128 cells} \\\\ \hline
- & 128-256 & Rate & 256-512 & 128-256 & Rate & 256-512 \\\\ \hline
-EOF
-
-L1_128=`echo $error128 | awk '{ printf ("%.2e", $4)}'`
-L1_256=`echo $error256 | awk '{ printf ("%.2e", $4)}'`
-L1_128full=`echo $error128full | awk '{ printf ("%.2e", $4)}'`
-L1_256full=`echo $error256full | awk '{ printf ("%.2e", $4)}'`
-rate=`awk -v e1=$L1_128 -v e2=$L1_256 'BEGIN{printf ("%.2f", log(e1/e2)/log(2))}'`
-ratefull=`awk -v e1=$L1_128full -v e2=$L1_256full 'BEGIN{printf ("%.2f", log(e1/e2)/log(2))}'`
-echo "\$L_1\$ & $L1_128 & $rate & $L1_256 & $L1_128full & $ratefull & $L1_256full \\\\"
-
-L1_128=`echo $error128 | awk '{ printf ("%.2e", $6)}'`
-L1_256=`echo $error256 | awk '{ printf ("%.2e", $6)}'`
-L1_128full=`echo $error128full | awk '{ printf ("%.2e", $6)}'`
-L1_256full=`echo $error256full | awk '{ printf ("%.2e", $6)}'`
-rate=`awk -v e1=$L1_128 -v e2=$L1_256 'BEGIN{printf ("%.2f", log(e1/e2)/log(2))}'`
-ratefull=`awk -v e1=$L1_128full -v e2=$L1_256full 'BEGIN{printf ("%.2f", log(e1/e2)/log(2))}'`
-echo "\$L_2\$ & $L1_128 & $rate & $L1_256 & $L1_128full & $ratefull & $L1_256full \\\\"
-
-L1_128=`echo $error128 | awk '{ printf ("%.2e", $8)}'`
-L1_256=`echo $error256 | awk '{ printf ("%.2e", $8)}'`
-L1_128full=`echo $error128full | awk '{ printf ("%.2e", $8)}'`
-L1_256full=`echo $error256full | awk '{ printf ("%.2e", $8)}'`
-rate=`awk -v e1=$L1_128 -v e2=$L1_256 'BEGIN{printf ("%.2f", log(e1/e2)/log(2))}'`
-ratefull=`awk -v e1=$L1_128full -v e2=$L1_256full 'BEGIN{printf ("%.2f", log(e1/e2)/log(2))}'`
-echo "\$L_\infty\$ & $L1_128 & $rate & $L1_256 & $L1_128full & $ratefull & $L1_256full \\\\ \hline"
-
-cat <<EOF
-\end{tabular}
-\end{center}
-\caption{Errors and convergence rates for the \$y\$-component of the velocity.}
-\end{table}
-EOF
diff --git a/test/euler/template.tex b/test/euler/template.tex
index 6238165..0dc1aaa 100644
--- a/test/euler/template.tex
+++ b/test/euler/template.tex
@@ -27,6 +27,10 @@
\input{periodic/periodic.tex}
\input{merging/merging.tex}
+\section{Solid boundaries}
+
+\input{boundaries/boundaries.tex}
+
\bibliographystyle{plain}
\bibliography{tests}
diff --git a/test/euler/tests.bib b/test/euler/tests.bib
index bb9cec2..8ea576e 100644
--- a/test/euler/tests.bib
+++ b/test/euler/tests.bib
@@ -1,3 +1,15 @@
+ at Article{almgren97,
+ author = {A. S. Almgren and J. B. Bell and P. Colella and T. Marthaler},
+ title = {A Cartesian Grid Projection Method for the Incompressible Euler Equations in Complex Geometries},
+ journal = {SIAM J. Sci. Comp.},
+ year = 1997,
+ volume = 18,
+ number = 5,
+ pages = {1289-1309},
+ url = {http://seesar.lbl.gov/ccse/Publications/almgren/abcm.sisc/paper.ps.gz},
+ local_url = {almgren.ps.gz}
+}
+
@Article{almgren98,
author = {A. S. Almgren and J. B. Bell and P. Colella and L. H. Howell and M. L. Welcome},
title = {A Conservative Adaptive Projection Method for the Variable Density Incompressible Navier-Stokes Equations},
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list