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

Stephane Popinet popinet at users.sf.net
Fri May 15 02:52:42 UTC 2009


The following commit has been merged in the upstream branch:
commit a75b0fd7744e8660a6cea9a856a2774c9f85b8f9
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Wed Sep 28 19:54:20 2005 +1000

    Capillary wave test case
    
    darcs-hash:20050928095420-d4795-9d5dbea0bbb5441c1127ba1fe329d45ad9b9121e.gz

diff --git a/test/euler/Makefile.am b/test/euler/Makefile.am
index da7833c..c9984bf 100644
--- a/test/euler/Makefile.am
+++ b/test/euler/Makefile.am
@@ -9,6 +9,7 @@ TESTDIRS = \
 	boundaries \
 	channel \
 	spurious \
+	capwave \
 	waves
 
 EXTRA_DIST = \
diff --git a/test/euler/capwave/capwave.gfs b/test/euler/capwave/capwave.gfs
new file mode 100644
index 0000000..208abde
--- /dev/null
+++ b/test/euler/capwave/capwave.gfs
@@ -0,0 +1,84 @@
+# Title: Planar capillary waves
+#
+# Description:
+#
+# A small amplitude sinusoidal wave oscillates under surface
+# tension. Prosperetti \cite{prosperetti81} found a solution to this
+# initial value problem in the limit of a vanishingly small initial
+# amplitude.
+#
+# Table \ref{convergence} shows the convergence of various
+# solvers as a function of resolution: Gerris, the marker technique of
+# \cite{popinet99} and Surfer \cite{gueyffier98}.
+#
+# The time-evolution of the amplitude given by Prosperetti's theory
+# and Gerris ($128^2$) is given on Figure
+# \ref{amplitude}.
+#
+# \begin{table}[htbp]
+# \begin{center}
+# \begin{tabular}{|l|ccccc|} \hline
+# Method & $8^2$ & $16^2$ & $32^2$ & $64^2$ & $128^2$ \\ \hline
+# \input{convergence.tex} \\
+# Markers & 0.3018 & 0.0778 & 0.0131 & 0.0082 & 0.00645 \\
+# Surfer & - & - & 0.1168 & 0.0132 & 0.007 \\ \hline
+# \end{tabular}
+# \end{center}
+# \caption{Convergence of the relative error between the analytical
+# solution and simulation results from various solvers.}
+# \end{table}
+#
+# \begin{figure}[htbp]
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{amplitude.eps}
+# \end{center}
+# \caption{Evolution of the amplitude of the capillary wave as a
+# function of non-dimensional time $\tau=\omega_0 t$.}
+# \label{amplitude}
+# \end{figure}
+#
+# Author: St\'ephane Popinet
+# Command: sh capwave.sh capwave.gfs
+# Version: 0.6.4
+# Required files: capwave.sh convergence.ref
+# Running time: 3 minutes
+# Generated files: convergence.tex amplitude.eps
+#
+1 1 GfsSimulation GfsBox GfsGEdge {} {
+  Time {
+    end = 2.2426211256
+    dtmax = 1.01430173026e-3
+  }
+  ApproxProjectionParams { tolerance = 1e-6 }
+  ProjectionParams { tolerance = 1e-6 }
+  Refine LEVEL
+  VariableTracer {} T { scheme = vof }
+  SourceTension {} T 1
+  AdvectionParams { scheme = none }
+  SourceDiffusion {} U 0.0182571749236
+  SourceDiffusion {} V 0.0182571749236
+  InitFraction {} T wave.gts
+  OutputSimulation { istep = 3 } sim-%ld.gfs { binary = 1 }
+  EventScript { istep = 3 } {
+    echo $GfsTime | awk -v level=LEVEL '{printf ("%g ", $1*11.1366559937) >> ("wave-" level) }'
+    gfs2oogl2D -g -c T < sim-$GfsIter.gfs | sort -n +1 -2 | awk -v level=LEVEL 'BEGIN {
+      n = exp (level*log (2.));
+      x = 1./(n + 1.);
+      c1 = c2 = 0.;
+    }
+    {
+      if ($1 > 0. && $1 < x) {
+        if (c1 + c2 < 1. && c2 + $4 > 1.) {
+          print y2+(0.5-c2)/n >> ("wave-" level);
+          exit 0;
+        }
+        c1 = c2;
+        c2 = $4;
+        y2 = $2;
+      }
+    }'
+    rm -f sim-$GfsIter.gfs
+  }
+}
+GfsBox {}
+1 1 right
diff --git a/test/euler/capwave/capwave.sh b/test/euler/capwave/capwave.sh
new file mode 100755
index 0000000..576f4bc
--- /dev/null
+++ b/test/euler/capwave/capwave.sh
@@ -0,0 +1,73 @@
+levels="3 4 5 6 7"
+
+if ! $donotrun; then
+    file=`mktemp /tmp/wave.XXXXXX`
+    awk 'BEGIN{
+      print "0.51 -0.51"
+      for (x = 0.51; x >= -0.51; x -= 0.01) 
+        print x " " 0.01*cos (2.*3.14159265359*x);
+      print "-0.51 -0.51"
+    }' > $file
+    shapes $file > wave.gts
+    rm -f $file
+
+    for level in $levels; do
+	rm -f wave-$level
+	if sed "s/LEVEL/$level/g" < $1 | gerris2D -; then
+	    :
+	else
+	    exit 1;
+	fi
+    done
+fi
+
+rm -f convergence
+for level in $levels; do
+    if awk -v level=$level 'BEGIN {s = 0.; n = 0; } {
+          t = $1; y = $2;
+          getline < "prosperetti"
+          dt = abs ($1 - t);
+          if (dt > 1e-5) {
+            print "Level " level ": times do not match " $1 " " t " " dt
+            exit 1
+          }
+          s += (y - $2)*(y - $2);
+          n += 1;
+        }
+        END {
+          s = sqrt (s/n)/0.01;
+          printf ("%d %g\n", level, s);
+        }' < wave-$level >> convergence; then
+	:
+    else
+	exit 1;
+    fi
+done
+
+awk 'BEGIN{first=1}{ 
+  if (first) printf("Gerris & %.5f",$2);
+  else printf(" & %.5f",$2);
+  first=0;
+}
+END{printf("\n");}' < convergence > convergence.tex
+
+if cat <<EOF | gnuplot ; then :
+    set term postscript eps color lw 3 solid 20
+    set output 'amplitude.eps'
+    set xlabel 'tau'
+    set ylabel 'Relative amplitude'
+    plot 'prosperetti' w l t "Prosperetti", 'wave-5' every 10 w p t "Gerris"
+EOF
+else
+    exit 1
+fi
+
+if cat <<EOF | python ; then :
+from check import *
+from sys import *
+if (Curve('convergence',1,2) - Curve('convergence.ref',1,2)).max() > 0.:
+    exit(1)
+EOF
+else
+   exit 1
+fi
diff --git a/test/euler/capwave/convergence.ref b/test/euler/capwave/convergence.ref
new file mode 100644
index 0000000..02fea89
--- /dev/null
+++ b/test/euler/capwave/convergence.ref
@@ -0,0 +1,3 @@
+3 0.427077
+4 0.255341
+5 0.0784345
diff --git a/test/euler/capwave/wave.sh b/test/euler/capwave/wave.sh
deleted file mode 100755
index d121022..0000000
--- a/test/euler/capwave/wave.sh
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/bin/sh
-
-if test -f wave.gts; then
-    :
-else
-    file=`mktemp /tmp/wave.XXXXXX`
-    awk 'BEGIN{
-      print "0.51 -0.51"
-      for (x = 0.51; x >= -0.51; x -= 0.01) 
-        print x " " 0.01*cos (2.*3.14159265359*x);
-      print "-0.51 -0.51"
-    }' > $file
-    shapes $file > wave.gts
-    rm -f $file
-fi
-
-param=`mktemp /tmp/wave.XXXXXX`
-
-for level in 3 4 5 6 7; do
-    rm -f wave-$level
-    cat <<EOF > $param
-1 1 GfsSimulation GfsBox GfsGEdge {} {
-  Time {
-    end = 2.2426211256
-    dtmax = 1.01430173026e-3
-  }
-  ApproxProjectionParams { tolerance = 1e-6 }
-  ProjectionParams { tolerance = 1e-6 }
-  Refine $level
-  VariableTracer {} T { scheme = vof }
-  SourceTension {} U V T 1
-  AdvectionParams { scheme = none }
-  SourceDiffusion {} U 0.0182571749236
-  SourceDiffusion {} V 0.0182571749236
-  InitFraction {} T wave.gts
-  OutputProgress { istep = 1 } stdout
-  OutputSimulation { istep = 3 } $param-%ld.gfs { binary = 1 }
-  EventScript { istep = 3 } {
-    echo \$GfsTime | awk -v level=$level '{printf ("%g ", \$1*11.1366559937) >> ("wave-" level) }'
-    gfs2oogl2D -g -c T < $param-\$GfsIter.gfs | sort -n +1 -2 | awk -v level=$level 'BEGIN {
-      n = exp (level*log (2.));
-      x = 1./(n + 1.);
-      c1 = c2 = 0.;
-    }
-    {
-      if (\$1 > 0. && \$1 < x) {
-        if (c1 + c2 < 1. && c2 + \$4 > 1.) {
-          print y2+(0.5-c2)/n >> ("wave-" level);
-          exit 0;
-        }
-        c1 = c2;
-        c2 = \$4;
-        y2 = \$2;
-      }
-    }'
-    rm -f $param-\$GfsIter.gfs
-  }
-}
-GfsBox {}
-1 1 right 
-EOF
-    if gerris2D $param; then
-	if awk -v level=$level 'BEGIN {s = 0.; n = 0; } {
-          t = $1; y = $2;
-          getline < "prosperetti"
-          dt = abs ($1 - t);
-          if (dt > 1e-5) {
-            print "Level " level ": times do not match " $1 " " t " " dt
-            exit 1
-          }
-          s += (y - $2)*(y - $2);
-          n += 1;
-        }
-        END {
-          s = 100.*sqrt (s/n)/0.01;
-          printf ("Level %d: %g%%: ", level, s);
-
-          max[3] = 43.; max[4] = 26.; max[5] = 8.; max[6] = 1.9; max[7] = 0.7;
-          if (s > max[level]) {
-            print "FAIL [" max[level] "]"
-            exit 1
-          }
-          else
-            print "PASS";
-        }' < wave-$level; then
-	    :
-	else
-	    exit 1;
-        fi
-    else
-	exit 1;
-    fi
-done
-
-rm -f $param
diff --git a/test/euler/template.tex b/test/euler/template.tex
index 276e9a3..46e246a 100644
--- a/test/euler/template.tex
+++ b/test/euler/template.tex
@@ -50,6 +50,7 @@ current stable branch of the version-controlled source code.
 \section{Surface tension}
 
 \input{spurious/spurious.tex}
