I have Stoke flow problem where I have a rectangular domain with a circle cut out. I need to have the circle moving up and down at a sinusoidal manner. I have the following code for BC's that I have to change to achieve this but I'm new to fenics and I'm not sure what to change.
EDIT:
So I figured out that the vc below is just the velocity going through the cylinder and not the boundary's movement. I've been told that fenics has built in functions that can easily do what I'm looking for. Any help would be much appreciated.
# Build function spaces (Taylor-Hood)
V = VectorFunctionSpace(mesh, "CG", 2)
P = FunctionSpace(mesh, "CG", 1)
E = FunctionSpace(mesh, "CG", 1)
W = MixedFunctionSpace([V, P, E])
No-slip boundary condition for velocity on walls and cylinder - boundary id 3
noslip = Constant((0, 0))
bcv_walls = DirichletBC(W.sub(0), noslip, bndry, 3)
vc= Expression(("-0.5tcos(atan2(x[0]-0.2,x[1]-0.2))","0.5tsin(atan2(x[0]-0.2,x[1]-0.2))"),t=0)
bcv_cylinder = DirichletBC(W.sub(0), vc, bndry, 5)
bce_cylinder = DirichletBC(W.sub(2), Constant(1.0), bndry, 5)
Inflow boundary condition for velocity - boundary id 1
v_in = Expression(("1.5 * 4.0 * x[1] * (0.41 - x[1]) / ( 0.41 * 0.41 )", "0.0"))
bcv_in = DirichletBC(W.sub(0), v_in, bndry, 1)
Collect boundary conditions
bcs = [bcv_cylinder, bcv_walls, bcv_in, bce_cylinder]