Define D 0.04623
Define RHOF 0.001
Define RHO(T) (T + RHOF*(1. - T))
Define MUF 0.0001
Define LDOMAIN 32.
Define H0 6.26
Define R0 1.
Define LEVEL 10
1 0 GfsSimulation GfsBox GfsGEdge {
x = 0.5 y = 0.5
} {
PhysicalParams { L = LDOMAIN }
Time { end = 5.8 dtmax = 1e-2 }
ApproxProjectionParams { tolerance = 1e-4 }
ProjectionParams { tolerance = 1e-4 }
VariableTracerVOF T
VariablePosition X T x
VariablePosition Y T y
VariableTracerVOF Ti
InitFraction Ti ({
double diametre = 5e-3;
double r0 = 0.677/6.26;
double centre = x - 4.*diametre/r0;
double top = y - H0 + 9.*diametre/r0;
double side = x - R0 + 5.*diametre/r0;
return union (union (-top, -side), centre);
})
SourceViscosity {} {
double Eta = MUF;
if (P > 0. && D2 > 0.) {
double In = sqrt(2.)*D*D2/sqrt(P);
double muI = .32 + (.28)*In/(.4 + In);
double Etamin = sqrt(pow(D,3));
Eta = MAX((muI*P)/(sqrt(2.)*D2), Etamin);
Eta = MIN(Eta,10);
}
return 1./(T/Eta + (1. - T)/MUF);
} {
beta = 1
tolerance = 1e-4
}
AdaptGradient { istep = 1 } {
cmax = 0
maxlevel = LEVEL
} T
AdaptFunction { istep = 1 } {
cmax = 0
maxlevel = LEVEL
} T
PhysicalParams { alpha = 1./RHO(T) }
Source V -1
Refine 6
InitFraction T (union(H0 - y, R0 - x))
OutputTime { istep = 10 } stderr
OutputProjectionStats { istep = 10 } stderr
OutputDiffusionStats { istep = 10 } stderr
EventSum { istep = 1 } U SU
EventSum { istep = 1 } V SV
RemoveDroplets { istep = 1 } T -1
OutputScalarSum { istep = 10 } t-LEVEL { v = T }
OutputSimulation { istep = 10 } stdout
OutputSimulation { start = 0 } snapshot-%g.gfs
OutputSimulation { start = 1.65132 } snapshot-%g.gfs
OutputSimulation { start = 2.3769 } snapshot-%g.gfs
OutputSimulation { start = 3.10248 } snapshot-%g.gfs
OutputSimulation { start = 3.80304 } snapshot-%g.gfs
OutputSimulation { start = 5.70456 } snapshot-%g.gfs
OutputScalarNorm { istep = 10 } X-H0-LEVEL { v = (T > 0.1 ? X : G_MAXDOUBLE) }
OutputScalarNorm { istep = 10 } Y-H0-LEVEL { v = (T > 0.1 ? Y : G_MAXDOUBLE) }
OutputScalarNorm { istep = 10 } Yc-H0-LEVEL { v = (x < 0.1 ? Y : G_MAXDOUBLE) }
OutputScalarSum { istep = 10 } {
awk '{
print $3,$5/(H0*R0);
fflush (stdout);
}' > xg-H0-LEVEL
} { v = T*x }
OutputScalarSum { istep = 10 } {
awk '{
print $3,$5/(H0*R0);
fflush (stdout);
}' > yg-H0-LEVEL
} { v = T*y }
GModule gfsview
OutputView { step = 5e-2 } { ppm2theora -s 640x240 > movie.ogv } {
width = 1280 height = 480
} movie.gfv
EventScript { start = end } {
for t in 0 1.65132 2.3769 3.10248 3.80304 5.70456; do
echo "Save snapshot-$t.gnu { format = Gnuplot }" | \
gfsview-batch2D column.gfv snapshot-$t.gfs
done
echo "Save movie.ppm { format = PPM width = 1280 height = 480 }" | \
gfsview-batch2D movie.gfv snapshot-0.gfs
convert movie.ppm -geometry 640x240 movie.png
convert movie.png movie.eps
rm -f movie.ppm
tar xzf grains.tgz
gnuplot comparison.plot
}
}
GfsBox {
top = Boundary {
BcDirichlet P -RHOF*LDOMAIN
BcNeumann V 0
}
bottom = Boundary {
BcDirichlet U 0
}
left = Boundary
right = Boundary {
BcDirichlet V 0
}
}