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

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


The following commit has been merged in the upstream branch:
commit ce672e42bb337ad9ea5e50bf84a20574c308611e
Author: Stephane Popinet <s.popinet at niwa.co.nz>
Date:   Wed Oct 5 10:48:12 2005 +1000

    Moved lid-driven cavity example to test suite
    
    darcs-hash:20051005004812-fbd8f-ea7b7d8fd0620f6a841f8807743b6a85af71f4f7.gz

diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index c37dbdd..4759597 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -2,7 +2,6 @@
 
 EXAMPLES = \
 	cylinder \
-	lid \
 	shear \
 	rt \
 	boussinesq
diff --git a/doc/examples/template.tex b/doc/examples/template.tex
index 4feda59..01f027d 100644
--- a/doc/examples/template.tex
+++ b/doc/examples/template.tex
@@ -43,7 +43,6 @@ The usefulness and quality of this document very much depend on the contribution
 
 \input{cylinder/cylinder.tex}
 \input{cylinder/heated/heated.tex}
-\input{lid/lid.tex}
 \input{shear/shear.tex}
 \input{rt/rt.tex}
 \input{boussinesq/boussinesq.tex}
diff --git a/test/Makefile.am b/test/Makefile.am
index a9b2cba..001398d 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -12,7 +12,8 @@ TESTDIRS = \
 	spurious \
 	capwave \
 	waves \
-	geo
+	geo \
+	lid
 
 EXTRA_DIST = \
 	template.tex \
@@ -56,7 +57,7 @@ tests.tex: template.tex Makefile.deps
 	python gfs2tex $(TESTDIRS)
 	cp -f template.tex tests.tex
 
-Makefile.deps: Makefile.am depend.py
+Makefile.deps: Makefile depend.py
 	python depend.py $(TESTDIRS) > Makefile.deps
 
 -include Makefile.deps
diff --git a/test/check.py b/test/check.py
index e106665..4a6b307 100644
--- a/test/check.py
+++ b/test/check.py
@@ -6,7 +6,8 @@ class Curve:
 		line = file.readline()
 		while line:
 			record = line.split()
-			self.l.append((float(record[x-1]),float(record[y-1])))
+			if record[0] != "#":
+				self.l.append((float(record[x-1]),float(record[y-1])))
 			line = file.readline()
 	def __init__(self,f=None,x=1,y=2):
 		self.l = []
diff --git a/doc/examples/lid/lid.gfs b/test/lid/lid.gfs
similarity index 87%
rename from doc/examples/lid/lid.gfs
rename to test/lid/lid.gfs
index 2812d5b..4d9223b 100644
--- a/doc/examples/lid/lid.gfs
+++ b/test/lid/lid.gfs
@@ -18,7 +18,7 @@
 # \end{figure}
 #
 # Velocity profiles are generated automatically and compared to the
-# benchmark results of Ghia et al. (J. Comp. Phys. 1982) on
+# benchmark results of Ghia et al. \cite{ghia82} on
 # Figures \ref{xprof} and \ref{yprof}.
 #
 # \begin{figure}[htbp]
@@ -40,7 +40,7 @@
 # \end{figure}
 #
 # Author: St\'ephane Popinet
-# Command: gerris2D lid.gfs
+# Command: sh lid.sh lid.gfs
 # Version: 0.6.4
 # Required files: xprofile yprofile xprof.ghia yprof.ghia
 # Running time: 70 minutes
@@ -52,20 +52,14 @@
   # Stop the simulation at t = 300 if convergence has not been reached before
   Time { end = 300 }
 
-  # Use an initial refinement of 7 levels (i.e. 2^7=128x128)
-  Refine 7
+  # Use an initial refinement of 6 levels (i.e. 2^6=64x64)
+  Refine 6
 
   # Set a viscosity source term on the velocity vector with x-component U
   # The Reynolds number is Re = L*U/Nu = 1*1/1e-3 = 1000
   SourceDiffusion {} U 1e-3
   SourceDiffusion {} V 1e-3
 