+\input{capwave/capwave.tex}
 
 \section{Shallow-water}
 
diff --git a/test/euler/tests.bib b/test/euler/tests.bib
index ea5da9d..0eb7951 100644
--- a/test/euler/tests.bib
+++ b/test/euler/tests.bib
@@ -21,6 +21,15 @@
   local_url =    {almgren1.ps.gz}
 }
 
+ at Article{gueyffier98,
+  author = 	 {D. Gueyffier and A. Nadim and J. Li and R. Scardovelli and S. Zaleski},
+  title = 	 {Volume of fluid interface tracking with smoothed surface stress methods for three-dimensional flows},
+  journal = 	 {J. Comp. Phys.},
+  year = 	 1998,
+  volume =	 152,
+  pages =	 {423-456}
+}
+
 @Book{lamb,
   author =	 {H. Lamb},
   title = 	 {Hydrodynamics},
@@ -59,6 +68,15 @@
   year =         1999
 }
 
+ at Article{prosperetti81,
+  author = 	 {A. Prosperetti},
+  title = 	 {Motion of two superposed viscous fluids},
+  journal = 	 {Phys. Fluids},
+  year = 	 1981,
+  volume =	 24,
+  pages =	 {1217-1223}
+}
+
 @TechReport{rider95,
   author = 	 {W. J. Rider},
   title = 	 {Approximate projection methods for incompressible flows: Implementation, variants and robustness},
@@ -77,3 +95,4 @@
   year = 	 2005,
   url =          {http://marine.rutgers.edu/po/index.php?model=test-problems&title=circle}
 }
+

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list