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

Stephane Popinet popinet at users.sf.net
Fri May 15 02:55:19 UTC 2009


The following commit has been merged in the upstream branch:
commit bb28bb44efa7656888e0e1c621e2226d83c267a8
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Wed May 7 20:27:13 2008 +1000

    Poiseuille flow test case
    
    darcs-hash:20080507102713-d4795-c835456e35d85fd23e83447329c71568a07b0a95.gz

diff --git a/test/Makefile.am b/test/Makefile.am
index 9b280f3..c15d4b0 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -10,6 +10,7 @@ TESTDIRS = \
 	periodic \
 	merging \
 	lid \
+	poiseuille \
 	couette \
 	kinetic \
 	hydrostatic \
diff --git a/test/poiseuille/error.ref b/test/poiseuille/error.ref
new file mode 100644
index 0000000..94b0a33
--- /dev/null
+++ b/test/poiseuille/error.ref
@@ -0,0 +1,4 @@
+3 1.953e-03 1.953e-03 1.953e-03
+4 4.883e-04 4.883e-04 4.884e-04
+5 1.223e-04 1.223e-04 1.224e-04
+6 3.084e-05 3.084e-05 3.103e-05
diff --git a/test/poiseuille/poiseuille.gfs b/test/poiseuille/poiseuille.gfs
new file mode 100644
index 0000000..6b42cd3
--- /dev/null
+++ b/test/poiseuille/poiseuille.gfs
@@ -0,0 +1,53 @@
+# Title: Poiseuille flow
+#
+# Description:
+#
+# A simple parabolic Poiseuille flow in a periodic channel with a
+# constant along-channel acceleration $a$. The theoretical solution is given by:
+# $$u(y)={a\over 2\nu}(1/4-y^2)$$
+# Figure \ref{convergence} illustrates the maximum error between the
+# computed and theoretical solutions as a function of spatial
+# resolution.
+#
+# \begin{figure}[htbp]
+# \caption{\label{convergence}Convergence of the maximum error as a function
+# of resolution (number of grid points across the channel).}
+# \begin{center}
+# \includegraphics[width=\hsize]{convergence.eps}
+# \end{center}
+# \end{figure}
+#
+# Author: St\'ephane Popinet
+# Command: sh poiseuille.sh
+# Version: 1.2.0
+# Required files: poiseuille.sh error.ref
+# Generated files: convergence.eps
+#
+1 1 GfsSimulation GfsBox GfsGEdge {} {
+    Refine LEVEL
+    # use backward Euler to avoid Crank-Nicholson oscillations in time
+    SourceViscosity 1. { beta = 1 }
+    Source U 1
+
+    # we need this so that acceleration can be balanced by viscous stress
+    # and yes, fixme, this is a mess...
+    AdvectionParams { gc = 1 }
+
+    EventStop { istep = 1 } U 1e-6 DU
+    ProjectionParams { tolerance = 1e-6 }
+    ApproxProjectionParams { tolerance = 1e-6 }
+    OutputErrorNorm { start = end } { awk '{print LEVEL,$5,$7,$9}' } { v = U } { 
+        s = 1./2.*(1./4 - y*y) 
+    }
+}
+GfsBox {
+    bottom = Boundary {
+        BcDirichlet U 0 
+        BcDirichlet V 0 
+    }
+    top = Boundary {
+        BcDirichlet U 0 
+        BcDirichlet V 0 
+    }
+}
+1 1 right
diff --git a/test/poiseuille/poiseuille.sh b/test/poiseuille/poiseuille.sh
new file mode 100644
index 0000000..f9d894a
--- /dev/null
+++ b/test/poiseuille/poiseuille.sh
@@ -0,0 +1,35 @@
+levels="3 4 5 6"
+
+if ! $donotrun; then
+    rm -f error
+    for level in $levels; do
+	if gerris2D -DLEVEL=$level poiseuille.gfs >> error; then :
+	else
+	    exit 1
+	fi
+    done
+fi
+
+if cat <<EOF | gnuplot ; then :
+    set term postscript eps color lw 3 solid 20
+    set output 'convergence.eps'
+    set xlabel 'Number of grid points'
+    set ylabel 'Maximum error'
+    set logscale
+    set grid
+    set xtics 2
+    plot [6:80]'error' u (2**\$1):4 w lp t 'Gerris' pt 5, 1./x**2./5. t 'second order'
+EOF
+else
+    exit 1
+fi
+
+if cat <<EOF | python ; then :
+from check import *
+from sys import *
+if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
+    exit(1)
+EOF
+else
+   exit 1
+fi
diff --git a/test/template.tex b/test/template.tex
index b79d7d3..7610a81 100644
--- a/test/template.tex
+++ b/test/template.tex
@@ -57,6 +57,7 @@ current stable branch of the version-controlled source code.
 \section{Navier-Stokes}
 
 \input{lid/lid.tex}
+\input{poiseuille/poiseuille.tex}
 \input{couette/couette.tex}
 \input{kinetic/kinetic.tex}
 \input{hydrostatic/hydrostatic.tex}

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list