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

Stephane Popinet s.popinet at niwa.co.nz
Fri May 15 02:52:45 UTC 2009


The following commit has been merged in the upstream branch:
commit c3a90e52f6a6881f8b1d99cc71fe13c9eebb8d81
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date:   Tue Oct 4 13:19:31 2005 +1000

    Simple advection test case
    
    darcs-hash:20051004031931-fbd8f-fc8c09238e15024b41ddbf54c571f87948314eb8.gz

diff --git a/test/euler/Makefile.am b/test/euler/Makefile.am
index 784cf4a..2df369e 100644
--- a/test/euler/Makefile.am
+++ b/test/euler/Makefile.am
@@ -3,6 +3,7 @@
 TESTDIRS = \
 	poisson \
 	circle \
+	advection \
 	reynolds \
 	periodic \
 	merging \
diff --git a/test/euler/advection/advection.gfs b/test/euler/advection/advection.gfs
new file mode 100644
index 0000000..7c82881
--- /dev/null
+++ b/test/euler/advection/advection.gfs
@@ -0,0 +1,58 @@
+# Title: Convergence of the Godunov advection scheme
+#
+# Description:
+#
+# A non-trivial initial tracer distribution is advected by a constant
+# velocity field corresponding to a solid rotation around the center
+# of the domain. The tracer field after one revolution is compared to the
+# initial tracer field to compute the error norms.
+#
+# Figure \ref{error} and \ref{order} illustrate the convergence of the
+# solution with increased resolution. Close to second-order
+# convergence is obtained.
+#
+# \begin{figure}[htbp]
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{error.eps}
+# \end{center}
+# \caption{Evolution of the error as a function of resolution.}
+# \label{error}
+# \end{figure}
+#
+# \begin{figure}[htbp]
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{order.eps}
+# \end{center}
+# \caption{Corresponding convergence order.}
+# \label{order}
+# \end{figure}
+#
+# Author: St\'ephane Popinet
+# Command: sh advection.sh advection.gfs
+# Version: 0.8.0
+# Required files: advection.sh error.ref
+# Generated files: error.eps order.eps
+#
+1 0 GfsAdvection GfsBox GfsGEdge {} {
+  Time { end = 0.785398 }
+  Refine LEVEL
+  VariableTracer {} T { gradient = gfs_center_gradient }
+  AdvectionParams { cfl = 0.5 }
+  Init {} {
+    U = -8.*y
+    V = 8.*x
+    T = {
+      double r2 = x*x + y*y; 
+      double coeff = 20. + 20000.*r2*r2*r2*r2;
+      return (1. + cos(20.*x)*cos(20.*y))*exp(-coeff*r2)/2.;
+    }
+  }
+  OutputErrorNorm { start = end } { awk '{ print LEVEL " " $5 " " $7 " " $9}' } { v = T } {
+    s = {
+      double r2 = x*x + y*y; 
+      double coeff = 20. + 20000.*r2*r2*r2*r2;
+      return (1. + cos(20.*x)*cos(20.*y))*exp(-coeff*r2)/2.;
+    }
+  }
+}
+GfsBox {}
diff --git a/test/euler/poisson/poisson.sh b/test/euler/advection/advection.sh
similarity index 68%
copy from test/euler/poisson/poisson.sh
copy to test/euler/advection/advection.sh
index 29ee508..6873106 100644
--- a/test/euler/poisson/poisson.sh
+++ b/test/euler/advection/advection.sh
@@ -1,9 +1,8 @@
 if ! $donotrun; then
     rm -f error
-    for level in 3 4 5 6 7 8; do
-	rm -f res-$level
+    for level in 4 5 6 7 8; do
 	if sed "s/LEVEL/$level/g" < $1 | \
-	    gerris2D - >> res-$level; then :
+	    gerris2D - >> error; then :
 	else
 	    exit 1
 	fi
@@ -25,16 +24,6 @@ fi
 
 if cat <<EOF | gnuplot ; then :
     set term postscript eps color lw 3 solid 20
-    set output 'residual.eps'
-    set xlabel 'CPU time'
-    set ylabel 'Maximum residual'
-    set logscale y
-    plot 'res-7.ref' u 1:3 t 'ref' w lp, 'res-7' u 1:3 t '' w lp
-    set output 'rate.eps'
-    set xlabel 'V-cycle'
-    set ylabel 'Cumulative residual reduction factor'
-    unset logscale
-    plot 'res-7.ref' u 2:4 t 'ref' w lp, 'res-7' u 2:4 t '' w lp
     set output 'error.eps'
     set xlabel 'Level'
     set ylabel 'Error norms'
@@ -68,11 +57,7 @@ fi
 if cat <<EOF | python ; then :
 from check import *
 from sys import *
-c = Curve()
-for p in Curve('res-7.ref',1,3).l:
-    c.l.append((p[0]+0.1, p[1]))
-if (Curve('res-7',1,3) - c).max() > 1e-8 or\
-   (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
+if (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
     exit(1)
 EOF
 else
diff --git a/test/euler/advection/error.ref b/test/euler/advection/error.ref
new file mode 100644
index 0000000..0fbd976
--- /dev/null
+++ b/test/euler/advection/error.ref
@@ -0,0 +1,5 @@
+4 3.442e-02 6.530e-02 2.831e-01
+5 1.961e-02 3.836e-02 1.796e-01
+6 5.639e-03 1.115e-02 5.452e-02
+7 1.213e-03 2.477e-03 1.249e-02
+8 2.709e-04 5.785e-04 2.898e-03
diff --git a/test/euler/advection/order.ref b/test/euler/advection/order.ref
new file mode 100644
index 0000000..b854eef
--- /dev/null
+++ b/test/euler/advection/order.ref
@@ -0,0 +1,4 @@
+5 0.811658 0.76748 0.656524
+6 1.79808 1.78256 1.71993
+7 2.21686 2.17038 2.12601
+8 2.16275 2.09821 2.10764
diff --git a/test/euler/template.tex b/test/euler/template.tex
index 9fa75c5..a497213 100644
--- a/test/euler/template.tex
+++ b/test/euler/template.tex
@@ -35,6 +35,10 @@ current stable branch of the version-controlled source code.
 \input{circle/refined/refined.tex}
 \input{circle/thin/thin.tex}
 
+\section{Advection}
+
+\input{advection/advection.tex}
+
 \section{Euler}
 
 \input{reynolds/reynolds.tex}

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list