[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:56:03 UTC 2009
The following commit has been merged in the upstream branch:
commit 7f54c388e00e737da65eb1b4f0e5f308cab8c280
Author: Stephane Popinet <popinet at users.sf.net>
Date: Fri Jan 9 14:54:59 2009 +1100
New dam break example
darcs-hash:20090109035459-d4795-d7e2b1fa9dafbfe69a9c91fdbf541c2603273a58.gz
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index 3bf1553..dc63ac0 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -8,7 +8,8 @@ EXAMPLES = \
logo \
tides \
ship \
- garden
+ garden \
+ dam
EXTRA_DIST = \
template.tex \
diff --git a/doc/examples/dam/dam.gfs b/doc/examples/dam/dam.gfs
new file mode 100644
index 0000000..0f5e664
--- /dev/null
+++ b/doc/examples/dam/dam.gfs
@@ -0,0 +1,87 @@
+# Title: Dam break on complex topography
+#
+# Description:
+#
+# An example similar to that
+# \htmladdnormallinkfoot{presented}{http://www.amath.washington.edu/~rjl/catalina/leveque1.pdf}
+# by Randall J. LeVeque illustrating the solution of the
+# \htmladdnormallinkfoot{Saint-Venant}{http://en.wikipedia.org/wiki/Shallow\_water\_equations}
+# (or shallow-water) equations with complex topography, wetting and
+# drying, shocks and hydrostatic equilibrium.
+#
+# \begin{figure}[htbp]
+# \caption{Topography (red) and animation of the water level (blue).}
+# \begin{rawhtml}
+# <DIV CLASS="center">
+# <IMG SRC="dam/dam.gif">
+# </DIV>
+# \end{rawhtml}
+# \end{figure}
+#
+# Author: St\'ephane Popinet
+# Command: gerris2D dam.gfs
+# Version: 1.3.1
+# Required files: dam.plot
+# Running time: 2 minutes
+# Generated files: dam.gif
+#
+# Use the GfsRiver Saint-Venant solver
+1 0 GfsRiver GfsBox GfsGEdge {} {
+ PhysicalParams { L = 8. }
+ RefineSolid 9
+
+ # Set a solid boundary close to the top boundary to limit the
+ # domain width to one cell (i.e. a 1D domain)
+ Solid (y/8. + 1./pow(2,9) - 1e-6 - 0.5)
+
+ # Set the topography Zb and the initial water surface elevation P
+ Init {} {
+ Zb = x*x/8.+cos(M_PI*x)/2.
+ P = {
+ double p = x > 0. ? 0.35 : x < -2. ? 1.9 : -1.;
+ return MAX (0., p - Zb);
+ }
+ }
+ PhysicalParams { g = 1. }
+
+ # Use a first-order scheme rather than the default second-order
+ # minmod limiter. This is just to add some numerical damping.
+ AdvectionParams {
+ # gradient = gfs_center_minmod_gradient
+ gradient = none
+ }
+
+ Time { end = 40 }
+ OutputProgress { istep = 10 } stderr
+ OutputScalarSum { istep = 10 } ke { v = (P > 0. ? U*U/P : 0.) }
+ OutputScalarSum { istep = 10 } vol { v = P }
+ OutputScalarNorm { istep = 10 } u { v = (P > 0. ? U/P : 0.) }
+
+ # Save a text-formatted simulation
+ OutputSimulation { step = 0.5 } sim-%g.txt { format = text }
+
+ # Use gnuplot to create gif images
+ EventScript { step = 0.5 } {
+ time=`echo $GfsTime | awk '{printf("%4.1f\n", $1);}'`
+ cat <<EOF | gnuplot
+load 'dam.plot'
+set title "t = $time"
+set term postscript eps color 14
+set output "sim.eps"
+plot [-4.:4.]'sim-$GfsTime.txt' u 1:8:(\$4+\$8) w filledcu lc 3, 'sim-0.txt' u 1:8 w l lw 4 lc 1 lt 1
+EOF
+ time=`echo $GfsTime | awk '{printf("%04.1f\n", $1);}'`
+ convert -density 300 sim.eps -trim +repage -bordercolor white -border 10 -resize 640x282! sim-$time.gif
+ rm -f sim.eps
+ }
+
+ # Combine all the gif images into a gif animation using gifsicle
+ EventScript { start = end } {
+ gifsicle --colors 256 --optimize --delay 25 --loopcount=0 sim-*.gif > dam.gif
+ rm -f sim-*.gif sim-*.txt
+ }
+}
+GfsBox {
+ left = Boundary
+ right = Boundary
+}
diff --git a/doc/examples/dam/dam.plot b/doc/examples/dam/dam.plot
new file mode 100755
index 0000000..ab043dc
--- /dev/null
+++ b/doc/examples/dam/dam.plot
@@ -0,0 +1,146 @@
+#!/usr/local/bin/gnuplot -persist
+#
+#
+# G N U P L O T
+# Version 4.2 patchlevel 2
+# last modified 31 Aug 2007
+# System: Linux 2.6.22-16-386
+#
+# Copyright (C) 1986 - 1993, 1998, 2004, 2007
+# Thomas Williams, Colin Kelley and many others
+#
+# Type `help` to access the on-line reference manual.
+# The gnuplot FAQ is available from http://www.gnuplot.info/faq/
+#
+# Send bug reports and suggestions to <http://sourceforge.net/projects/gnuplot>
+#
+# set terminal x11
+# set output
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000
+set border 31 front linetype -1 linewidth 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill empty border
+set style rectangle back fc lt -3 fillstyle solid 1.00 border -1
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+unset key
+unset label
+unset arrow
+set style increment default
+unset style line
+unset style arrow
+set style histogram clustered gap 2 title offset character 0, 0, 0
+unset logscale
+set offsets 0, 0, 0, 0
+set pointsize 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio -1 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis linetype -2 linewidth 1.000
+set yzeroaxis linetype -2 linewidth 1.000
+set zzeroaxis linetype -2 linewidth 1.000
+set x2zeroaxis linetype -2 linewidth 1.000
+set y2zeroaxis linetype -2 linewidth 1.000
+set ticslevel 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0
+set xtics autofreq
+set ytics border in scale 1,0.5 mirror norotate offset character 0, 0, 0
+set ytics autofreq
+set ztics border in scale 1,0.5 nomirror norotate offset character 0, 0, 0
+set ztics autofreq
+set nox2tics
+set noy2tics
+set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0
+set cbtics autofreq
+set title ""
+set title offset character 0, 0, 0 font "" norotate
+set timestamp bottom
+set timestamp ""
+set timestamp offset character 0, 0, 0 font "" norotate
+set rrange [ * : * ] noreverse nowriteback # (currently [0.00000:10.0000] )
+set trange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] )
+set urange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] )
+set vrange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] )
+set xlabel "x"
+set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set x2label ""
+set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set xrange [ * : * ] noreverse nowriteback # (currently [-2.77390:0.697413] )
+set x2range [ * : * ] noreverse nowriteback # (currently [-2.77390:0.697413] )
+set ylabel "z"
+set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set y2label ""
+set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by 90
+set yrange [ * : * ] noreverse nowriteback # (currently [-1.40832:2.01706] )
+set y2range [ * : * ] noreverse nowriteback # (currently [-1.25079:2.02955] )
+set zlabel ""
+set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] )
+set cblabel ""
+set cblabel offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set cbrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] )
+set zero 1e-08
+set lmargin -1
+set bmargin -1
+set rmargin -1
+set tmargin -1
+set locale "C"
+set pm3d explicit at s
+set pm3d scansautomatic
+set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 bdefault
+set loadpath
+set fontpath
+set fit noerrorvariables
+# GNUTERM = "x11"
+# plot [-4.:4.]'sim-9.txt' u 1:8:($4+$8) w filledcu lc 3, 'sim-0.txt' u 1:8 w l lw 2 lc 1
+# EOF
diff --git a/doc/examples/template.tex b/doc/examples/template.tex
index 4b18d68..4879e5b 100644
--- a/doc/examples/template.tex
+++ b/doc/examples/template.tex
@@ -60,6 +60,10 @@ The usefulness and quality of this document very much depend on the contribution
\input{tides/tides.tex}
+\section{Non-linear shallow-water}
+
+\input{dam/dam.tex}
+
\section{Waves}
\input{garden/garden.tex}
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list