-  # Writes the time and timestep every 10 timesteps on standard error
-  OutputTime { istep = 10 } stderr
-
-  # Writes info about the convergence of the Poisson solver on standard error
-  OutputProjectionStats { istep = 10 } stderr
-
   # Stops the simulation if the maximum of the absolute value of the
   # difference between the current U field and the U field 10 timesteps
   # before is smaller than 1e-4.
@@ -74,6 +68,8 @@
   # monitoring the convergence of the simulation).
   EventStop { istep = 10 } U 1e-4 DU
 
+  OutputScalarNorm { istep = 10 } du { v = DU }
+
   # Pipes a bitmap PPM image representation of the velocity field at the end of the simulation
   # into the ImageMagick converter "convert" to create the
   # corresponding EPS file
@@ -102,9 +98,6 @@
     plot [-0.5:0.5]'yprof.ghia' u 1:2 title "Ghia et al." w p ps 2 pt 9, 'yprof' u 2:7 w l title "Gerris"
 EOF
   }
-
-  # Outputs profiling information at the end of the simulation to standard error
-  OutputTiming { start = end } stderr
 }
 GfsBox {
 
diff --git a/test/lid/lid.sh b/test/lid/lid.sh
new file mode 100644
index 0000000..eb9132c
--- /dev/null
+++ b/test/lid/lid.sh
@@ -0,0 +1,17 @@
+if ! $donotrun; then
+    if gerris2D $1; then :
+    else
+	exit 1
+    fi
+fi
+
+if cat <<EOF | python ; then :
+from check import *
+from sys import *
+if (Curve('xprof',3,6) - Curve('xprof.ghia',1,2)).normi() > 2e-2 or \
+   (Curve('yprof',2,7) - Curve('yprof.ghia',1,2)).normi() > 1.7e-2:
+    exit(1)
+EOF
+else
+   exit 1
+fi
diff --git a/doc/examples/lid/xprof.ghia b/test/lid/xprof.ghia
similarity index 100%
rename from doc/examples/lid/xprof.ghia
rename to test/lid/xprof.ghia
diff --git a/doc/examples/lid/xprofile b/test/lid/xprofile
similarity index 100%
rename from doc/examples/lid/xprofile
rename to test/lid/xprofile
diff --git a/doc/examples/lid/yprof.ghia b/test/lid/yprof.ghia
similarity index 100%
rename from doc/examples/lid/yprof.ghia
rename to test/lid/yprof.ghia
diff --git a/doc/examples/lid/yprofile b/test/lid/yprofile
similarity index 100%
rename from doc/examples/lid/yprofile
rename to test/lid/yprofile
diff --git a/test/template.tex b/test/template.tex
index a497213..0e159e6 100644
--- a/test/template.tex
+++ b/test/template.tex
@@ -46,6 +46,10 @@ current stable branch of the version-controlled source code.
 \input{periodic/periodic.tex}
 \input{merging/merging.tex}
 
+\section{Navier-Stokes}
+
+\input{lid/lid.tex}
+
 \section{Solid boundaries}
 
 \input{boundaries/boundaries.tex}
diff --git a/test/tests.bib b/test/tests.bib
index ddc0561..56b10d6 100644
--- a/test/tests.bib
+++ b/test/tests.bib
@@ -29,6 +29,15 @@
   address =	 {Montreal}
 }
 
+ at Article{ghia82,
+  author = 	 {U. Ghia, K.N. Ghia, C.T. Shin},
+  title = 	 {High-{R}e solution for incompressible flow using the {N}avier-{S}tokes equations and the multigrid method},
+  journal = 	 {J. Comput. Phys.},
+  year = 	 1982,
+  volume =	 48,
+  pages =	 {387-411}
+}
+
 @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},

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list