A more complicated BC is applied to cavity case in this post.(those after // are not needed)
boundaryField
{
movingWall
{
type groovyBC;
// refValue uniform (0 0 0);
// refGradient uniform (0 0 0);
// valueFraction uniform 1;
// value uniform (0 0 0);
valueExpression "vector(sin(w*time()), 0, 0)";
// gradientExpression "vector(0, 0, 0)";
/ / fractionExpression "1";
variables "w=pi;";
// timelines ( );
}
fixedWall
..
..
}
In this case, start time = 0s, end time = 2s, time step = 0.001s.
Following the expression above, at t = 0, Ux = 0m/s
t = 0.5, Ux = 1m/s
t = 1, Ux = 0m/s
t = 1.5, Ux = -1m/s
t = 2, Ux = 0m/s
Finally, don't forget to type in following lines in system/controlDict:
libs (
"libOpenFOAM.so"
"libgroovyBC.so"
);
Let's see the sinusoidal moving wall:
boundaryField
{
movingWall
{
type groovyBC;
// refValue uniform (0 0 0);
// refGradient uniform (0 0 0);
// valueFraction uniform 1;
// value uniform (0 0 0);
valueExpression "vector(sin(w*time()), 0, 0)";
// gradientExpression "vector(0, 0, 0)";
/ / fractionExpression "1";
variables "w=pi;";
// timelines ( );
}
fixedWall
..
..
}
In this case, start time = 0s, end time = 2s, time step = 0.001s.
Following the expression above, at t = 0, Ux = 0m/s
t = 0.5, Ux = 1m/s
t = 1, Ux = 0m/s
t = 1.5, Ux = -1m/s
t = 2, Ux = 0m/s
Finally, don't forget to type in following lines in system/controlDict:
libs (
"libOpenFOAM.so"
"libgroovyBC.so"
);
Let's see the sinusoidal moving wall: