Hello everyone and good day.
I have a code for simulating Karman vortex street (2D) and wanted to give the cylinder a small rotation, So I thought I could give a constant speed to Dirichlet BC of the cylinder face and wanted to know if I could change it like this: bcu_cyl_wall = DirichletBC(V, Constant((0.2, 0.2)), surfaces, cylinder_noslip_tag)
u_, p_ = Function(V), Function(Q) # Solve into these
dt = Constant(solver_params['dt'])
# Define expressions used in variational forms
U = Constant(0.5)*(u_n + u)
n = FacetNormal(mesh)
f = Constant((0, 0))
epsilon = lambda u :sym(nabla_grad(u))
sigma = lambda u, p: 2*mu*epsilon(u) - p*Identity(2)
# Define variational problem for step 1
F1 = (rho*dot((u - u_n) / dt, v)*dx
+ rho*dot(dot(u_n, nabla_grad(u_n)), v)*dx
+ inner(sigma(U, p_n), epsilon(v))*dx
+ dot(p_n*n, v)*ds - dot(mu*nabla_grad(U)*n, v)*ds
- dot(f, v)*dx)
a1, L1 = lhs(F1), rhs(F1)
# Define variational problem for step 2
a2 = dot(nabla_grad(p), nabla_grad(q))*dx
L2 = dot(nabla_grad(p_n), nabla_grad(q))*dx - (1/dt)*div(u_)*q*dx
# Define variational problem for step 3
a3 = dot(u, v)*dx
L3 = dot(u_, v)*dx - dt*dot(nabla_grad(p_ - p_n), v)*dx
inflow_profile = flow_params['inflow_profile'](mesh, degree=2)
# Define boundary conditions, first those that are constant in time
bcu_inlet = DirichletBC(V, inflow_profile, surfaces, inlet_tag)
# No slip
bcu_wall = DirichletBC(V, Constant((0, 0)), surfaces, wall_tag)
bcu_cyl_wall = DirichletBC(V, Constant((0.2, 0.2)), surfaces, cylinder_noslip_tag)
# Fixing outflow pressure
bcp_outflow = DirichletBC(Q, Constant(0), surfaces, outlet_tag)
Thank you and I would be grateful if someone could help me with this too: