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

Stephane Popinet popinet at users.sf.net
Fri May 15 02:53:43 UTC 2009


The following commit has been merged in the upstream branch:
commit 336c1defe5aa11954c2ef98ef4d8b115017b44ec
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Fri Oct 20 11:39:50 2006 +1000

    Updated spurious currents test case
    
    darcs-hash:20061020013950-d4795-0c5981f7849c976965fc1ffd80135f97412003d5.gz

diff --git a/test/spurious/convergence.ref b/test/spurious/convergence.ref
index b101eb6..637559d 100644
--- a/test/spurious/convergence.ref
+++ b/test/spurious/convergence.ref
@@ -1,3 +1,4 @@
-12.8 0.00223434
-25.6 0.0021743
-51.2 0.00161427
+12.8 3.748e-04 4.255e-03
+25.6 6.606e-05 8.766e-04
+51.2 2.301e-05 4.133e-04
+102.4 5.480e-06 1.632e-04
diff --git a/test/spurious/spurious.gfs b/test/spurious/spurious.gfs
index 818a005..4699f06 100644
--- a/test/spurious/spurious.gfs
+++ b/test/spurious/spurious.gfs
@@ -1,32 +1,30 @@
-# Title: Amplitude of spurious currents
+# Title: Circular droplet in equilibrium
 #
 # Description:
 #
-# A circular "bubble" of diameter $D=0.8$ is initialised centered on
+# A circular droplet of diameter $D=0.8$ is initialised centered on
 # the top-left corner of the unit box. Surface tension is imposed on
 # the interface. The exact solution is given by Laplace's law: uniform
 # zero velocity and a pressure jump accross the interface exactly
 # balancing the surface tension force.
 #
-# This test case uses a continuum formulation for surface tension,
-# which induces numerical errors leading to a non-exact balance of
-# pressure gradient and surface tension forces. A measure of the
-# amplitude of this error is the amplitude of the resulting "spurious
-# currents" around the bubble (see for example \cite{popinet99} for
-# a detailed discussion). The pattern of spurious currents obtained
-# using Gerris is illustrated on figure \ref{vectors}.
+# The initial condition -- while close to the exact solution -- does
+# not guarantee the exact balance between the numerical
+# discretisations of surface tension and pressure gradient. However,
+# these small initial perturbations generate small capillary waves
+# which are progressively (on a timescale of order $D^2/\mu$) damped
+# by viscosity so that the exact (to round-off error) balance is
+# eventually obtained.
 #
-# Figure \ref{laplace} illustrates the independence of the asymptotic
-# ($t\rightarrow\infty$) non-dimensional capillary number
-# $Ca=\max(|{\bf u}|)\mu/\sigma$ from the Laplace number $La=\sigma\rho
-# D/\mu^2$. The asymptotic value of $Ca$ is a measure of the accuracy
-# of the numerical scheme (the smaller the better).
+# The convergence is obtained for a wide range of Laplace numbers
+# $La=\sigma\rho D/\mu^2$, as illustrated on Figure \ref{laplace}.
 #
 # \begin{figure}[htbp]
-# \caption{\label{vectors}Spurious currents at equilibrium for $La=12000$.}
 # \begin{center}
 # \includegraphics[width=0.6\hsize]{vectors.eps}
 # \end{center}
+# \caption{Spurious currents at equilibrium for $La=12000$.}
+# \label{vectors}
 # \end{figure}
 #
 # \begin{figure}[htbp]
@@ -36,6 +34,10 @@
 # \begin{center}
 # \includegraphics[width=0.8\hsize]{laplace.eps}
 # \end{center}
+# \caption{Evolution of the capillary number $Ca$ as a function of
+# non-dimensional time $\tau=t\sigma/(\mu D)$ for the range of Laplace
+# numbers indicated in the legend.}
+# \label{laplace}
 # \end{figure}
 #
 # \begin{figure}[htbp]
@@ -51,32 +53,38 @@
 #
 # Author: St\'ephane Popinet
 # Command: sh spurious.sh spurious.gfs
