4 3 GfsSimulation GfsBox GfsGEdge {} {
Global {
static double Re = 50;
static double ReSr = 1.2;
static double cavity_depth = 1.0;
static double floor_depth = 0.5;
static int min_level = 4;
static int max_level = 8;
static double density(double tracer) {
return 1.0;
}
static double velocity_bc(double y, double t) {
if (y > floor_depth) return (0.125*(2*y - 1)*(2*y - 1)*(cos(2*M_PI*t*(ReSr / Re)) + 1));
else return 0;
}
static double tracer_init(double y) {
if (y <= floor_depth) return 1.0;
else return 0.0;
}
}
Solid ({
return y - (floor_depth - cavity_depth);
})
Time { end = 250 }
SourceViscosity (1/Re)
VariableTracerVOF T
Init {} {
T = tracer_init(y)
U = velocity_bc(y, 0)
V = 0
}
AdaptFunction { istep = 1 } {
cmax = 0
minlevel = min_level
maxlevel = max_level
} (T > 0 && T < 1)
AdaptError { istep = 1 } { cmax = 1e-2 maxlevel = max_level } U
AdaptError { istep = 1 } { cmax = 1e-2 maxlevel = max_level } V
EventBalance { istep = 1 } 0.1
OutputTime { istep = 10 } stderr
OutputProjectionStats { istep = 10 } stderr
OutputDiffusionStats { istep = 10 } stderr
OutputTiming { start = end } stderr
GModule gfsview
OutputView { step = 0.5 } { ppm2mpeg -s 400x300 > viscmix.mpg } {
width = 1280 height = 960
} viscmix.gfv
OutputView { start = end } { convert -colors 256 ppm:- viscmix.eps } {
width = 1280 height = 960
} viscmix.gfv
}
GfsBox {
bottom = Boundary {
BcDirichlet U 0
}
left = Boundary {
BcDirichlet V 0
}
right = Boundary {
BcDirichlet V 0
}
}
GfsBox {
left = Boundary {
BcDirichlet U velocity_bc(y, t)
}
bottom = Boundary {
BcDirichlet U 0
}
}
GfsBox {}
GfsBox {
bottom = Boundary {
BcDirichlet U 0
}
right = BoundaryOutflow
}
1 3 top
2 3 right
3 4 right