# Title: B\'enard--von K\'arm\'an Vortex Street for flow around a cylinder at Re=160
#
# Description:
#
# An example of 2D viscous flow around a simple solid boundary. Fluid
# is injected to the left of a channel bounded by solid walls with a
# slip boundary condition. A passive tracer is injected in the bottom
# half of the inlet.
#
# Adaptive refinement is used based on both the vorticity and the
# gradient of the passive tracer.
#
# After an initial growth phase, a classical B\'enard--von K\'arman
# vortex street is formed.
#
# The results are visualised using MPEG movies of the vorticity
# (Figure \ref{vorticity}) and tracer concentration (Figure
# \ref{tracer}) generated on-the-fly.
#
# \begin{figure}[htbp]
# \caption{\label{vorticity}MPEG movie of the vorticity field.}
# \begin{center}
# \htmladdnormallinkfoot{\includegraphics[width=\hsize]{vort.eps}}{vort.mpg}
# \end{center}
# \end{figure}
#
# \begin{figure}[htbp]
# \caption{\label{tracer}MPEG movie of the tracer field.}
# \begin{center}
# \htmladdnormallinkfoot{\includegraphics[width=\hsize]{t.eps}}{t.mpg}
# \end{center}
# \end{figure}
#
# Author: St\'ephane Popinet
# Command: gerris2D cylinder.gfs
# Version: 1.1.0
# Required files:
# Running time: 32 minutes
# Generated files: t.mpg vort.mpg t.eps vort.eps
#
# The simulation domain has 8 GfsBox linked by 7 GfsGEdge
8 7 GfsSimulation GfsBox GfsGEdge {} {
# Stop the simulation at t = 15
Time { end = 15 }
# Use an initial refinement of 6 levels (i.e. 2^6=64x64 for each box)
Refine 6
# Insert the solid boundary defined as x*x + y*y - 0.0625*0.0625 = 0
# (i.e. a cylinder of radius 0.0625 centered on the origin)
Solid (x*x + y*y - 0.0625*0.0625)
# Add a passive tracer called T
VariableTracer {} T
# Set the initial x-component of the velocity to 1
Init {} { U = 1 }
# Adapt the mesh using the vorticity criterion at every timestep
# down to a maximum level of 6 and with a maximum tolerance of 1e-2
AdaptVorticity { istep = 1 } { maxlevel = 6 cmax = 1e-2 }
# Adapt the mesh using the gradient criterion on variable T at
# every timestep, down to a maximum level of 6 and with a maximum tolerance of 1e-2
AdaptGradient { istep = 1 } { maxlevel = 6 cmax = 1e-2 } T
# Set a viscosity source term on the velocity vector with x-component U
# The Reynolds number is Re = D*U/Nu = 0.125*1/0.00078125 = 160
# where D is the cylinder diameter (as defined in cylinder.gts)
SourceDiffusion {} U 0.00078125
SourceDiffusion {} V 0.00078125
# Writes the time and timestep every 10 timesteps on standard error
OutputTime { istep = 10 } stderr
# Writes the simulation size every 10 timesteps on standard error
OutputBalance { istep = 10 } stderr
# Writes info about the convergence of the Poisson solver on standard error
OutputProjectionStats { istep = 10 } stderr
# Pipes a bitmap PPM image representation of the vorticity field at every other timestep
# into a conversion pipeline to create a MPEG movie called vort.mpg
# Sets the minimum used for colormapping to -10 and the maximum to 10
OutputPPM { istep = 2 } { ppm2mpeg > vort.mpg } {
min = -10 max = 10 v = Vorticity
}
# Pipes a bitmap PPM image representation of the T field at every other timestep
# into a MJPEGTools conversion pipeline to create a MPEG movie called t.mpg
# Sets the minimum used for colormapping to 0 and the maximum to 1
OutputPPM { istep = 2 } { ppm2mpeg > t.mpg } {
min = 0 max = 1 v = T
}
# Pipes a bitmap PPM image representation of the vorticity field at time 15
# into the ImageMagick converter "convert" to create the corresponding EPS file
OutputPPM { start = 15 } { convert -colors 256 ppm:- vort.eps } {
min = -10 max = 10 v = Vorticity
}
# Pipes a bitmap PPM image representation of the T field at time 15
# into the ImageMagick converter "convert" to create the corresponding EPS file
OutputPPM { start = 15 } { convert -colors 256 ppm:- t.eps } {
min = 0 max = 1 v = T
}
# Outputs profiling information at the end of the simulation to standard error
OutputTiming { start = end } stderr
}
GfsBox {
# Left boundary on the leftmost box is:
# Dirichlet U=1 for the x-component of the velocity
# Dirichlet T = 1 if y < 0, 0 otherwise
left = Boundary {
BcDirichlet U 1
BcDirichlet T { return y < 0. ? 1. : 0.; }
}
}
GfsBox {}
GfsBox {}
GfsBox {}
GfsBox {}
GfsBox {}
GfsBox {}
# Right boundary on the rightmost box is outflow
GfsBox { right = BoundaryOutflow }
# All the boxes are linked by left to right links
1 2 right
2 3 right
3 4 right
4 5 right
5 6 right
6 7 right
7 8 right