-# Version: 0.9.0
-# Required files: spurious.sh vectors.gfv convergence.ref
-# Generated files: laplace.eps convergence.eps vectors.eps
+# Version: 1.0.0
+# Required files: spurious.sh convergence.ref
+# Generated files: laplace.eps convergence.eps
 #
 1 0 GfsSimulation GfsBox GfsGEdge {} {
-  Time { end = TMAX dtmax = 2e-3 }
+  Time { end = TMAX }
   Refine LEVEL
+  RefineSurface 10 circle.gts
 
-  ApproxProjectionParams { tolerance = 1e-6 nitermin = 1 }
-  ProjectionParams { tolerance = 1e-6 nitermin = 1 }
+  ApproxProjectionParams { tolerance = 1e-6 }
+  ProjectionParams { tolerance = 1e-6 }
   AdvectionParams { scheme = none }
 
   VariableTracer {} T { scheme = vof }
-  VariableFiltered {} T1 T 1
-  VariableDistance {} L T
-  VariableCurvature {} K L
-  SourceTension {} T K
+  VariableCurvature {} K T
+  SourceTension {} T 1 K
   SourceDiffusion {} U MU
   SourceDiffusion {} V MU
 
   InitFraction {} T circle.gts
-  
-  AdaptGradient { istep = 1 } { cmax = 1e-6 maxlevel = LEVEL } T1
+  Init {} { Tref = T }
+
+  AdaptGradient { istep = 1 } { cmax = 1e-6 maxlevel = LEVEL } T
+  EventStop { istep = 10 } T DT
 
-  OutputSimulation { start = end } sim-LEVEL {}
-  OutputScalarNorm { istep = 1 } { awk '{ print $3/(MU*0.8) " " $9*MU }' } { v = Velocity }
+  OutputSimulation { start = end } stdout { depth = LEVEL }
+  OutputScalarNorm { istep = 1 } {
+    awk '{ print MU*$3/(0.8*0.8) " " $9*sqrt(0.8) }' > La-LAPLACE-LEVEL
+  } { v = Velocity }
+  OutputScalarNorm { istep = 1 } {
+    awk '{ print MU*$3/(0.8*0.8) " " $5 " " $7 " " $9 }' > E-LAPLACE-LEVEL
+  } { v = (Tref - T) }
 }
 GfsBox {
   top = Boundary
diff --git a/test/spurious/spurious.sh b/test/spurious/spurious.sh
index 2d36ddc..dc8e543 100755
--- a/test/spurious/spurious.sh
+++ b/test/spurious/spurious.sh
@@ -1,52 +1,57 @@
 if ! $donotrun; then
-    shapes ellipse | transform --scale 1.6 | transform --tx -0.5 --ty 0.5 > circle.gts
-    for La in 12000 1200 120; do
+    shapes -n 1000 ellipse | transform --scale 1.6 | transform --tx -0.5 --ty 0.5 > circle.gts
+    for La in 120 1200 12000; do
 	mu=`echo $La | awk '{print sqrt (0.8/$1)}'`
-	tmax=`echo $mu | awk '{print 1000.*$1*0.8}'`
-	if sed "s/LEVEL/6/g" < $1 |\
+	tmax=`echo $mu | awk '{print 0.8*0.8/$1}'`
+	if sed "s/LEVEL/5/g" < $1 |\
            sed "s/MU/$mu/g" |\
-           sed "s/TMAX/$tmax/g" | gerris2D - > La\=$La; then :
+	   sed "s/LAPLACE/$La/g" |\
+	   sed "s/DT/0/" |\
+           sed "s/end = TMAX/iend = 1/g" | gerris2D - |\
+           sed "s/iend = 1/end = $tmax/" | gerris2D - > /dev/null; then :
 	else
 	    exit 1
 	fi
     done
 
     rm -f convergence
-    for level in 4 5 6; do
-        La=12000
+    La=12000
+    for level in 4 6 7; do
         mu=`echo $La | awk '{print sqrt (0.8/$1)}'`
-	tmax=`echo $mu | awk '{print 1000.*$1*0.8}'`
+	tmax=`echo $mu | awk '{print 0.8*0.8/$1}'`
 	if sed "s/LEVEL/$level/g" < $1 |\
            sed "s/MU/$mu/g" |\
-           sed "s/TMAX/$tmax/g" | gerris2D - | awk -v level=$level '{
-             max = $2
-           }END{print 0.8*2**level " " max}' >> convergence; then :
+	   sed "s/LAPLACE/$La/g" |\
+	   sed "s/DT/1e-9/" |\
+           sed "s/end = TMAX/iend = 1/g" | gerris2D - |\
+           sed "s/iend = 1/end = $tmax/" | gerris2D - > sim-$level; then : 
+	else
+	    exit 1
+	fi
+    done
+    for level in 4 5 6 7; do
+	if awk -v level=$level < E-$La-$level '{
+             max2 = $3
+             maxi = $4
+           }END{print 0.8*2**level " " max2 " " maxi}' >> convergence; then : 
 	else
 	    exit 1
 	fi
     done
