### How to evaluate slip boundary condition in the Navier Stokes problem?

128

views

3

Dear all,

I am looking for a simple implementation of the slip boundary condition, but without success. Any help is appreciated.

```
def navier_stokes():
# Define unknown and test function(s)
(v_,p_) = TestFunctions(Omega)
# current unknown time step
(v,p) = split(w)
# previous known time step
(v0,p0) = split(w0)
#combine variational forms with time derivative
F = Dt*inner(rho(l)*v - rho(l0)*v0,v_)*dx + NS(v,p,l,v_) + div(v)*p_*dx
# Boundary condition
bcs = list()
#bcs.append( DirichletBC(Omega.sub(0).sub(0), Constant(0.0), "near(x[0],0.0) || near(x[0],1.0)") )
bcs.append( DirichletBC(Omega.sub(0), Constant((0.0,0.0)), "near(x[1],0.0) || near(x[1],2.0) || near(x[0],0.0) || near(x[0],1.0)") )
J = derivative(F,w)
problem=NonlinearVariationalProblem(F,w,bcs,J)
solver=NonlinearVariationalSolver(problem)
prm = solver.parameters
prm['nonlinear_solver'] = 'newton'
prm['newton_solver']['absolute_tolerance'] = 1E-10
prm['newton_solver']['relative_tolerance'] = 1E-10
prm['newton_solver']['maximum_iterations'] = 100
prm['newton_solver']['linear_solver'] = 'mumps'
solver.solve()
return w
```

Community: FEniCS Project

Please login to add an answer/comment or follow this question.

This has implementation too:

https://arxiv.org/abs/1609.02190

This has implementation too:

https://arxiv.org/abs/1609.02190