[SCM] Gerris Flow Solver branch, upstream, updated. e8f73a07832050124d2b8bf6c6f35b33180e65a8
Stephane Popinet
popinet at users.sf.net
Tue Nov 24 12:24:41 UTC 2009
The following commit has been merged in the upstream branch:
commit 5fdc0d531618a954902f50ce7ee337999b27639e
Author: Stephane Popinet <popinet at users.sf.net>
Date: Tue Jul 21 09:59:16 2009 +1000
Moving cylinder test case
darcs-hash:20090720235916-d4795-d8b984b399b9f81da6531d03a15e551fc8cabd7e.gz
diff --git a/test/Makefile.am b/test/Makefile.am
index 2f68c9c..3b7dbce 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -20,6 +20,7 @@ TESTDIRS = \
channel \
plate \
hexagon \
+ strouhal \
spurious \
capwave \
oscillation \
diff --git a/test/strouhal/moving.ref b/test/strouhal/moving.ref
new file mode 100644
index 0000000..8eb866c
--- /dev/null
+++ b/test/strouhal/moving.ref
@@ -0,0 +1,7 @@
+#Re period Fx
+200 0.604 0.0947364
+250 0.584 0.0952446
+300 0.569 0.0960957
+350 0.559 0.0974551
+450 0.545 0.0991125
+500 0.539 0.100031
\ No newline at end of file
diff --git a/test/strouhal/static.ref b/test/strouhal/static.ref
new file mode 100644
index 0000000..f04ce0b
--- /dev/null
+++ b/test/strouhal/static.ref
@@ -0,0 +1,8 @@
+#Re Period(s) Fx Pressure force along X(3-5), Y(6-9) Viscous force along X(10-12), Y(13-15) Average, Min, Max
+200 0.599 0.0939684
+250 0.580 0.0952884 0.0835 0.078 0.089 0. -0.060 0.060 0.01540 0.0151 0.0157 0 -0.0051 0.0051 -1
+300 0.566 0.0971142 0.079 0.093 0. -0.067 0.067 0.01405 0.0137 0.0144 0 -0.0051 0.0051 0.203
+350 0.558 0.0981471 0.079 0.097 0. -0.073 0.073 0.01300 0.0126 0.0134 0 -0.00495 0.00495 -1
+400 0.548 0.0993875 0.0895 0.080 0.099 0. -0.077 0.077 0.01210 0.0117 0.0125 0 -0.0048 0.0048 0.205
+450 0.541 0.10055 0.0915 0.081 0.102 0. -0.082 0.082 0.01140 0.0110 0.0118 0 -0.00457 0.00457 -1
+500 0.536 0.101417
\ No newline at end of file
diff --git a/test/strouhal/strouhal.gfs b/test/strouhal/strouhal.gfs
new file mode 100644
index 0000000..bb82881
--- /dev/null
+++ b/test/strouhal/strouhal.gfs
@@ -0,0 +1,80 @@
+# Title: B\'enard--von K\'arm\'an vortex street behind a cylinder translating in a fluid at rest
+#
+# Description:
+#
+# An example of 2D viscous flow around a simple solid boundary. A solid
+# cylinder is impulsively started at the right of a channel bounded by
+# solid walls with a slip boundary condition.
+#
+# Adaptive refinement is used based on the vorticity.
+#
+# After an initial growth phase, a classical B\'enard--von K\'arman
+# vortex street is formed.
+#
+# \begin{figure}[htbp]
+# \caption{\label{vorticity} Vorticity field.}
+# \begin{center}
+# \includegraphics[width=\hsize]{vort.eps}
+# \end{center}
+# \end{figure}
+#
+# \begin{figure}[htbp]
+# \caption{\label{Forces} Evolution of the drag and lift coefficients
+# for a Reynolds number of 400.}
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{forces.eps}
+# \end{center}
+# \end{figure}
+#
+# \begin{figure}[htbp]
+# \caption{\label{Strouhal} Strouhal number versus Reynolds
+# number. Comparison between static (reference) and moving problem.}
+# \begin{center}
+# \includegraphics[width=0.8\hsize]{strouhal.eps}
+# \end{center}
+# \end{figure}
+#
+# Author: S\'ebastien Delaux
+# Command: sh strouhal.sh
+# Version: 090512
+# Required files: strouhal.sh strouhal.gfv strouhal.ref moving.ref static.ref
+# Generated files: strouhal.eps vort.eps forces.eps
+#
+1 0 GfsSimulationMoving GfsBox GfsGEdge {} {
+ Time { end = 0.8 }
+ Refine {
+ if (fabs(y) < 0.02 && x > 0.38 && x < 0.42)
+ return 11;
+ if (fabs(y) < 0.35 && x > 0.3 && x < 0.5)
+ return 8;
+ return 5;
+ }
+
+ SolidMoving { istep = 1 } cylinder.gts { tx = 0.4 scale = 0.025 } { level = 11 }
+
+ # Set the boundary condition on the solid object.
+ # The velocity is imposed
+ SurfaceBc U Dirichlet -1.
+
+ # Adapt the mesh using the vorticity criterion at every timestep
+ AdaptVorticity { istep = 1 } { maxlevel = (x > 0.5 - t ? 9 : 10) cmax = 1e-2 }
+
+ SourceViscosity 3.125e-5 { beta = 1}
+
+ OutputSimulation { start = end } end.gfs
+ OutputSolidForce { istep = 1 } forces.dat
+
+ EventScript { start = end } {
+ cat <<EOF | gnuplot 2>&1 | awk '{if ($1 == "400") print $0;}'
+ f(x)= a*cos(b*(x+c))
+ a = 0.00525
+ b = 110.49
+ c = 0.611
+ fit [0.5:] f(x) 'forces.dat' u 1:6 via a,b,c
+ print "400 ", b/(2*3.14159)*0.0125
+EOF
+ }
+}
+GfsBox {
+ right = BoundaryOutflow
+}
diff --git a/doc/examples/tides/tides.gfv b/test/strouhal/strouhal.gfv
similarity index 66%
copy from doc/examples/tides/tides.gfv
copy to test/strouhal/strouhal.gfv
index 70e0398..2e05cfa 100644
--- a/doc/examples/tides/tides.gfv
+++ b/test/strouhal/strouhal.gfv
@@ -1,24 +1,24 @@
-# GfsView 3D
+# GfsView 2D
View {
- tx = 0 ty = 0
+ tx = 0.297313 ty = 0.00131029
sx = 1 sy = 1 sz = 1
q0 = 0 q1 = 0 q2 = 0 q3 = 1
- fov = 19.1745
+ fov = 1.73964
r = 0.3 g = 0.4 b = 0.6
res = 1
lc = 0.001
reactivity = 0.1
}
Linear {
- r = 0 g = 0 b = 0
+ r = 1 g = 1 b = 1
shading = Constant
maxlevel = -1
} {
n.x = 0 n.y = 0 n.z = 1
pos = 0
-} P/9.81 {
- amin = 1
- amax = 1
+} Vorticity {
+ amin = 0 min = -300
+ amax = 0 max = 300
cmap = Jet
} 0 {
reversed = 0
diff --git a/test/strouhal/strouhal.ref b/test/strouhal/strouhal.ref
new file mode 100644
index 0000000..4e6c22b
--- /dev/null
+++ b/test/strouhal/strouhal.ref
@@ -0,0 +1 @@
+400 0.228
\ No newline at end of file
diff --git a/test/strouhal/strouhal.sh b/test/strouhal/strouhal.sh
new file mode 100644
index 0000000..1d81511
--- /dev/null
+++ b/test/strouhal/strouhal.sh
@@ -0,0 +1,54 @@
+if ! $donotrun; then
+ shapes ellipse > cylinder.gts
+ if gerris2D strouhal.gfs > strouhal.res; then :
+ else
+ exit 1
+ fi
+fi
+
+if echo "Save stdout { width = 800 height = 200 }" | \
+ gfsview-batch2D end.gfs strouhal.gfv | \
+ convert -colors 256 ppm:- vort.eps; then :
+else
+ exit 1
+fi
+
+if cat <<EOF | gnuplot ;then :
+ set term pos enhanced eps solid color lw 2
+ set out 'forces.eps'
+ set xl "Time"
+ set yl "Cd/Cl"
+ set yr [-1.25:2.1]
+ set xr [0:112]
+ plot 'forces.dat' u (\$1/0.00625):((\$2+\$5)/0.00625) w l t 'Gerris Moving - Cd',\
+ 'forces.dat' u (\$1/0.00625):((\$3+\$6)/0.00625) w l t 'Gerris Moving - Cl'
+
+EOF
+else
+ exit 1
+fi
+
+if cat <<EOF | gnuplot ;then :
+ set term pos enhanced eps solid color lw 2
+ set out 'strouhal.eps'
+ set xl "Reynolds number"
+ set yl "St"
+ set yr [0.2:0.24]
+ set xr [180:520]
+ plot 'static.ref' u 1:(0.125/\$2) w l t "Gerris Static",\
+ 'moving.ref' u 1:(0.125/\$2) pt 5 t "Gerris Moving",\
+ 'strouhal.res' pt 5 lc 2 t " "
+EOF
+else
+ exit 1
+fi
+
+if cat <<EOF | python ; then :
+from check import *
+from sys import *
+if (Curve('strouhal.res',1,2) - Curve('strouhal.ref',1,2)).max() > 0.01 :
+ exit(1)
+EOF
+else
+ exit 1
+fi
diff --git a/test/template.tex b/test/template.tex
index 2d68fb6..d447a6d 100644
--- a/test/template.tex
+++ b/test/template.tex
@@ -84,6 +84,7 @@ branch only.
\section{Moving solid boundaries}
\input{hexagon/hexagon.tex}
+\input{strouhal/strouhal.tex}
\section{Surface tension}
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list