[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:55:06 UTC 2009
The following commit has been merged in the upstream branch:
commit 7b38f08fdb8b8f1970d03458f5d939742e0b6a4c
Author: Stephane Popinet <popinet at users.sf.net>
Date: Wed Mar 12 13:41:31 2008 +1100
Series 60 ship waves example
darcs-hash:20080312024131-d4795-cf5980d5948cc7a1d612ea8d8cd541707dfb7128.gz
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index 528357a..db77c2c 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -6,7 +6,8 @@ EXAMPLES = \
boussinesq \
tangaroa \
logo \
- tides
+ tides \
+ ship
EXTRA_DIST = \
template.tex \
diff --git a/doc/examples/ship/closeup.gfv b/doc/examples/ship/closeup.gfv
new file mode 100644
index 0000000..979e713
--- /dev/null
+++ b/doc/examples/ship/closeup.gfv
@@ -0,0 +1,50 @@
+# GfsView 3D
+View {
+ tx = 0.602996 ty = 0.0177882
+ sx = 1 sy = 1 sz = 3
+ q0 = 0.295761 q1 = -0.442959 q2 = -0.745831 q3 = 0.400062
+ fov = 4.00361
+ r = 0.3 g = 0.4 b = 0.6
+ res = 1
+ lc = 0.001
+ reactivity = 0.1
+}
+VOF {
+ r = 1 g = 1 b = 1
+ shading = Constant
+ maxlevel = -1
+} {
+ n.x = 0 n.y = 0 n.z = 1
+ pos = 0
+} Z {
+ amin = 0 min = -0.005
+ amax = 0 max = 0.005
+ cmap = Jet
+} T {
+ reversed = 0
+ use_scalar = 1
+ draw_edges = 0
+}
+Solid {
+ r = 1 g = 1 b = 1
+ shading = Constant
+ maxlevel = -1
+} {
+ n.x = 0 n.y = 0 n.z = 1
+ pos = 0
+} Velocity {
+ amin = 1
+ amax = 1
+ cmap = Jet
+} {
+ reversed = 0
+ use_scalar = 0
+}
+Symmetry {
+ r = 0 g = 0 b = 0
+ shading = Constant
+ maxlevel = -1
+} {
+ n.x = 0 n.y = 1 n.z = 0
+ pos = 0.5
+}
diff --git a/test/shear/curvature/curvature.gfv b/doc/examples/ship/comparison.gfv
similarity index 58%
copy from test/shear/curvature/curvature.gfv
copy to doc/examples/ship/comparison.gfv
index d4439d2..7fe0f51 100644
--- a/test/shear/curvature/curvature.gfv
+++ b/doc/examples/ship/comparison.gfv
@@ -1,35 +1,42 @@
-# GfsView 2D
+# GfsView 3D
View {
- tx = 0 ty = 0
- sx = 1 sy = 1 sz = 1
+ tx = -0.373912 ty = -0.501871
+ sx = 1 sy = 1 sz = 3
q0 = 0 q1 = 0 q2 = 0 q3 = 1
- fov = 24.9119
+ fov = 5.77964
r = 1 g = 1 b = 1
res = 1
lc = 0.001
reactivity = 0.1
}
-Cells {
- r = 0 g = 0 b = 0
+VOF {
+ r = 1 g = 1 b = 1
shading = Constant
maxlevel = -1
} {
n.x = 0 n.y = 0 n.z = 1
pos = 0
+} Z {
+ amin = 0 min = -0.005
+ amax = 0 max = 0.005
+ cmap = Jet
+} T {
+ reversed = 0
+ use_scalar = 1
+ draw_edges = 0
}
-VOF {
- r = 0.010071 g = 0 b = 1
+Solid {
+ r = 1 g = 1 b = 1
shading = Constant
maxlevel = -1
} {
n.x = 0 n.y = 0 n.z = 1
pos = 0
-} P {
+} Velocity {
amin = 1
amax = 1
cmap = Jet
-} T {
+} {
reversed = 0
use_scalar = 0
- draw_edges = 0
}
diff --git a/test/shear/curvature/curvature.gfv b/doc/examples/ship/front.gfv
similarity index 52%
copy from test/shear/curvature/curvature.gfv
copy to doc/examples/ship/front.gfv
index d4439d2..c5095c9 100644
--- a/test/shear/curvature/curvature.gfv
+++ b/doc/examples/ship/front.gfv
@@ -1,35 +1,50 @@
-# GfsView 2D
+# GfsView 3D
View {
- tx = 0 ty = 0
- sx = 1 sy = 1 sz = 1
+ tx = -0.692077 ty = -0.492648
+ sx = 1 sy = 1 sz = 3
q0 = 0 q1 = 0 q2 = 0 q3 = 1
- fov = 24.9119
+ fov = 10.2648
r = 1 g = 1 b = 1
res = 1
lc = 0.001
reactivity = 0.1
}
-Cells {
- r = 0 g = 0 b = 0
+VOF {
+ r = 1 g = 1 b = 1
shading = Constant
maxlevel = -1
} {
n.x = 0 n.y = 0 n.z = 1
pos = 0
+} Z {
+ amin = 0 min = -0.005
+ amax = 0 max = 0.005
+ cmap = Jet
+} T {
+ reversed = 0
+ use_scalar = 1
+ draw_edges = 0
}
-VOF {
- r = 0.010071 g = 0 b = 1
+Solid {
+ r = 1 g = 1 b = 1
shading = Constant
maxlevel = -1
} {
n.x = 0 n.y = 0 n.z = 1
pos = 0
-} P {
+} Velocity {
amin = 1
amax = 1
cmap = Jet
-} T {
+} {
reversed = 0
use_scalar = 0
- draw_edges = 0
+}
+Symmetry {
+ r = 0 g = 0 b = 0
+ shading = Constant
+ maxlevel = -1
+} {
+ n.x = 0 n.y = 1 n.z = 0
+ pos = 0.5
}
diff --git a/doc/examples/ship/ship.gfs b/doc/examples/ship/ship.gfs
new file mode 100644
index 0000000..43fa8d4
--- /dev/null
+++ b/doc/examples/ship/ship.gfs
@@ -0,0 +1,213 @@
+# Title: Air-water flow around a Series 60 cargo ship
+#
+# Description:
+#
+# The geometrical Volume-Of-Fluid (VOF) advection scheme of Gerris is
+# used to simulate the air-water interface around a ``Series 60 CB=0.6''
+# ship hull. This hull shape is a classical towing tank test case and
+# several experimental dataset are available (see for example the
+# \htmladdnormallinkfoot{University
+# of Iowa web site}{http://www.iihr.uiowa.edu/\~{}shiphydro/efd\_vdata\_S60\_steady.htm}).
+#
+# The liquid is started impulsively from rest to a Froude number of
+# 0.316 corresponding to one of the towing tank cases. The evolution
+# of the interface is illustrated in Figures \ref{closeup} and
+# \ref{front}. After the initial transients have dissipated (Figure
+# \ref{f}), the stationary wave pattern can be compared with the
+# experimental measurements (Figure \ref{comparison}). Adaptivity is
+# used based on the value of vorticity in the liquid only. With the
+# relatively high-resolution used here, damping of the final wave
+# pattern is minimal which illustrates the good energy conservation
+# properties of the overall scheme (but requires a significant amount
+# of CPU time).
+#
+# Only one half of the flow is simulated. The GfsView parameter file
+# {\tt closeup.gfv} shows how to setup the ``Symmetry'' objects
+# to display the full symmetrical flow.
+#
+# \begin{figure}[htbp]
+# \caption{\label{closeup}MPEG movie of the interface
+# evolution. The interface is coloured according to elevation. The
+# vertical scale is exagerated by a factor of three.}
+# \begin{center}
+# \htmladdnormallinkfoot{\includegraphics[width=0.8\hsize]{closeup.eps}}{closeup.mpg}
+# \end{center}
+# \end{figure}
+#
+# \begin{figure}[htbp]
+# \caption{\label{front}Interface elevation in stationary regime.}
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{front.eps}
+# \end{center}
+# \end{figure}
+#
+# \begin{figure}[htbp]
+# \caption{\label{f}Pressure drag and lift forces on the hull as
+# functions of time.}
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{f.eps}
+# \end{center}
+# \end{figure}
+#
+# \begin{figure}[htbp]
+# \caption{\label{comparison}Interface elevation measured in a towing
+# tank (top-half, University of Iowa dataset) and simulation result
+# (bottom-half). The wave reflection in the experimental data is
+# caused by the lateral wall of the towing tank.}
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{comparison.eps}
+# \end{center}
+# \end{figure}
+#
+# Author: St\'ephane Popinet
+# Command: gerris3D ship.gfs | gfsview-batch3D closeup.gfv | ppm2mpeg -s 640x480 > closeup.mpg
+# Version: 1.2.0
+# Required files: S60-scaled.gts closeup.gfv front.gfv comparison.gfv tank-data.png
+# Running time: 4 days
+# Generated files: closeup.mpg closeup.eps front.eps f.eps comparison.eps
+#
+# Random notes:
+# waveprofile generation:
+# % zcat sim-8.gfs.gz | gfs2oogl3D -c Z -g -o -i | awk '{ if ($4 < 1000) print $1*3.,$2*3.,$3*3.,$4*3.;}' > waveprofile-8
+# Static wetted area for S60-scaled.gts: As = 0.0190254
+#
+3 2 GfsSimulation GfsBox GfsGEdge {} {
+
+ # The wave drag on the hull has strong starting transients,
+ # also the mean wave field takes a relatively long time to
+ # establish.
+ Time { end = 10 }
+
+ # Nine levels is enough to get good agreement with towing tank
+ # data. Adding more levels will reveal finer-scale wave patterns
+ # (but the runs will take even longer...)
+ Global {
+ #define LEVEL 9
+ #define FROUDE 0.316
+ #define RATIO (1.2/1000.)
+ #define VAR(T,min,max) (min + CLAMP(T,0,1)*(max - min))
+ }
+
+ # Translate the model to simulate only half the domain
+ Solid S60-scaled.gts { ty = 0.5 }
+
+ # Refine the hull to LEVEL
+ RefineSolid LEVEL
+ # Refine the water surface to four levels
+ RefineSurface { return 4; } (1e-4 - z)
+
+ VariableTracerVOF T
+ # For high-density ratios we cannot use the volume fraction field
+ # directly to define the density. We need a smoother version.
+ VariableFiltered T1 T 1
+
+ Init {} { U = FROUDE }
+ # Initialise the water surface at z = 1e-4
+ InitFraction T (1e-4 - z)
+
+ # air/water density ratio
+ PhysicalParams { alpha = 1./VAR(T1,RATIO,1.) }
+
+ # Use the reduced gravity approach
+ VariablePosition Z T z
+ # g = 3, g' = 3*(rho1 - rho2)
+ SourceTension T -3.*(1. - RATIO) Z
+
+ # Force the horizontal component of the velocity to relax to
+ # 'FROUDE' (= 0.316) in a band on inflow (x <= -0.375)
+ Source U (x > -0.375 ? 0 : 10.*(FROUDE - U))
+
+ # Adapt the mesh using the vorticity criterion but only in the
+ # water side (T > 0.)
+ # The 'cmax' value can be lowered (e.g. to 1e-2) to increase
+ # the accuracy with which the weaker far-field waves are resolved.
+ AdaptFunction { istep = 1 } {
+ cmax = 1e-2
+ # Faster coarsening than with the default cfactor of 4 reduces
+ # the size of the simulation
+# cfactor = 2
+ # Coarse 'sponge' for x >= 1.5
+ maxlevel = (x < 1.5 ? LEVEL : 4)
+ minlevel = 4
+ } {
+ return (T > 0.)*fabs (Vorticity)*ftt_cell_size (cell)/FROUDE;
+ }
+
+ # Pressure (i.e. wave drag) force on the hull
+ OutputSolidForce { istart = 1 istep = 1 } f
+
+ OutputTime { istep = 1 } stderr
+ OutputBalance { istep = 1 } stderr
+ OutputProjectionStats { istep = 1 } stderr
+ OutputTiming { istep = 10 } stderr
+
+ # Generation of animations
+ OutputSimulation { istep = 5 end = 4 } stdout
+ EventScript { istep = 5 end = 4 } { echo "Save stdout { width = 1600 height = 1200 }" }
+
+ OutputSimulation { start = 1 step = 1 } sim-%g.gfs
+ # Compresses the saved simulation files
+ EventScript { start = 1 step = 1 } { gzip -f -q sim-*.gfs }
+
+ # Graphics
+ EventScript { start = 10 } {
+ echo "Save stdout { width = 1600 height = 1200 }" | \
+ gfsview-batch3D sim-10.gfs.gz closeup.gfv | \
+ convert -colors 256 ppm:- closeup.eps
+
+ echo "Save stdout { width = 1600 height = 1200 }" | \
+ gfsview-batch3D sim-10.gfs.gz front.gfv | \
+ convert -colors 256 ppm:- front.eps
+
+ echo "Save stdout { width = 800 height = 600 }" | \
+ gfsview-batch3D sim-10.gfs.gz comparison.gfv | \
+ convert -trim ppm:- comparison.ppm
+
+# echo "Save stdout { width = 800 height = 600 }" | \
+# gfsview-batch3D sim-10.gfs.gz tank-data.gfv | \
+# convert -trim -flip ppm:- tank-data.png
+
+ convert tank-data.png tank-data.ppm
+ montage -geometry +0+0 -tile 1x2 tank-data.ppm comparison.ppm png:- | \
+ convert -colors 256 png:- comparison.eps
+
+ cat <<EOF | gnuplot
+ set term postscript eps lw 3 solid 20 colour
+ set output 'f.eps'
+ set xlabel 'Time'
+ set ylabel 'Force'
+ plot 'f' u 1:(\$2*2.) every 10 w l t 'Drag', 'f' every 10 u 1:(\$4*2.) w l t 'Lift'
+EOF
+ }
+}
+# Impose symmetry conditions on top and bottom boundaries
+# and inflow/outflow conditions on the left and right boundaries
+# (so that emitted gravity waves can leave the domain cleanly)
+GfsBox {
+ left = Boundary {
+ BcDirichlet P 0
+ BcDirichlet V 0
+ BcDirichlet W 0
+ BcNeumann U 0
+ BcNeumann T 0
+ }
+ top = Boundary
+ bottom = Boundary
+}
+GfsBox {
+ top = Boundary
+ bottom = Boundary
+}
+GfsBox {
+ right = Boundary {
+ BcDirichlet P 0
+ BcDirichlet V 0
+ BcDirichlet W 0
+ BcNeumann U 0
+ BcNeumann T 0
+ }
+ top = Boundary
+ bottom = Boundary
+}
+1 2 right
+2 3 right
diff --git a/doc/examples/ship/tank-data.png b/doc/examples/ship/tank-data.png
new file mode 100644
index 0000000..c280857
Binary files /dev/null and b/doc/examples/ship/tank-data.png differ
diff --git a/doc/examples/template.tex b/doc/examples/template.tex
index d5e7642..8053f13 100644
--- a/doc/examples/template.tex
+++ b/doc/examples/template.tex
@@ -54,6 +54,7 @@ The usefulness and quality of this document very much depend on the contribution
\section{3D}
\input{tangaroa/tangaroa.tex}
+\input{ship/ship.tex}
\section{Shallow-water}
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list