-fi
-
-if cat <<EOF | gfsview-batch2D sim-4 vectors.gfv ; then :
-Save vectors.eps { format = EPS line_width = 1 }
-EOF
-else
-    exit 1
 fi
 
 if cat <<EOF | gnuplot ; then :
     set term postscript eps color lw 3 solid 20
     set output 'laplace.eps'
     set xlabel 'Tau'
-    set ylabel 'Ca'
+    set ylabel 'U(D/sigma)^1/2'
     set logscale y
-    plot 'La=120' w l, 'La=1200' w l, 'La=12000' w l
+    plot 'La-120-5' w l t "La=120", 'La-1200-5' w l t "La=1200", 'La-12000-5' w l t "La=12000"
     set output 'convergence.eps'
     set xlabel 'D'
-    set ylabel 'Ca'
-    unset key
-    unset logscale
-    plot [][0:]'convergence' w lp ps 3
+    set ylabel 'Shape error'
+    set logscale x
+    plot [10:120]'convergence' u 1:2 w lp t "RMS" ps 3, 'convergence' u 1:3 w lp t "Max" ps 3, 0.2/(x*x) t "Second order"
 EOF
 else
     exit 1
@@ -55,7 +60,7 @@ fi
 if cat <<EOF | python ; then :
 from check import *
 from sys import *
-if (Curve('convergence',1,2) - Curve('convergence.ref',1,2)).max() > 1e-8:
+if (Curve('convergence',1,3) - Curve('convergence.ref',1,3)).max() > 1e-6:
     exit(1)
 EOF
 else
diff --git a/test/spurious/vectors.gfv b/test/spurious/vectors.gfv
deleted file mode 100644
index 76fe49a..0000000
--- a/test/spurious/vectors.gfv
+++ /dev/null
@@ -1,47 +0,0 @@
-# GfsView 2D
-View {
-  tx = 0 ty = 0
-  q0 = 0 q1 = 0 q2 = 0 q3 = 1
-  fov = 30
-  r = 0.3 g = 0.4 b = 0.6
-  res = 1
-  lc = 0.001
-  reactivity = 0.1
-}
-Vectors {
-  r = 0 g = 0 b = 0
-  shading = Constant
-  maxlevel = 5
-} {
-  n.x = 0 n.y = 0 n.z = 1
-  pos = 0
-} P {
-  amin = 1
-  amax = 1
-  cmap = Jet
-} U V {
-  scale = 1074
-  use_scalar = 0
-}
-Isoline {
-  r = 0 g = 0 b = 0
-  shading = Constant
-  maxlevel = 5
-} {
-  n.x = 0 n.y = 0 n.z = 1
-  pos = 0
-} T {
-  amin = 1
-  amax = 1
-  cmap = Jet
-} {
-  n = 1
-}
-Cells {
-  r = 0 g = 0 b = 0
-  shading = Constant
-  maxlevel = 0
-} {
-  n.x = 0 n.y = 0 n.z = 1
-  pos = 0
-}

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list