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

Stephane Popinet popinet at users.sf.net
Fri May 15 02:54:29 UTC 2009


The following commit has been merged in the upstream branch:
commit 64ccfa2d4a08328898bc6101e76f63531fbc9744
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Wed Aug 22 13:25:07 2007 +1000

    New VOF advection test case with adaptive refinement
    
    darcs-hash:20070822032507-d4795-f37c97895d8ea45f7110629fb374e001bbbbfade.gz

diff --git a/test/shear/curvature/curvature.gfs b/test/shear/curvature/curvature.gfs
new file mode 100644
index 0000000..01dfaf8
--- /dev/null
+++ b/test/shear/curvature/curvature.gfs
@@ -0,0 +1,91 @@
+# Title: Time-reversed advection with curvature-based refinement
+#
+# Description:
+#
+# Same as the previous test but with adaptivity based on the local
+# curvature of the interface (with a maximum of eight levels of
+# refinement).
+#
+# \begin{figure}[htbp]
+# \caption{\label{advection}Interface shape and refined mesh at time 2.5.}
+# \begin{center}
+# \includegraphics[width=0.6\hsize]{t-2.5.eps}
+# \end{center}
+# \end{figure}
+#
+# \begin{figure}[htbp]
+# \caption{\label{error}Difference between the initial and final volume fraction fields.}
+# \begin{center}
+# \includegraphics[width=0.6\hsize]{dt-5.eps}
+# \end{center}
+# \end{figure}
+#
+# \begin{table}[htbp]
+# \caption{\label{norms}Norms of the error between the initial and final fields. The
+# reference values are given in blue.}
+# \begin{center}
+# \begin{tabular}{|c|c|c|}\hline
+# $L_1$ & $L_2$ & $L_\infty$ \\ \hline
+# \input{norms.tex}
+# \end{tabular}
+# \end{center}
+# \end{table}
+#
+# Author: St\'ephane Popinet
+# Command: sh ../shear.sh curvature.gfs | gfsview-batch2D curvature.gfv
+# Version: 1.1.0
+# Required files: ../shear.sh norms.ref curvature.gfv
+# Running time: 2 minutes
+# Generated files: t-2.5.eps dt-5.eps norms norms.tex
+#
+# The type of the simulation is GfsAdvection which only solves the advection
+# of passive tracers.
+1 0 GfsAdvection GfsBox GfsGEdge {} {
+    Time { end = 5 }
+    Refine 8
+
+    # Add tracer T, using a VOF advection scheme.
+    # The default scheme is a Van-Leer limited, second-order upwind scheme.
+    VariableTracerVOF T
+
+    # Curvature K of the interface defined by T
+    VariableCurvature K T
+
+    InitFraction T (ellipse (0, -.236338, 0.2, 0.2))
+
+    # Initialize U and V with the vortical shear flow field
+    Init {} {
+        U = sin((x + 0.5)*M_PI)*cos((y + 0.5)*M_PI)
+        V = -cos((x + 0.5)*M_PI)*sin((y + 0.5)*M_PI)
+    }
+
+    # At t = 2.5 re-initialize U and V with the reversed flow field
+    Init { start = 2.5 } { U = -U V = -V }
+    
+    # Adapt the mesh dynamically using a custom cost function returning
+    # the cell size times the local curvature (only for cells cut by
+    # the interface).
+    # The maximum cost is set to 0.1 i.e. the radius of curvature must be
+    # resolved with a least 10 cells.
+    AdaptFunction { istep = 1 } { cmax = 0.1 maxlevel = 8 minlevel = 6 } {
+        return T > 0. && T < 1. ? ftt_cell_size (cell)*fabs (K) : 0.;
+    }
+
+    OutputSimulation { start = 2.5 } stdout
+    EventScript { start = 2.5 } { echo "Save t-2.5.eps { format = EPS line_width = 0.5 }" }
+    
+    # Add a new variable 
+    Variable Tref
+
+    # Initialize Tref with the initial shape
+    InitFraction { start = end } Tref (ellipse (0, -.236338, 0.2, 0.2))
+
+    # Output the norms of the difference between T and Tref, stores that into
+    # new variable DT
+    OutputErrorNorm { start = end } norms { v = T } {
+        s = Tref v = DT
+    }
+
+    OutputPPM { start = end } { convert ppm:- dt-5.eps } { v = DT }
+}
+GfsBox {}
diff --git a/doc/examples/rt/rt.gfv b/test/shear/curvature/curvature.gfv
similarity index 70%
copy from doc/examples/rt/rt.gfv
copy to test/shear/curvature/curvature.gfv
index 4edfb6c..d4439d2 100644
--- a/doc/examples/rt/rt.gfv
+++ b/test/shear/curvature/curvature.gfv
@@ -1,21 +1,29 @@
 # GfsView 2D
 View {
-  tx = -0.0838119 ty = -0.501667
+  tx = 0 ty = 0
   sx = 1 sy = 1 sz = 1
   q0 = 0 q1 = 0 q2 = 0 q3 = 1
-  fov = 55.2206
-  r = 0.3 g = 0.4 b = 0.6
+  fov = 24.9119
+  r = 1 g = 1 b = 1
   res = 1
   lc = 0.001
   reactivity = 0.1
 }
-VOF {
+Cells {
   r = 0 g = 0 b = 0
   shading = Constant
   maxlevel = -1
 } {
   n.x = 0 n.y = 0 n.z = 1
   pos = 0
+}
+VOF {
+  r = 0.010071 g = 0 b = 1
+  shading = Constant
+  maxlevel = -1
+} {
+  n.x = 0 n.y = 0 n.z = 1
+  pos = 0
 } P {
   amin = 1
   amax = 1
@@ -23,9 +31,5 @@ VOF {
 } T {
   reversed = 0
   use_scalar = 0
-}
-Boundaries {
-  r = 0 g = 0 b = 0
-  shading = Constant
-  maxlevel = -1
+  draw_edges = 0
 }
diff --git a/test/shear/curvature/norms.ref b/test/shear/curvature/norms.ref
new file mode 100644
index 0000000..6885b00
--- /dev/null
+++ b/test/shear/curvature/norms.ref
@@ -0,0 +1 @@
+T time: 5 first:  6.864e-04 second:  7.331e-03 infty:  1.795e-01 bias: -1.071e-04
diff --git a/test/template.tex b/test/template.tex
index a9b89cd..eac3227 100644
--- a/test/template.tex
+++ b/test/template.tex
@@ -45,6 +45,7 @@ current stable branch of the version-controlled source code.
 
 \input{advection/advection.tex}
 \input{shear/shear.tex}
+\input{shear/curvature/curvature.tex}
 
 \section{Euler}
 

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list