[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
s.popinet at niwa.co.nz
Fri May 15 02:52:04 UTC 2009
The following commit has been merged in the upstream branch:
commit b2410196eccf0e145a9eb4acff61c3c9834efc27
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date: Wed Jun 22 16:55:00 2005 +1000
New-style spurious current test case
darcs-hash:20050622065500-fbd8f-53e5722039dfab219c82e737c72a58f18aafc172.gz
diff --git a/test/Makefile.am b/test/Makefile.am
index 6b062d4..84b1794 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,3 +1,3 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = poisson advection euler mpi ocean tension
+SUBDIRS = poisson advection euler mpi ocean
diff --git a/test/euler/Makefile.am b/test/euler/Makefile.am
index 41c42c1..1de49ad 100644
--- a/test/euler/Makefile.am
+++ b/test/euler/Makefile.am
@@ -5,7 +5,8 @@ TESTDIRS = \
periodic \
merging \
boundaries \
- channel
+ channel \
+ spurious
EXTRA_DIST = \
template.tex \
diff --git a/test/tension/prosperetti b/test/euler/capwave/prosperetti
similarity index 100%
rename from test/tension/prosperetti
rename to test/euler/capwave/prosperetti
diff --git a/test/tension/wave.sh b/test/euler/capwave/wave.sh
similarity index 100%
rename from test/tension/wave.sh
rename to test/euler/capwave/wave.sh
diff --git a/test/euler/spurious/convergence.ref b/test/euler/spurious/convergence.ref
new file mode 100644
index 0000000..cad09ad
--- /dev/null
+++ b/test/euler/spurious/convergence.ref
@@ -0,0 +1,3 @@
+6.4 0.000709563
+12.8 0.00223434
+25.6 0.0021743
diff --git a/test/euler/spurious/spurious.gfs b/test/euler/spurious/spurious.gfs
new file mode 100644
index 0000000..e3b6390
--- /dev/null
+++ b/test/euler/spurious/spurious.gfs
@@ -0,0 +1,85 @@
+# Title: Amplitude of spurious currents
+#
+# Description:
+#
+# A circular "bubble" of diameter $D=0.4$ is initialised in the middle 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}.
+#
+# Figure \ref{laplace} illustrates the independence of the asymptotic
+# ($t\rightarrow\infty$) non-dimensional capillary number
+# $Ca=\max(|{\bf u}|)/\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).
+#
+# An annoying property of simple continuum formulations for surface
+# tension is that they are in effect of order 0 i.e. they do not
+# converge with resolution as demonstrated on figure
+# \ref{convergence}.
+#
+# \begin{figure}[htbp]
+# \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]
+# \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]
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{convergence.eps}
+# \end{center}
+# \caption{Poor convergence of the capillary number with increased
+# resolution. The diameter is given in number of grid points.}
+# \label{convergence}
+# \end{figure}
+#
+# Author: St\'ephane Popinet
+# Command: sh spurious.sh spurious.gfs
+# Version: 0.6.4
+# Required files: spurious.sh vectors.gfv convergence.ref
+# Running time: 3 minutes
+# Generated files: laplace.eps convergence.eps vectors.eps
+#
+1 2 GfsSimulation GfsBox GfsGEdge {} {
+ Time { end = TMAX dtmax = 1e-3 }
+ Refine LEVEL
+
+ ApproxProjectionParams { tolerance = 1e-6 }
+ ProjectionParams { tolerance = 1e-6 }
+ AdvectionParams { scheme = none }
+
+ VariableTracer {} T { scheme = vof }
+ SourceTension {} U V T 1
+ SourceDiffusion {} U MU
+ SourceDiffusion {} V MU
+
+ InitFraction {} T circle.gts
+
+ OutputSimulation { start = end } sim-LEVEL {}
+
+ OutputScalarNorm { istep = 1 } stdout { v = Velocity }
+}
+GfsBox {}
+1 1 right
+1 1 top
diff --git a/test/euler/spurious/spurious.sh b/test/euler/spurious/spurious.sh
new file mode 100755
index 0000000..bce4e4b
--- /dev/null
+++ b/test/euler/spurious/spurious.sh
@@ -0,0 +1,63 @@
+if ! $donotrun; then
+ ../../poisson/shapes ellipse | transform --scale 0.8 > circle.gts
+ for La in 12000 1200 120; do
+ mu=`echo $La | awk '{print sqrt (0.4/$1)}'`
+ tmax=`echo $mu | awk '{print 1000.*$1*0.4}'`
+ if sed "s/LEVEL/5/g" < $1 |\
+ sed "s/MU/$mu/g" |\
+ sed "s/TMAX/$tmax/g" | gerris2D - | awk -v mu=$mu -v D=0.4 '{
+ print $3/(mu*D) " " $9*mu;
+ }' > La\=$La; then :
+ else
+ exit 1
+ fi
+ done
+
+ rm -f convergence
+ for level in 4 5 6; do
+ La=12000
+ mu=`echo $La | awk '{print sqrt (0.4/$1)}'`
+ tmax=`echo $mu | awk '{print 1000.*$1*0.4}'`
+ if sed "s/LEVEL/$level/g" < $1 |\
+ sed "s/MU/$mu/g" |\
+ sed "s/TMAX/$tmax/g" | gerris2D - | awk -v mu=$mu -v level=$level -v D=0.4 '{
+ max = $9
+ }END{print D*2**level " " max*mu}' >> convergence; then :
+ else
+ exit 1
+ fi
+ done
+fi
+
+if cat <<EOF | gfsview-batch2D sim-5 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'
+ plot 'La=120' w l, 'La=1200' w l, 'La=12000' w l
+ set output 'convergence.eps'
+ set xlabel 'D'
+ set ylabel 'Ca'
+ unset key
+ plot [][0:]'convergence' w lp ps 3
+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() > 1e-6:
+ exit(1)
+EOF
+else
+ exit 1
+fi
diff --git a/test/euler/merging/vorticity.gfv b/test/euler/spurious/vectors.gfv
similarity index 54%
copy from test/euler/merging/vorticity.gfv
copy to test/euler/spurious/vectors.gfv
index 475e5ac..8b226a4 100644
--- a/test/euler/merging/vorticity.gfv
+++ b/test/euler/spurious/vectors.gfv
@@ -2,26 +2,40 @@
View {
tx = 0 ty = 0
q0 = 0 q1 = 0 q2 = 0 q3 = 1
- zoom = -11.6434
+ zoom = -15
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
+} {
+ v = P
+ amin = 1
+ amax = 1
+ cmap = Jet
+} {
+ v = U
+ scale = 0.2184
+ use_scalar = 0
+}
Isoline {
r = 0 g = 0 b = 0
shading = Constant
- maxlevel = 8
+ maxlevel = 5
} {
- v = Vorticity
+ v = T
amin = 1
amax = 1
cmap = Jet
} {
- n = 17
+ n = 1
}
-Boundaries {
+Cells {
r = 0 g = 0 b = 0
shading = Constant
- maxlevel = 8
+ maxlevel = 0
}
diff --git a/test/euler/template.tex b/test/euler/template.tex
index 1aabd7f..9e97f51 100644
--- a/test/euler/template.tex
+++ b/test/euler/template.tex
@@ -38,6 +38,10 @@ current stable branch of the version-controlled source code.
\input{boundaries/boundaries.tex}
\input{channel/channel.tex}
+\section{Surface tension}
+
+\input{spurious/spurious.tex}
+
\bibliographystyle{plain}
\bibliography{tests}
diff --git a/test/euler/tests.bib b/test/euler/tests.bib
index 8ea576e..ea9380d 100644
--- a/test/euler/tests.bib
+++ b/test/euler/tests.bib
@@ -43,6 +43,15 @@
url = {http://gfs.sf.net/gerris.pdf}
}
+ at Article{popinet99,
+ author = {S. Popinet and S. Zaleski},
+ title = {A front tracking algorithm for the accurate representation of surface tension},
+ journal = {Int. J. Numer. Meth. Fluids},
+ volume = 30,
+ pages = {775-793},
+ year = 1999
+}
+
@TechReport{rider95,
author = {W. J. Rider},
title = {Approximate projection methods for incompressible flows: Implementation, variants and robustness},
diff --git a/test/tension/Makefile.am b/test/tension/Makefile.am
deleted file mode 100644
index b935c47..0000000
--- a/test/tension/Makefile.am
+++ /dev/null
@@ -1,5 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-TESTS = spurious.sh wave.sh
-
-EXTRA_DIST = $(TESTS) prosperetti
diff --git a/test/tension/spurious.sh b/test/tension/spurious.sh
deleted file mode 100755
index 4e555db..0000000
--- a/test/tension/spurious.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-if test -f circle.gts; then
- :
-else
- ../poisson/shapes ellipse | transform --scale 0.8 > circle.gts
-fi
-
-for adapt in "AdaptFunction { istep = 1 } { cmax = 0.1 maxlevel = 5 } _Tx*_Tx+_Ty*_Ty"; do
- if test "$adapt"; then
- echo "Adaptive refinement"
- else
- echo "Constant refinement"
- fi
- for La in 12000 1200 120; do
- mu=`echo $La | awk '{print sqrt (0.4/$1)}'`
- tmax=`echo $mu | awk '{print 1000.*$1*0.4}'`
- du=`echo $mu | awk '{print 1e-7/$1}'`
- cat <<EOF | gerris2D -
-1 2 GfsSimulation GfsBox GfsGEdge {} {
- Time {
- end = $tmax
- dtmax = 1e-3
- }
- ApproxProjectionParams { tolerance = 1e-6 }
- ProjectionParams { tolerance = 1e-6 }
- Refine 5
- VariableTracer {} T { scheme = vof }
- SourceTension {} U V T 1
- AdvectionParams { scheme = none }
- SourceDiffusion {} U $mu
- SourceDiffusion {} V $mu
- InitFraction {} T circle.gts
- $adapt
- EventStop { istep = 1 } U $du
- OutputScalarStats {istep = 1} spurious-$La { v = P }
- OutputScalarNorm {istep = 1} spurious-$La { v = Velocity }
- OutputScalarSum { istep = 1 } spurious-$La { v = T }
-}
-GfsBox {}
-1 1 right
-1 1 top
-EOF
- if awk -v La=$La -v mu=$mu '{if ($1 == "Velocity") {max1 = max; max = $9;}} END {
- printf ("Laplace number: %6g max(U)*mu/sigma: %g\n", La, max1*mu);
- if (max1*mu > 2.5e-3)
- exit 1;
- }' < spurious-$La; then
- :
- else
- exit 1
- fi
- done
-done
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list